JP2011141888A - Single chip microcomputer - Google Patents

Single chip microcomputer Download PDF

Info

Publication number
JP2011141888A
JP2011141888A JP2011053899A JP2011053899A JP2011141888A JP 2011141888 A JP2011141888 A JP 2011141888A JP 2011053899 A JP2011053899 A JP 2011053899A JP 2011053899 A JP2011053899 A JP 2011053899A JP 2011141888 A JP2011141888 A JP 2011141888A
Authority
JP
Japan
Prior art keywords
area
nonvolatile
cpu
data
nvram
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2011053899A
Other languages
Japanese (ja)
Inventor
Naomiki Mitsuishi
直幹 三ッ石
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2011053899A priority Critical patent/JP2011141888A/en
Publication of JP2011141888A publication Critical patent/JP2011141888A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Microcomputers (AREA)
  • Memory System (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology for improving security when a nonvolatile storage device, which is readable/writable by random access, is mounted as a program/data memory. <P>SOLUTION: A single chip microcomputer (100) includes a CPU (103) which can perform arithmetic processing based on a preset program and a nonvolatile storage device (101) readable/writable by random access by the CPU. The nonvolatile storage device includes, as storage areas, a nonvolatile hold area for storing the program and a nonvolatile hold invalidated area for storing data. A write operation is performed on the nonvolatile hold invalidated area in the storage areas according to a reset signal indicative of a reset state, thereby erasing data in the nonvolatile hold invalidated area. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、マイクロコンピュータにかかり、例えば一つの半導体基板に形成されたシングルチップマイクロコンピュータに利用して有効な技術に関するものである。   The present invention relates to a microcomputer, and relates to a technique effective for use in, for example, a single chip microcomputer formed on one semiconductor substrate.

シングルチップマイクロコンピュータは、例えば非特許文献1に記載されているように、中央処理装置(CPU)を中心にしてプログラム保持用のROM(リードオンリメモリ)、データ保持用のRAM(ランダムアクセスメモリ)、及びデータの入出力を行うための入出力回路などの機能ブロックが1つの半導体基板に形成される。かかるシングルチップマイクロコンピュータのROMとして、フラッシュメモリを内蔵する場合が増えている。フラッシュメモリによって、その内容を、随時書き換え可能にし、使い勝手を向上することができる。フラッシュメモリは、電気的な書き込み消去が可能なROMであって、その特性上、一旦消去を行った後に、書き込みを行う必要がある。書き込み/消去を制御する専用のプログラムを別のメモリに格納しておいて、それをCPUで実行するように構成することができる(例えば特許文献1参照)。このようにフラッシュメモリは、CPUによる、任意のアドレス順序での、連続したリード/ライトを行うことができないため、ランダムアクセスは不可能とされる。これらの理由により、フラッシュメモリは、CPUの作業用データ領域としては使用できない。作業用データ領域としては、RAMが必要である。このRAMは、半導体集積回路の微細化に伴い、保持電流やソフトエラーなどが問題になっている。ソフトエラーの対策のために、エラーコレクションの論理を持つ例が増えている。フラッシュメモリを使用して、電源の遮断時に、その時点のデータを保持する技術が知られている(例えば特許文献2参照)。フラッシュメモリが、消去を行った後に書き込みを行う必要があること、かつ、書き込み/消去に時間がかかることから、前記のデータ保持のための書き込みを高速に行うために、事前に、フラッシュメモリの消去が行われる。この事前の消去も、フラッシュメモリの内容を確認の後に行うようにされている。換言すれば、プログラム実行による初期化処理としての消去が行われる。   As described in Non-Patent Document 1, for example, a single-chip microcomputer is a program holding ROM (read only memory) and a data holding RAM (random access memory) centered on a central processing unit (CPU). And functional blocks such as an input / output circuit for inputting / outputting data are formed on one semiconductor substrate. Increasing use of a flash memory as a ROM of such a single chip microcomputer is increasing. The contents of the flash memory can be rewritten at any time, and the usability can be improved. The flash memory is a ROM that can be electrically written and erased. Due to its characteristics, the flash memory needs to be written after being erased once. A dedicated program for controlling writing / erasing can be stored in another memory and executed by the CPU (see, for example, Patent Document 1). Thus, since the flash memory cannot perform continuous read / write in an arbitrary address sequence by the CPU, random access is impossible. For these reasons, the flash memory cannot be used as a work data area for the CPU. A RAM is required as the work data area. With this RAM, with the miniaturization of a semiconductor integrated circuit, a holding current, a soft error, and the like become problems. In order to deal with soft errors, an increasing number of examples have error collection logic. A technique is known that uses flash memory to hold data at that time when the power is shut off (see, for example, Patent Document 2). Since the flash memory needs to be written after erasing, and it takes time to write / erase, in order to perform the writing for holding the data at a high speed, Erasing is performed. This prior erasure is also performed after confirming the contents of the flash memory. In other words, erasing is performed as initialization processing by program execution.

一方、フラッシュメモリに代表されるような不揮発性メモリでありながら、読み書き回数に制限がないメモリとして、マグネトロレジスティブ・ランダム・アクセス・メモリ(MRAM)が知られている(例えば特許文献3,4参照)。MRAMは、磁化の向きで素子の抵抗が異なる磁気抵抗効果を利用して情報を記憶する。磁気抵抗変化率が従来の素子よりも大きなマグネティック・トンネル・ジャンクション(MTJ)素子が開発されることにより、スタティック・ランダム・アクセス・メモリ(SRAM)並みの高速読み書き動作が可能で、DRAM並みの高集積度の実現が可能とされる。このようなMRAMによれば、従来のRAMと同様、ランダムアクセスによるリード・ライトが可能とされる。しかも、書き込みに際して事前に消去を行う必要がない。   On the other hand, a magnetoresistive random access memory (MRAM) is known as a non-volatile memory typified by a flash memory but having no limit on the number of times of reading and writing (for example, Patent Document 3). 4). The MRAM stores information using a magnetoresistive effect in which the resistance of an element differs depending on the direction of magnetization. The development of magnetic tunnel junction (MTJ) elements, which have a higher magnetoresistance change rate than conventional elements, enables high-speed read / write operations similar to static random access memories (SRAMs), which are as high as DRAMs. It is possible to realize the degree of integration. According to such an MRAM, it is possible to read / write by random access as in the conventional RAM. Moreover, it is not necessary to erase in advance before writing.

特開昭63−266698号公報JP-A 63-266698 特開2005−322293号公報JP 2005-322293 A 特開2002−222589号公報JP 2002-222589 A 特開2004−86986号公報JP 2004-86986 A

昭和59年11月30日オーム社発行『LSIハンドブック』P540及びP541November 30, 1984, published by Ohmsha "LSI Handbook" P540 and P541

MRAMなどのように不揮発保持が可能なRAM(NVRAM)は、ランダムアクセスによるリード及びライトが可能であるため、CPUのプログラム領域としても、作業用データ領域としても使用可能である。しかも、このNVRAMにデータを格納すれば、電源遮断後も記憶データの内容を保持できる。従って、NVRAMを搭載することにより、電源投入時や、リセット時などに、それ以前のデータを参照することができる。このため、プログラム用メモリと、作業用メモリとを、一つのNVRAMで実現することができる。このように一種類のメモリで済めば、ハードウェア資源を節約できるし、製造工程の簡略化に寄与できる。   Since a RAM (NVRAM) that can be held in a nonvolatile manner such as an MRAM can be read and written by random access, it can be used as a program area for a CPU and a work data area. In addition, if data is stored in this NVRAM, the contents of the stored data can be retained even after the power is turned off. Therefore, by installing NVRAM, it is possible to refer to previous data when the power is turned on or reset. Therefore, the program memory and the working memory can be realized by one NVRAM. If only one type of memory is used in this way, hardware resources can be saved and the manufacturing process can be simplified.

しかしながら、このようなNVRAMをマイクロコンピュータに搭載することについて本願発明者が検討したところ、マイクロコンピュータに内蔵されたNVRAMに全てのデータを保持させることはセキュリティの面で好ましくないことが見いだされた。例えば、ID情報や鍵情報、暗号を復号化した後の情報などの秘密情報が不揮発保持されていると、マイクロコンピュータを不正に動作させて、秘密情報をリードされたりすることが考えられるからである。   However, when the inventors of the present application have examined the installation of such NVRAM in a microcomputer, it has been found that it is not preferable in terms of security to hold all data in the NVRAM built in the microcomputer. For example, if secret information such as ID information, key information, and information after decryption of encryption is held in a nonvolatile manner, it is considered that the microcomputer can be illegally operated to read the secret information. is there.

本発明の目的は、ランダムアクセスによってリード・ライト可能な不揮発性記憶装置(NVRAM)を、プログラム/データ兼用のメモリとして搭載した場合のセキュリティの向上を図るための技術を提供することにある。   An object of the present invention is to provide a technique for improving security when a nonvolatile memory device (NVRAM) that can be read / written by random access is mounted as a program / data combined memory.

本発明の前記ならびにそのほかの目的と新規な特長は、本発明書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will become apparent from the description of the present invention and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

〔1〕予め設定されたプログラムに基づく演算処理を可能とするCPUと、このCPUによるランダムアクセスによってリード・ライト可能な不揮発性記憶装置とを含んで成るマイクロコンピュータにおいて、上記不揮発性記憶装置には、記憶領域の一部に不揮発保持が無効とされる領域を設ける。   [1] In a microcomputer comprising a CPU that enables arithmetic processing based on a preset program and a nonvolatile memory device that can be read and written by random access by the CPU, the nonvolatile memory device includes An area where nonvolatile retention is invalidated is provided in a part of the storage area.

上記の手段によれば、上記不揮発性記憶装置に、記憶領域の一部に不揮発保持が無効とされる領域が設けられているため、この領域を、秘密を保持すべきデータの格納用とすることにより、この秘密を保持すべきデータが上記不揮発性記憶装置に不揮発保持されることが回避される。このことが、ランダムアクセスによってリード・ライト可能な不揮発性記憶装置を、プログラム/データ兼用のメモリとして搭載した場合のセキュリティの向上を達成する。   According to the above means, since the nonvolatile storage device is provided with an area in which nonvolatile retention is invalidated as a part of the storage area, this area is used for storing data that should be kept secret. As a result, it is possible to prevent the data to be kept secret from being held in the nonvolatile storage device in a nonvolatile manner. This achieves an improvement in security when a nonvolatile storage device that can be read / written by random access is mounted as a program / data combined memory.

〔2〕上記〔1〕において、上記不揮発性記憶装置には、上記ライトに際して事前の消去処理が行われることなく、記憶情報の書き換えが可能とされるものを適用することができる。   [2] In the above [1], a device that can rewrite stored information without performing an erasing process in advance at the time of writing can be applied to the nonvolatile storage device.

〔3〕上記〔1〕において、電源電圧レベルを検出可能な電源検出部を含み、電源投入後、上記電源検出部での検出結果に基づいて上記不揮発性記憶装置の動作が開始されるように構成することができる。   [3] In the above [1], including a power supply detection unit capable of detecting a power supply voltage level, after the power is turned on, the operation of the nonvolatile memory device is started based on a detection result in the power supply detection unit. Can be configured.

〔4〕上記〔1〕において、上記CPUの動作を監視するための動作監視部を含み、上記動作監視部での監視結果に基づいて上記不揮発性記憶装置の動作が開始されるように構成することができる。   [4] In the above [1], an operation monitoring unit for monitoring the operation of the CPU is included, and the operation of the nonvolatile memory device is started based on a monitoring result in the operation monitoring unit. be able to.

〔5〕上記〔1〕において、上記不揮発性記憶装置は、上記CPUで実行されるプログラムを格納可能なプログラム領域と、上記CPUでのプログラム実行において使用されるデータを格納可能なデータ領域とを含み、上記CPUでの上記プログラムの実行によって、上記データ領域へのデータ書き込みが可能とされ、上記不揮発性記憶装置における少なくとも一部の記憶領域についての不揮発保持が無効とされた後に、上記CPUによるリード動作が許可されるように構成することができる。   [5] In the above [1], the nonvolatile storage device includes a program area capable of storing a program executed by the CPU and a data area capable of storing data used in the program execution by the CPU. In addition, by executing the program in the CPU, data can be written into the data area, and after the nonvolatile retention in at least a part of the storage area in the nonvolatile storage device is invalidated, the CPU executes The read operation may be permitted.

〔6〕上記〔1〕において、上記不揮発性記憶装置における少なくとも一部の記憶領域についての不揮発保持を無効にする動作は、上記不揮発性記憶装置に対する所定の値のライト動作とすることができる。   [6] In the above [1], the operation of invalidating the nonvolatile retention for at least a part of the storage area in the nonvolatile storage device may be a write operation of a predetermined value to the nonvolatile storage device.

〔7〕上記〔1〕において、上記不揮発性記憶装置は、上記CPUで実行されるプログラムを格納可能なプログラム領域と、上記CPUでのプログラム実行において使用されるデータを格納可能なデータ領域と、を含み、上記CPUでの上記プログラムの実行によって、上記データ領域へのデータ書き込みが可能とされ、上記CPUによって上記データ領域へのデータ書き込みが行われた後に、上記データ領域のリードが許可されるように構成することができる
〔8〕上記〔1〕において、上記不揮発性記憶装置は、上記CPUによって管理される第1アドレス領域及び第2アドレス領域に配置され、上記第1アドレス領域からは上記不揮発性記憶装置のリードのみが可能とされ、上記第2アドレス領域からは上記不揮発性記憶装置のリード及びライトが可能とされる。
[7] In the above [1], the nonvolatile storage device stores a program area capable of storing a program executed by the CPU, a data area capable of storing data used in program execution by the CPU, The CPU can write data to the data area by executing the program on the CPU, and the data area can be read after the CPU writes data to the data area. [8] In the above [1], the non-volatile storage device is arranged in a first address area and a second address area managed by the CPU, and the first address area Only the nonvolatile memory device can be read, and the nonvolatile memory device can be read from the second address area. And light is enabled.

〔9〕上記〔1〕において、上記不揮発性記憶装置において不揮発保持が無効にされる領域には、秘密を保持すべきデータを格納することができる。   [9] In the above [1], data to be kept secret can be stored in the area where the nonvolatile holding is invalidated in the nonvolatile memory device.

〔10〕上記〔1〕において、上記不揮発性記憶装置において不揮発保持が無効にされる領域には、暗号化されるべき元のデータ、復号化されたデータ、又は暗号化又は復号化のための情報を格納することができる。   [10] In the above [1], in the non-volatile storage device, in the area where the nonvolatile retention is invalidated, the original data to be encrypted, the decrypted data, or the encryption or decryption Information can be stored.

〔11〕上記〔6〕において、上記不揮発性記憶装置における少なくとも一部の記憶領域についての不揮発保持を無効にするためのライト動作は、上記CPUのプログラム実行によるライト動作とは別個に行うことができる。   [11] In the above [6], the write operation for invalidating the nonvolatile retention for at least a part of the storage area in the nonvolatile storage device may be performed separately from the write operation by the program execution of the CPU. it can.

〔12〕予め設定されたプログラムに基づく演算処理を可能とするCPUと、上記CPUによるランダムアクセスによってリード・ライト可能な不揮発性記憶装置と、上記不揮発性記憶装置の動作開始又は電源遮断の少なくとも一方において、上記不揮発性記憶装置における一部の記憶領域についての不揮発保持を無効にするためのメモリコントローラとを含んでマイクロコンピュータを構成することができる。   [12] A CPU that enables arithmetic processing based on a preset program, a non-volatile storage device that can be read / written by random access by the CPU, and at least one of operation start or power-off of the non-volatile storage device The microcomputer can be configured to include a memory controller for invalidating non-volatile retention for a part of the storage areas in the non-volatile storage device.

かかる構成においても、上記不揮発性記憶装置に、記憶領域の一部に不揮発保持が無効とされる領域が設けられているため、この領域を、秘密を保持すべきデータの格納用とすることにより、この秘密を保持すべきデータが上記不揮発性記憶装置に不揮発保持されることが回避される。このことが、ランダムアクセスによってリード・ライト可能な不揮発性記憶装置を、プログラム/データ兼用のメモリとして搭載した場合のセキュリティの向上を達成する。   Even in such a configuration, since the nonvolatile storage device is provided with an area where nonvolatile retention is invalidated in a part of the storage area, this area is used for storing data that should be kept secret. This prevents the data to be kept secret from being held in the nonvolatile storage device in a nonvolatile manner. This achieves an improvement in security when a nonvolatile storage device that can be read / written by random access is mounted as a program / data combined memory.

〔13〕上記〔12〕において、上記不揮発性記憶装置は、上記ライトに際して事前の消去処理が行われることなく、記憶情報の書き換えが可能とされる。   [13] In the above [12], the nonvolatile storage device can rewrite stored information without performing an erasing process in advance at the time of writing.

〔14〕上記〔12〕において、上記CPU及び上記不揮発性記憶装置を初期状態に戻して動作を開始させるためのリセット信号を生成可能なリセットコントローラを含み、上記リセットコントローラは、上記マイクロコンピュータに供給される電源電圧のレベルを検出する電源検出部を含み、上記電源検出部での検出結果に基づいて上記リセット信号を形成するように構成することができる。   [14] In [12], including a reset controller capable of generating a reset signal for returning the CPU and the nonvolatile memory device to an initial state and starting an operation, and the reset controller is supplied to the microcomputer A power supply detection unit for detecting the level of the power supply voltage to be generated, and the reset signal may be formed based on a detection result of the power supply detection unit.

〔15〕上記〔12〕において、上記不揮発性記憶装置を初期状態に戻して動作を開始させるためのリセット信号を生成可能なリセットコントローラと、上記CPUの動作を監視可能な動作監視部と、を含み、上記リセットコントローラによって、上記動作監視部での監視結果に基づいて上記リセット信号を形成するように構成することができる。   [15] In the above [12], a reset controller capable of generating a reset signal for returning the nonvolatile memory device to an initial state and starting an operation, and an operation monitoring unit capable of monitoring the operation of the CPU. In addition, the reset controller can be configured to form the reset signal based on the monitoring result of the operation monitoring unit.

〔16〕上記〔12〕において、上記不揮発性記憶装置は、上記CPUで実行されるプログラムを格納可能なプログラム領域と、上記CPUでのプログラム実行において使用されるデータを格納可能なするデータ領域とを含み、上記CPUでの上記プログラムの実行によって、上記データ領域へのデータ書き込みが可能とされ、上記メモリコントローラによって上記不揮発性記憶装置における少なくとも一部の記憶領域についての不揮発保持が無効とされた後に、上記CPUによるリード動作が許可されるように構成することができる。   [16] In the above [12], the nonvolatile storage device includes a program area capable of storing a program executed by the CPU, and a data area capable of storing data used in program execution by the CPU. And the execution of the program by the CPU enables data to be written to the data area, and the memory controller invalidates nonvolatile retention for at least a part of the storage area in the nonvolatile storage device. Later, the read operation by the CPU can be permitted.

〔17〕上記〔12〕において、上記不揮発性記憶装置は、上記CPUで実行されるプログラムを格納可能なプログラム領域と、上記CPUでのプログラム実行において使用されるデータを格納可能なするデータ領域とを含み、上記CPUによって上記データ領域へのデータ書き込みが行われた後に、上記データ領域のリード動作が許可されるように構成することができる。   [17] In the above [12], the nonvolatile storage device includes a program area capable of storing a program executed by the CPU, and a data area capable of storing data used in program execution by the CPU. And after the data is written into the data area by the CPU, a read operation of the data area is permitted.

〔18〕上記〔12〕において、上記不揮発性記憶装置において不揮発保持が無効にされる領域は、上記CPUの例外処理ベクタを含まない作業領域とすることができる。   [18] In the above [12], the area in which nonvolatile retention is invalidated in the nonvolatile storage device can be a work area that does not include the CPU exception processing vector.

〔19〕上記〔12〕において、上記CPUは、上記不揮発性記憶装置において不揮発保持が無効にされる領域に、秘密を保持すべきデータを格納するように構成することができる。   [19] In the above [12], the CPU may be configured to store data that should be kept secret in an area where nonvolatile retention is invalidated in the nonvolatile storage device.

〔20〕上記〔12〕において、上記メモリコントローラは、不揮発保持を無効にするための信号を生成するためのライト制御部、及び不揮発保持を無効にするための信号と上記CPUのリード又はライトのための信号とを選択するためのマルチプレクサを含んで構成することができる。   [20] In the above [12], the memory controller includes a write control unit for generating a signal for invalidating nonvolatile holding, and a signal for invalidating nonvolatile holding and reading or writing of the CPU. And a multiplexer for selecting a signal for use.

〔21〕上記〔12〕において、上記メモリコントローラは、上記不揮発性記憶装置における少なくとも一部の記憶領域についての不揮発保持を無効にするためのライト動作を、上記CPUによるライト動作とは別個に行うためのライト制御部を含んで構成することができる。   [21] In the above [12], the memory controller performs a write operation for invalidating non-volatile retention for at least a part of the storage area in the nonvolatile storage device separately from the write operation by the CPU. For this reason, the light control unit can be configured.

〔22〕予め設定されたプログラムに基づく演算処理を可能とするCPUと、上記CPUによるランダムアクセスによってリードライト可能な不揮発性記憶装置とを含むマイクロコンピュータにおいて、上記不揮発性記憶装置は、上記CPUで実行されるプログラムを格納可能なプログラム領域と、上記CPUでのプログラム実行において使用されるデータを格納可能なするデータ領域とを含み、上記データ領域は、不揮発保持が可能とされる第1記憶領域と、不揮発保持が無効とされる第2記憶領域とを含み、上記CPUは、上記第2記憶領域を作業領域として使用する。   [22] In a microcomputer including a CPU that enables arithmetic processing based on a preset program and a nonvolatile storage device that can be read and written by random access by the CPU, the nonvolatile storage device is the CPU. A first storage area that includes a program area that can store a program to be executed and a data area that can store data used in program execution by the CPU, and the data area can be held in a nonvolatile manner And a second storage area in which nonvolatile retention is invalidated, and the CPU uses the second storage area as a work area.

上記の手段によれば、上記不揮発性記憶装置に、不揮発保持が無効とされる第2記憶領域が設けられ、この領域が上記CPUの作業領域とされることにより、例えばCPUの動作中に悪意を持って電源が遮断された場合でも、上記第2記憶領域の不揮発保持が無効とされるため、上記CPUでの作業内容の外部への読み出しを回避することができる。このことが、セキュリティの強化を達成する。   According to the above means, the non-volatile storage device is provided with the second storage area in which the non-volatile retention is invalidated, and this area is used as the work area of the CPU. Even when the power supply is shut off with the power supply, the nonvolatile storage of the second storage area is invalidated, so that reading of work contents to the outside by the CPU can be avoided. This achieves enhanced security.

〔23〕上記〔22〕において、上記不揮発性記憶装置の動作開始又は電源遮断の少なくとも一方において、上記不揮発性記憶装置における不揮発保持が無効とされる領域に対して書き込み又は書き換えの動作が行われるように構成することができる。   [23] In the above [22], at least one of the operation start and the power shutdown of the nonvolatile memory device, a write or rewrite operation is performed on an area where nonvolatile retention in the nonvolatile memory device is invalidated It can be constituted as follows.

〔24〕上記〔22〕において、上記不揮発性記憶装置の不揮発保持が無効な領域への書き込み又は書き換えが行われるまで、上記不揮発性記憶装置からのリードが阻止されるように構成することができる。   [24] In the above [22], reading from the nonvolatile memory device can be prevented until writing or rewriting to an area where nonvolatile retention of the nonvolatile memory device is invalid is performed. .

本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば下記の通りである。   The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、ランダムアクセスによってリード・ライト可能な不揮発性記憶装置(NVRAM)をプログラム/データ兼用のメモリとして搭載した場合のセキュリティの向上を図ることができる。   That is, it is possible to improve security when a nonvolatile memory device (NVRAM) that can be read / written by random access is mounted as a program / data memory.

本発明の一実施例とされるマイクロコンピュータの構成例ブロック図である。1 is a block diagram illustrating a configuration example of a microcomputer according to an embodiment of the present invention. 上記マイクロコンピュータの別の構成例ブロック図である。It is another example block diagram of the microcomputer. 上記マイクロコンピュータに含まれるNVMCの構成例ブロック図である。It is a block diagram of a configuration example of NVMC included in the microcomputer. 上記マイクロコンピュータに含まれるNVMCの別の構成例ブロック図である。It is another example block diagram of NVMC included in the microcomputer. 上記マイクロコンピュータに含まれるCPUによって管理されるアドレス空間の説明図である。It is explanatory drawing of the address space managed by CPU contained in the said microcomputer. 上記マイクロコンピュータに含まれるNVRAMの格納データ例の説明図である。It is explanatory drawing of the stored data example of NVRAM contained in the said microcomputer. 上記マイクロコンピュータに含まれるNVMCの状態遷移説明図である。It is state transition explanatory drawing of NVMC contained in the said microcomputer. 上記マイクロコンピュータに含まれるNVMCの別の状態遷移説明図である。It is another state transition explanatory drawing of NVMC contained in the said microcomputer. 上記マイクロコンピュータにおける主要部の動作タイミング図である。It is an operation | movement timing diagram of the principal part in the said microcomputer. 上記マイクロコンピュータにおける主要部の別の動作タイミング図である。It is another operation | movement timing diagram of the principal part in the said microcomputer. 上記マイクロコンピュータにおける主要部の別の動作タイミング図である。It is another operation | movement timing diagram of the principal part in the said microcomputer. 図4に示される構成を採用した場合のマイクロコンピュータの動作タイミング図である。FIG. 5 is an operation timing chart of the microcomputer when the configuration shown in FIG. 4 is adopted. 上記マイクロコンピュータに含まれるCPUのリセット解除時のフローチャートである。It is a flowchart at the time of reset cancellation | release of CPU contained in the said microcomputer. 上記マイクロコンピュータの応用例の説明図である。It is explanatory drawing of the example of application of the said microcomputer. 図14に示される応用例における処理のフローチャートである。It is a flowchart of the process in the application example shown by FIG.

図1には、本発明にかかるマイクロコンピュータの構成例が示される。   FIG. 1 shows a configuration example of a microcomputer according to the present invention.

図1に示されるマイクロコンピュータ100は、シングルチップマイクロコンピュータとされ、特に制限されないが、中央処理装置(CPU)103、不揮発性記憶装置(NVRAM)101、メモリコントローラ(NVMC)102、バスコントローラ(BSC)111、リセットコントローラ(RESC)113、割り込みコントローラ(INT)112、暗号処理機能部106、及び入出力(I/O)部107を含み、公知の半導体集積回路製造技術により、単結晶シリコン基板などの一つの半導体基板に形成される。   A microcomputer 100 shown in FIG. 1 is a single-chip microcomputer, and is not particularly limited, but includes a central processing unit (CPU) 103, a nonvolatile storage device (NVRAM) 101, a memory controller (NVMC) 102, a bus controller (BSC). ) 111, a reset controller (RESC) 113, an interrupt controller (INT) 112, a cryptographic processing function unit 106, and an input / output (I / O) unit 107, such as a single crystal silicon substrate by a known semiconductor integrated circuit manufacturing technique Formed on one semiconductor substrate.

I/O部107は、外部との間で各種信号の入出力を可能とする入出力ポートの他に、内部バス(Iバス)と外部バス(EXAB,EXDB)との間に介在されたバッファ(BUF)108、CPU103の動作を監視するためのウォッチドッグタイマ(WDT)109、シリアル通信ラインを介してシリアル通信を可能とするシリアルコミュニケーションインタフェース(SCI)110、及びアナログ信号をディジタル信号に変換するためのA/D(アナログ/ディジタル)変換器122などの各種周辺回路を含む。   The I / O unit 107 is a buffer interposed between an internal bus (I bus) and an external bus (EXAB, EXDB), in addition to an input / output port that enables input / output of various signals to / from the outside. (BUF) 108, watchdog timer (WDT) 109 for monitoring the operation of CPU 103, serial communication interface (SCI) 110 enabling serial communication via a serial communication line, and converting an analog signal into a digital signal Various peripheral circuits such as an A / D (analog / digital) converter 122 for the purpose.

尚、このマイクロコンピュータ100には、図示されないが、クロック発振器(CPG)などの機能ブロックが設けられている。   Although not shown, the microcomputer 100 is provided with functional blocks such as a clock oscillator (CPG).

CPU103は、制御部104と実行部105を含み、主として、NVRAM101からフェッチした命令を実行する。作業用のデータ領域としてNVRAM101が使用される。   The CPU 103 includes a control unit 104 and an execution unit 105, and mainly executes instructions fetched from the NVRAM 101. The NVRAM 101 is used as a work data area.

NVRAM101は、特に制限されないが、不揮発性メモリでありながら、読み書き回数に制限がないメモリの一例であるマグネトロレジスティブ・ランダム・アクセス・メモリ(MRAM)とされる。MRAMは、磁化の向きで素子の抵抗が異なる磁気抵抗効果を利用して情報を記憶可能な複数のメモリセルがアレイ状に配列されて成る。このメモリセルは、マグネティック・トンネル・ジャンクション(MTJ)素子などとされる。NVRAM101の動作は、NVMC102によって制御される。NVRAM101は、NVMC102を介して、Iバス115に接続され、このIバス115経由でリード/ライト可能とされる。NVMC102は、所定のアドレスに対するライトを行うことが可能で、このライトのための制御信号や、アドレス信号及びデータを生成し、Iバス115による相当信号とマルチプレクスを行い、NVRAM101に供給する。すなわち、NVRAM101は、Iバス115からのライトと、NVMC102からのライトが可能にされる。NVMC102は、必要に応じてウェイト信号を生成し、それをBSC111に供給する。   The NVRAM 101 is not particularly limited, but is a magnetoresistive random access memory (MRAM) that is an example of a memory that is a non-volatile memory but has no limitation on the number of reading and writing. An MRAM is formed by arranging a plurality of memory cells in an array form that can store information using a magnetoresistive effect in which the resistance of an element varies depending on the direction of magnetization. This memory cell is a magnetic tunnel junction (MTJ) element or the like. The operation of the NVRAM 101 is controlled by the NVMC 102. The NVRAM 101 is connected to the I bus 115 via the NVMC 102 and can be read / written via the I bus 115. The NVMC 102 can write to a predetermined address, generates a control signal for this write, an address signal and data, multiplexes the corresponding signal with the I bus 115, and supplies the multiplexed signal to the NVRAM 101. That is, the NVRAM 101 can be written from the I bus 115 and from the NVMC 102. The NVMC 102 generates a wait signal as necessary and supplies it to the BSC 111.

マイクロコンピュータ100は、Iバス(第1内部バス)115、Pバス(第2内部バス)116を有し、これらのバスによって、上記各機能ブロックが相互に接続される。それぞれのバスはアドレスバス及びデータバスの他、バス権要求信号、バスアクノレッジ信号、バスコマンド(又はリード信号、ライト信号、バスサイズ信号)、レディ信号(またはウェイト信号)などを伝達するためのコントロールバスを含む。   The microcomputer 100 has an I bus (first internal bus) 115 and a P bus (second internal bus) 116, and the functional blocks are connected to each other by these buses. In addition to the address bus and data bus, each bus has a control for transmitting a bus right request signal, a bus acknowledge signal, a bus command (or a read signal, a write signal, a bus size signal), a ready signal (or a wait signal), etc. Including buses.

Iバス115は、CPU103によるNVRAM101の高速アクセスを可能とする。NVRAM101のアクセスは1ステートで行われる。接続先が少数であるため、バス幅は任意にでき、例えば32ビットなどとされる。尚、DMAC(ダイレクト・メモリ・アクセス・コントローラ)などの内部バスマスタを設ける場合、当該バスマスタはこのIバスに接続される。   The I bus 115 enables high-speed access of the NVRAM 101 by the CPU 103. The NVRAM 101 is accessed in one state. Since the number of connection destinations is small, the bus width can be arbitrarily set, for example, 32 bits. When an internal bus master such as a DMAC (Direct Memory Access Controller) is provided, the bus master is connected to this I bus.

暗号機能部106は、Iバス115に接続され、CPU103の制御下で、暗号化処理及び復号化処理を行う。暗号機能部106は、バスマスタとしてもよいし、バススレーブとしてもよい。バスマスタとする場合には、NVRAM101に対してリード/ライトを行う。不揮発保持無効領域に格納された鍵情報を用いた暗号化処理が実行可能に構成される。   The cryptographic function unit 106 is connected to the I bus 115 and performs encryption processing and decryption processing under the control of the CPU 103. The cryptographic function unit 106 may be a bus master or a bus slave. When the bus master is used, the NVRAM 101 is read / written. An encryption process using the key information stored in the nonvolatile holding invalid area is configured to be executable.

Pバス116には、上記I/O部107に含まれるI/Oレジスタ121、前記周辺回路などが接続される。Iバス115とPバス116とが分離されているため、CPU103のプログラムリードなどで、主として使用されるIバス115の負荷を軽減することで高速化を図ることができ、未使用時のPバス116の状態を保持するなどして低消費電力化を図ることができる。   The P bus 116 is connected to the I / O register 121 included in the I / O unit 107 and the peripheral circuit. Since the I bus 115 and the P bus 116 are separated, it is possible to increase the speed by reducing the load on the I bus 115 used mainly by the program read of the CPU 103, and the P bus when not in use. The power consumption can be reduced by maintaining the state of 116.

CPU103が、Pバス116に接続されるI/Oレジスタ121をアクセスする場合は、Iバス115及びBSC111を経由して行われる。I/Oレジスタ121のアクセスは2ステートで行われる。接続先が多数であり、バス幅を広げると物理的な規模が増加するため、例えば16ビットとする。   The CPU 103 accesses the I / O register 121 connected to the P bus 116 through the I bus 115 and the BSC 111. Access to the I / O register 121 is performed in two states. Since there are many connection destinations and the physical scale increases when the bus width is widened, for example, 16 bits are set.

Iバス115と外部バス117とは、バッファ(BUF)108によってインタフェースされる。外部バス117には、外部メモリなどを接続することができる。これらのバスを、バスコントローラ(BSC)が制御する。NVMC102やBUF108からBSC111に対してウェイトが要求される。また、BSC111はCPU103に対してウェイトを要求することができる。   The I bus 115 and the external bus 117 are interfaced by a buffer (BUF) 108. An external memory or the like can be connected to the external bus 117. These buses are controlled by a bus controller (BSC). A wait is requested from the NVMC 102 or the BUF 108 to the BSC 111. Further, the BSC 111 can request a wait from the CPU 103.

リセットコントローラ(RESC)113は、マイクロコンピュータ100の外部から入力されるリセット信号RESなどのリセット要因を取り込み、マイクロコンピュータ100の各モジュールに対するリセット信号120を出力する。このリセット信号120には、CPU103に供給されるリセット信号や、NVMC102に供給されるリセット状態遷移信号も含まれる。リセット要因には、WDT109のオーバフローなども含まれる。また、RESC113は、電源電圧Vccレベルを検出するための電源検出回路114を含み、この電源検出回路114での検出結果に基づいてリセット信号を発生することができる。   The reset controller (RESC) 113 receives a reset factor such as a reset signal RES input from the outside of the microcomputer 100 and outputs a reset signal 120 for each module of the microcomputer 100. The reset signal 120 includes a reset signal supplied to the CPU 103 and a reset state transition signal supplied to the NVMC 102. The reset factor includes an overflow of the WDT 109 and the like. The RESC 113 includes a power supply detection circuit 114 for detecting the power supply voltage Vcc level, and can generate a reset signal based on the detection result of the power supply detection circuit 114.

マイクロコンピュータ100は、上記の他に以下の機能を備える。   The microcomputer 100 has the following functions in addition to the above.

割り込みントローラ(INT)112は、周辺回路(WDT109、SCI110、A/D変換器122)からの割り込み信号を取り込み、CPU103に割り込要求信号を出力する。WDT109は、CPU103の暴走を検知してリセットを要求する。   The interrupt controller (INT) 112 receives an interrupt signal from the peripheral circuit (WDT 109, SCI 110, A / D converter 122) and outputs an interrupt request signal to the CPU 103. The WDT 109 detects a runaway of the CPU 103 and requests a reset.

図3には、上記NVMC102の構成例が示される。   FIG. 3 shows a configuration example of the NVMC 102.

NVMC102は、マルチプレクサ1021、ライト制御部1022、アドレス判定部1023を含む。ライト制御部1022は、動作開始後に、所定のアドレスに対するライト制御信号1024を生成する。所定のアドレスは、1ビット又は複数ビット、バイト/ワードなどのCPU103のデータの単位、NVRAM101のワード線単位、あるいはそれ以上のいずれでもよい。ライト制御信号1024には、アドレス、データ、ライト信号などが含まれ、それらは、マルチプレクサ1021を介して、NVRAM101に供給される。ライトデータは、NVRAM101の記憶領域の一部についての不揮発保持を無効とするためのもので、論理値‘0’でも論理値‘1’でもよく、さらには‘0’と‘1’との混在データであっても、ユーザによって設定可能な所定の任意の値であってもよい。ライト回数は、NVMC102の外部から指定できるようにしてよい。この指定は、固定的なものであってもよい。この指定に拘らず、一部領域は必ずライトを行うようにするとよい。ライトデータのサイズと、ライト回数とを設定することによって、不揮発保持無効領域のサイズを任意に変更することが可能となる。   The NVMC 102 includes a multiplexer 1021, a write control unit 1022, and an address determination unit 1023. The write control unit 1022 generates a write control signal 1024 for a predetermined address after the operation starts. The predetermined address may be one or more bits, a unit of data of the CPU 103 such as a byte / word, a unit of a word line of the NVRAM 101, or more. The write control signal 1024 includes an address, data, a write signal, and the like, and these are supplied to the NVRAM 101 via the multiplexer 1021. The write data is for invalidating non-volatile retention for a part of the storage area of the NVRAM 101, and may be a logical value “0” or a logical value “1”, and a mixture of “0” and “1”. It may be data or a predetermined arbitrary value that can be set by the user. The number of writes may be specified from outside the NVMC 102. This designation may be fixed. Regardless of this designation, it is desirable to always write to a partial area. By setting the size of the write data and the number of writes, the size of the nonvolatile holding invalid area can be arbitrarily changed.

また、NVMC102がNVRAM101に対するライトを行っている状態では、CPU103やBSC111に対し、ウェイト要求を行うようにする。マルチプレクサ1021は、上記ライト制御信号1024と、Iバス115によるバス制御信号を選択的にNVRAM101に与える。ライト制御部1022によってライト制御が行われている期間は、マルチプレクサ1021によってライト制御信号1024が選択される。アドレス判定部1023は、Iバス115から入力されたアドレス(CPU103のアドレス)を判定し、後述する第1の領域に対するライトが行われた場合は、NVRAM101に対するライトを抑止するように、マルチプレクサ1021に第1領域ライト抑止信号を与える。   Further, when the NVMC 102 is writing to the NVRAM 101, a wait request is made to the CPU 103 and the BSC 111. The multiplexer 1021 selectively supplies the NVRAM 101 with the write control signal 1024 and the bus control signal from the I bus 115. During the period in which the write control is performed by the write control unit 1022, the write control signal 1024 is selected by the multiplexer 1021. The address determination unit 1023 determines the address (the address of the CPU 103) input from the I bus 115. When a write to a first area described later is performed, the address determination unit 1023 instructs the multiplexer 1021 to suppress writing to the NVRAM 101. A first area write suppression signal is provided.

尚、NVRAM101が複数モジュールに分割されている場合において、不揮発保持無効領域を持たないモジュールがある場合、当該モジュールについては、NVMC102を介さずに当該NVRAM101をIバス115に接続することができる。   When the NVRAM 101 is divided into a plurality of modules and there is a module that does not have a non-volatile holding invalid area, the NVRAM 101 can be connected to the I bus 115 without going through the NVMC 102.

図5には上記CPU103によって管理されるアドレス空間が示される。   FIG. 5 shows an address space managed by the CPU 103.

特に制限されないが、CPU103のアドレス空間は4Gバイトである。マイクロコンピュータ100内部のNVRAM101、I/Oレジスタ121は、それぞれ固有のアドレス、バス幅、アクセスステート数で動作する。前記の通り、NVRAM101は、NVMC102を介して内部バス(Iバス115)によって接続され、通常は1ステートでリード/ライトが行われる。NVRAM101は、複数のアドレスに配置される。   Although not particularly limited, the address space of the CPU 103 is 4 Gbytes. The NVRAM 101 and the I / O register 121 inside the microcomputer 100 operate with unique addresses, bus widths, and access state numbers, respectively. As described above, the NVRAM 101 is connected to the internal bus (I bus 115) via the NVMC 102, and is normally read / written in one state. The NVRAM 101 is arranged at a plurality of addresses.

CPU103は、第1動作モードと第2動作モードとを含む。上記第1動作モードでは、例えば図5(A)に示されるように、第1の領域NVRAM−1は主としてプログラム用、第2の領域NVRAM−2は主としてデータ用とされる。第1の領域NVRAM−1は、CPU103の例外処理ベクタを含む。第1の領域NVRAM−1、及び第2の領域NVRAM−2は、CPU103のアドレッシングモードなどに応じて配置すればよい。主としてプログラム用の第1の領域に対するライトは、プログラム保護のため、NVMC102によって禁止される。動作開始後に書き換えする領域(不揮発保持無効領域)は、例外処理ベクタと重ならないようにする。NVRAM101を複数モジュールに分割する場合は、互いに異なるモジュールに配置するとよい。本例では、第2の領域NVRAM−2の一部に不揮発保持無効領域が形成される。第2動作モードにおいて、第1の領域NVRAM−1は、図5(B)に示されるように外部空間とされる。この場合、NVRAM101は、主としてデータ領域として使用され、プログラムは主として、外部バスに接続されたメモリが使用される。   The CPU 103 includes a first operation mode and a second operation mode. In the first operation mode, for example, as shown in FIG. 5A, the first area NVRAM-1 is mainly used for programs, and the second area NVRAM-2 is mainly used for data. The first area NVRAM-1 includes the CPU 103 exception processing vector. The first area NVRAM-1 and the second area NVRAM-2 may be arranged according to the addressing mode of the CPU 103 or the like. Writing to the first program area is prohibited by the NVMC 102 for program protection. The area to be rewritten after the operation starts (non-volatile holding invalid area) should not overlap with the exception processing vector. When the NVRAM 101 is divided into a plurality of modules, they may be arranged in different modules. In this example, a nonvolatile holding invalid area is formed in a part of the second area NVRAM-2. In the second operation mode, the first area NVRAM-1 is an external space as shown in FIG. In this case, the NVRAM 101 is mainly used as a data area, and a memory connected to an external bus is mainly used as a program.

尚、図5(A)に示されるように、プログラムの初期書き込み又は書き換え(ブート)などのためのプログラムを格納する、通常動作時には使用しない領域(ブート領域)を持つ場合があるが、この領域は、不揮発保持無効領域の対象外とする。この領域は、所定のブートモードなどのみで、リードできるようにしてよい。ブートモード又はブート領域でのプログラム実行時は、第1の領域NVRAM−1に対するライトを許可するようにしてよい。   Note that, as shown in FIG. 5A, there may be an area (boot area) that stores a program for initial writing or rewriting (booting) of the program and is not used during normal operation. Are excluded from the non-volatile holding invalid area. This area may be readable only in a predetermined boot mode. When the program is executed in the boot mode or the boot area, writing to the first area NVRAM-1 may be permitted.

図6には、NVRAM101の格納データの一例が示される。   FIG. 6 shows an example of data stored in the NVRAM 101.

NVRAM101は、ランダムアクセスによるリード又はライトが可能であって、フラッシュメモリのように、書き込みに際して消去などの特別な動作を行う必要がなく、NVRAM101上のプログラム実行によって、NVRAM101への書き込みを行うことができる。このため、単一のNVRAM101に、プログラム領域とデータ領域を設けることができる。データ領域には、要保存のデータ領域と、保持すべきでない(消去すべき)データ領域とがある。例えばセキュリティの関係で保持すべきでない(消去すべき)データ領域は、上記不揮発保持無効領域とする。NVRAM101の不揮発保持無効領域以外の不揮発保持領域に、プログラム及びデータ保存領域を設けることができる。不揮発保持無効領域は、CPU103の作業領域とされ、保持すべきでない(消去すべき)秘密情報が格納される。秘密ではない作業用データは、前記不揮発保持領域に格納してもよい。   The NVRAM 101 can be read or written by random access, and unlike the flash memory, it is not necessary to perform a special operation such as erasing at the time of writing, and writing to the NVRAM 101 can be performed by executing a program on the NVRAM 101. it can. Therefore, a program area and a data area can be provided in a single NVRAM 101. The data area includes a data area that needs to be saved and a data area that should not be retained (to be erased). For example, a data area that should not be held (to be erased) for security reasons is the nonvolatile holding invalid area. A program and data storage area can be provided in a nonvolatile holding area other than the nonvolatile holding invalid area of the NVRAM 101. The non-volatile holding invalid area is a work area of the CPU 103 and stores secret information that should not be held (to be deleted). Work data that is not secret may be stored in the nonvolatile holding area.

図7には、上記NVMC102の状態遷移が示される。   FIG. 7 shows the state transition of the NVMC 102.

マイクロコンピュータ100のリセットなどによりRESC113からのリセット状態遷移信号rstが論理値‘1’にアサートされることによって、NVMC102がリセット状態に遷移される。リセット後、NVMC102は、ライト状態に遷移し、ライト制御部1022の制御により、不揮発保持無効領域の所定のアドレスに対するライトサイクルが発行される。ライトすべきデータ数に応じて、ライト状態を複数のステートで構成してもよい。この状態では、CPU103からNVRAM101のリード/ライトができないので、CPU103がNVRAM101をリード又はライトしようとした場合は、ウェイト信号を活性化して、ウェイトを要求し、NVMC102による所定のライトが終了後(後述のCPUリードライト状態遷移後)に、CPU103によるNVRAM101のリード/ライトを行うようにする。あるいは、NVMC102がライト状態のときは、CPU103にリセットを継続するようにしてもよい。所定のライトが終了すると、NVRAM101は、CPU103のリードライト状態に遷移する。上記リセット後の所定のライト状態(ライト動作)により、不揮発保持無効領域に対する無効化処理を行うことが可能となる。   When the reset state transition signal rst from the RESC 113 is asserted to the logical value “1” by resetting the microcomputer 100 or the like, the NVMC 102 is transitioned to the reset state. After the reset, the NVMC 102 transitions to the write state, and a write cycle for a predetermined address in the nonvolatile holding invalid area is issued under the control of the write control unit 1022. Depending on the number of data to be written, the write state may be composed of a plurality of states. In this state, the NVRAM 101 cannot be read / written from the CPU 103. Therefore, when the CPU 103 attempts to read or write the NVRAM 101, the wait signal is activated, a wait is requested, and a predetermined write by the NVMC 102 ends (described later). After the CPU read / write state transition, the CPU 103 reads / writes the NVRAM 101. Alternatively, the reset may be continued in the CPU 103 when the NVMC 102 is in the write state. When the predetermined write is completed, the NVRAM 101 transitions to the read / write state of the CPU 103. It becomes possible to perform invalidation processing for the nonvolatile holding invalid area by a predetermined write state (write operation) after the reset.

尚、RESC113における電源検出回路114により電源投入が検知された場合に、NVMC102をリセット状態に遷移させ、電源投入完了後、又は所定時間経過後に、NVMC102をライト状態に遷移させるようにしてもよい。また、WDT109のオーバーフローや、マスク不可能な割り込みなど、異常と判断されるべき状態を検出して、リセット状態に遷移させるようにしても良い。また、NVRAM101に、パラメータ情報などを含む場合には、図8に示されるように、ライト終了後に、パラメータリードの状態を追加してもよい。パラメータ情報としては、例えば、NVRAM101のトリミング情報や、A/D変換器122のアナログ値の調整などが挙げられる。   Note that when the power detection is detected by the power detection circuit 114 in the RESC 113, the NVMC 102 may be changed to the reset state, and the NVMC 102 may be changed to the write state after completion of the power supply or after a predetermined time has elapsed. In addition, a state that should be determined to be abnormal, such as an overflow of WDT 109 or an interrupt that cannot be masked, may be detected and transitioned to a reset state. Further, when the NVRAM 101 includes parameter information or the like, as shown in FIG. 8, a parameter read state may be added after writing is completed. Examples of the parameter information include trimming information of the NVRAM 101 and adjustment of an analog value of the A / D converter 122.

図9には、マイクロコンピュータ100における主要部の動作タイミングが示される。   FIG. 9 shows the operation timing of the main part in the microcomputer 100.

図9に示されるように、外部からのリセット信号RESに応じてリセット状態遷移信号rstが論理値‘1’となると、NVMC102は、リセット状態に遷移され、マルチプレクサ1021の選択状態がライト制御部1022側に切り換えられて、CPU103からのリード/ライトコマンド抑止される(nop)。これによりアドレス及びデータは初期化される。   As shown in FIG. 9, when the reset state transition signal rst becomes a logical value “1” in response to an external reset signal RES, the NVMC 102 transitions to the reset state, and the selection state of the multiplexer 1021 changes to the write control unit 1022. The read / write command from the CPU 103 is suppressed (nop). As a result, the address and data are initialized.

そして、リセット状態遷移信号rstが論理値‘0’となり、リセットが解除されると、ライト状態になり、所定のアドレス(addr−1〜addr−4)についてのライトが行われる。本例では、ライト動作が4回連続して行われる。このようなライト動作のアドレスは、図5(A),(B)における不揮発保持無効領域に対応するように、ライト制御部1022においてハードウェア的に生成される。書き込みデータは、特に制限されないが、論理値‘0’とされる。上記のライト動作が終了すると、NVMC102は、CPUリードライト状態に遷移し、マルチプレクサ1021の選択状態をIバス115に切り換える。上記ライトの完了に相当する期間(本例では4回のライトに相当する時間)、RESC113は、CPU103に対するリセット信号rst_cpuを活性化するようにする。以降は、CPU103によるリード/ライトが受け付けられる。   Then, when the reset state transition signal rst becomes the logic value “0” and the reset is released, the write state is entered, and the write for a predetermined address (addr-1 to addr-4) is performed. In this example, the write operation is performed four times in succession. The address of such a write operation is generated in hardware by the write control unit 1022 so as to correspond to the nonvolatile holding invalid area in FIGS. The write data is not particularly limited, but has a logical value “0”. When the above write operation is completed, the NVMC 102 transits to the CPU read / write state and switches the selection state of the multiplexer 1021 to the I bus 115. The RESC 113 activates the reset signal rst_cpu for the CPU 103 during a period corresponding to the completion of the write (in this example, a time corresponding to four writes). Thereafter, read / write by the CPU 103 is accepted.

図10には、上記マイクロコンピュータ100における主要部の別の動作タイミングが示される。   FIG. 10 shows another operation timing of the main part in the microcomputer 100.

マイクロコンピュータ100の電源Vccが投入されて所定の電源電圧レベルに達したことが電源検出回路114によって検出されると、リセット状態遷移信号rstが論理値‘1’にされ、それによってNVMC102は、リセット状態に遷移され、マルチプレクサ1021の選択状態がライト制御部1022に切り換えられて、CPU103からのリード/ライトコマンド抑止される(nop)。そして、リセット状態遷移信号rstが論理値‘0’となり、リセットが解除されると、ライト状態になり、所定のアドレス(addr−1〜addr−4)についてのライトが行われる。それ以降は、図9に示される場合と同様であるので、それについての説明を省略する。   When the power supply detection circuit 114 detects that the power supply Vcc of the microcomputer 100 is turned on and reaches a predetermined power supply voltage level, the reset state transition signal rst is set to a logical value “1”, whereby the NVMC 102 is reset. The state is changed, the selection state of the multiplexer 1021 is switched to the write control unit 1022, and the read / write command from the CPU 103 is suppressed (nop). Then, when the reset state transition signal rst becomes the logic value “0” and the reset is released, the write state is entered, and the write for a predetermined address (addr-1 to addr-4) is performed. Since the subsequent steps are the same as those shown in FIG. 9, description thereof will be omitted.

図11には、マイクロコンピュータ100における主要部の別の動作タイミングが示される。   FIG. 11 shows another operation timing of the main part in the microcomputer 100.

マイクロコンピュータ100の電源電圧Vccのレベル低下を検出すると、リセット信号rst_pdwnが論理値‘1’にされる。このリセット信号rst_pdwnは、電源検出回路114の検出結果に基づいてRESC113で生成される。リセット信号rst_pdwnが論理値‘1’にされることによってライト状態になり、所定のアドレス(addr−1)に対するライトが行われる。電源電圧Vccが、必要最小限のレベル以下にまで低下した場合には、ライトを行うことができない。このため、電圧の低下や保持の程度によって、ライトできる領域が変わる。本例は、図9や図10に示される動作と組み合わせることが望ましい。図9や図10に示されるように電源投入後にライトを行えば、論理的に指定した領域を確実にライトすることができる。少なくともCPU103の動作開始以前に、ライトすることができる。   When a decrease in the level of the power supply voltage Vcc of the microcomputer 100 is detected, the reset signal rst_pdwn is set to a logical value “1”. The reset signal rst_pdwn is generated by the RESC 113 based on the detection result of the power supply detection circuit 114. When the reset signal rst_pdwn is set to a logical value “1”, a write state is set, and a write to a predetermined address (addr−1) is performed. When the power supply voltage Vcc drops below a necessary minimum level, writing cannot be performed. For this reason, the writable region varies depending on the degree of voltage decrease and holding. It is desirable to combine this example with the operation shown in FIG. 9 and FIG. If writing is performed after the power is turned on as shown in FIGS. 9 and 10, the logically designated area can be reliably written. Writing can be performed at least before the operation of the CPU 103 is started.

尚、NVRAM101を複数モジュールに分割し、不揮発保持無効領域と、例外処理ベクタ領域が異なるモジュールに配置される場合には、CPU103に対するリセット信号rst_cpuを、リセット状態遷移信号rstと同様にし、CPU103が不揮発保持無効領域を含む領域にアクセスした場合に、ウェイトを要求するようにすればよい。   When the NVRAM 101 is divided into a plurality of modules and the nonvolatile holding invalid area and the exception processing vector area are arranged in different modules, the reset signal rst_cpu for the CPU 103 is set in the same manner as the reset state transition signal rst, and the CPU 103 is nonvolatile. When an area including the invalid holding area is accessed, a wait may be requested.

また、図5(B)に示される第2動作モードなど、例外処理ベクタ領域がNVRAM101に存在しない場合も同様にすることができる。リセット状態遷移信号rstの波形立上りの検出後、リセット状態遷移信号rstの波形立下りを待たずに、ライト状態に遷移するようにしてもよい。いずれにせよ、CPU103によるNVRAM101のアクセス以前に、自動書き換えを行うようにすればよい。マイクロコンピュータ100が複数の動作モードを持つ場合にも、動作モードによらずに自動書き換えを行うようにする。   Also, the same can be done when the exception processing vector area does not exist in the NVRAM 101, such as in the second operation mode shown in FIG. After detecting the rising edge of the reset state transition signal rst, the transition to the write state may be made without waiting for the falling edge of the reset state transition signal rst. In any case, automatic rewriting may be performed before the CPU 103 accesses the NVRAM 101. Even when the microcomputer 100 has a plurality of operation modes, automatic rewriting is performed regardless of the operation modes.

図13には、CPU103のリセット解除時のフローチャートが示される。   FIG. 13 shows a flowchart when the reset of the CPU 103 is released.

リセットが解除されると、CPU103はリセット例外処理を行う。   When the reset is released, the CPU 103 performs a reset exception process.

リセット例外処理時、CPU103は、不揮発保持無効領域に対するライトを行う(NVRAMライト1〜4)ステップを持つようにする。すなわち、NVMC102によらず、NVRAM101の自動書き換えが行われる。このための、CPU103の実行部105に、アドレスやデータの生成論理、すなわち、通常の命令実行のアドレスやデータのセレクタを設け、制御部104に、前記セレクタの制御、バスコマンドの発生、フローの制御のための論理を設ける。それによりCPU103は、例外処理ベクタをリードし、プログラムの先頭命令に分岐する。これは、通常のCPUと同様である。   At the time of reset exception processing, the CPU 103 has a step (NVRAM write 1 to 4) of writing to the nonvolatile holding invalid area. That is, the NVRAM 101 is automatically rewritten regardless of the NVMC 102. For this purpose, the execution unit 105 of the CPU 103 is provided with an address and data generation logic, that is, a normal instruction execution address and data selector, and the control unit 104 controls the selector, generates a bus command, Provide logic for control. Thereby, the CPU 103 reads the exception processing vector and branches to the first instruction of the program. This is the same as a normal CPU.

自動書き換えのためのプログラムを、リセット例外処理後に実行するようにし、その後に、本来のプログラムの先頭命令に分岐するようにしてもよい。あるいは、DMAコントローラなどを持ち、リセット後に、かかるDMAコントローラを自動的に起動して、上記不揮発保持無効領域に対するライトを行うようにしてもよい。   The program for automatic rewriting may be executed after reset exception processing, and then branch to the first instruction of the original program. Alternatively, a DMA controller or the like may be provided, and after resetting, the DMA controller may be automatically activated to perform writing to the nonvolatile holding invalid area.

図14には、上記マイクロコンピュータ100の応用例が示される。また、図15には、図14に示される応用例における処理フローチャートが示される。   FIG. 14 shows an application example of the microcomputer 100. FIG. 15 shows a process flowchart in the application example shown in FIG.

図14に示されるように、マイクロコンピュータ100は、それに接続された他のマイクロコンピュータ200との間で通信を行う。そしてマイクロコンピュータ100は、通信の内容に従って所要の動作を行う。尚、接続先は変更される。通信の情報には、接続先のマイクロコンピュータに固有のID情報や鍵情報などの秘密情報が含まれ、接続先のマイクロコンピュータ200の認証を行うことがある。ID情報や鍵情報などの秘密情報は、通信時には、暗号化などを行って接続先から入力されたとしても、マイクロコンピュータ内部では復号されたデータ、又は暗号化する前のデータが存在する。これを、NVRAM101に保持していれば、それが、悪意のプログラム実行によってリードされる可能性が高まる。通信時に暗号化を行い、秘密を保持するのであるから、マイクロコンピュータ内の復号されたデータなどの秘密情報をリードされることも阻止すべきである。かかる秘密情報を不所望に保持しないために、所要の処理終了後に、当該秘密情報を、マイクロコンピュータ100のプログラムで初期化又は書き換えることも考えられるが、初期化又は書き換える前に、悪意を持って電源遮断などをされれば、初期化又は書き換えができないことも考えられる。   As shown in FIG. 14, the microcomputer 100 communicates with another microcomputer 200 connected thereto. The microcomputer 100 performs a required operation according to the content of communication. The connection destination is changed. The communication information includes secret information such as ID information and key information unique to the connection destination microcomputer, and may authenticate the connection destination microcomputer 200. Even if secret information such as ID information and key information is encrypted and input from a connection destination during communication, there is decrypted data or data before encryption inside the microcomputer. If this is held in the NVRAM 101, the possibility that it will be read by malicious program execution increases. Since encryption is performed at the time of communication and the secret is kept, it should be prevented that secret information such as decrypted data in the microcomputer is read. In order not to hold such secret information undesirably, it may be possible to initialize or rewrite the secret information with the program of the microcomputer 100 after the completion of the required processing. If the power is cut off, initialization or rewriting may not be possible.

このような使用方法において、マイクロコンピュータ100は、リセット後に不揮発保持無効領域の初期化又は書き換え(不揮発保持無効化処理)を行うようにする(S1)。その後、マイクロコンピュータ100は、NVRAM101上に格納されたプログラムに従い、CPU103の制御に基づき、接続先のマイクロコンピュータ200のID情報や鍵情報は、当該接続時には、SCI110を介して入力される(S2)。入力されたデータは、一旦、NVRAM101にライトされて保持される。このデータが暗号化されたデータであれば、NVRAM101の不揮発保持領域に格納してよい(S3)。CPU103の制御により暗号機能部106において、入力データの復号化処理などが行われる(S4)。暗号機能部106には、適宜、鍵情報などが与えられる。ID情報や鍵情報、および復号化されたデータ(平文)は必要に応じて任意のタイミングにおいて不揮発保持無効領域に格納(ライト)され、悪意によるリードが抑止される(S5)。   In such a method of use, the microcomputer 100 initializes or rewrites the non-volatile holding invalid area (non-volatile holding invalidating process) after reset (S1). Thereafter, according to the program stored on the NVRAM 101, the microcomputer 100 inputs the ID information and key information of the connection destination microcomputer 200 via the SCI 110 at the time of connection based on the control of the CPU 103 (S2). . The input data is once written and held in the NVRAM 101. If this data is encrypted, it may be stored in the nonvolatile holding area of the NVRAM 101 (S3). Under the control of the CPU 103, the encryption function unit 106 decrypts the input data (S4). The encryption function unit 106 is appropriately provided with key information and the like. The ID information, the key information, and the decrypted data (plain text) are stored (written) in the nonvolatile holding invalid area at an arbitrary timing as necessary, and malicious read is suppressed (S5).

逆に、暗号化を行う場合は、元のデータ(平文)を不揮発保持無効領域に格納するようにする。暗号化されたデータは、不揮発保持領域に格納してもよい。暗号機能がデータを処理する場合も、平文を不揮発保持無効領域に格納するようにし、一方、暗号を不揮発保持領域に格納することができる。この復号されたデータは、認証などのCPU103の作業に随時参照(リード/ライト)される(S6)。認証が確認されれば、当該システムに所要の処理が行われる(S7)。認証がなされなければ、処理を行わずに終了する。   Conversely, when encryption is performed, the original data (plain text) is stored in the nonvolatile holding invalid area. The encrypted data may be stored in the nonvolatile holding area. Even when the encryption function processes data, the plaintext can be stored in the nonvolatile holding invalid area, while the cipher can be stored in the nonvolatile holding area. This decrypted data is referred to (read / written) as needed for operations of the CPU 103 such as authentication (S6). If the authentication is confirmed, a required process is performed on the system (S7). If authentication is not performed, the process is terminated without performing processing.

接続先のマイクロコンピュータとの接続が解消されれば、接続先のマイクロコンピュータ200に固有のID情報や鍵情報などの秘密情報は保持する必要はない。別のマイクロコンピュータと接続する場合には、不揮発保持無効領域に対し別のID情報や鍵情報を入力し、同様の処理が行われる。   If the connection with the connection destination microcomputer is canceled, it is not necessary to hold secret information such as ID information and key information unique to the connection destination microcomputer 200. When connecting to another microcomputer, another ID information or key information is input to the nonvolatile holding invalid area, and the same processing is performed.

本マイクロコンピュータ100においては、上記のID情報や鍵情報、復号化されたデータなどの、保持すべきでない(消去すべき)秘密情報を、前記不揮発保持無効領域に格納しておけば、前記のようなマイクロコンピュータ100のプログラムで初期化又は書き換えする手間も不要であるし、悪意により動作中に電源が遮断されたような場合も、マイクロコンピュータ100の次の電源投入時に、当該マイクロコンピュータ100の動作開始前に書き換えされるから、悪意/善意によらず、リードすることができないので、セキュリティの強化を図ることができる。   In the microcomputer 100, if secret information that should not be held (to be deleted) such as the ID information, key information, and decrypted data is stored in the nonvolatile holding invalid area, There is no need to initialize or rewrite with such a program of the microcomputer 100, and even when the power is shut off during operation maliciously, the microcomputer 100 is turned on when the microcomputer 100 is turned on next time. Since it is rewritten before the operation starts, it cannot be read regardless of malicious / good intentions, so that security can be enhanced.

上記例によれば、以下の作用効果を得ることができる。   According to the above example, the following operational effects can be obtained.

(1)ランダムアクセスによってリード・ライト可能なNVRAM101を、CPU103のプログラム領域と作業用データ領域として使用することにより、ハードウェア資源を節約できるし、製造工程の簡略化に寄与できるので、製造費用を低減できる。NVRAM101とは別に一般的なRAMを搭載していないので、当該RAMにおける記憶データを保持するための電流を考慮しないで良いし、ソフトエラー対策も不要となる。この場合において、上記NVRAM101の記憶領域の一部に不揮発保持が無効とされる領域が設けられているため、この領域を、秘密を保持すべきデータの格納用とすることにより、この秘密を保持すべきデータが上記NVRAM101に不揮発保持されることが回避される。これによって、ランダムアクセスによってリード・ライト可能な不揮発性記憶装置(NVRAM)を、プログラム/データ兼用のメモリとして搭載した場合のセキュリティの向上を達成することができる。   (1) By using the NVRAM 101 that can be read / written by random access as the program area and work data area of the CPU 103, hardware resources can be saved and the manufacturing process can be simplified. Can be reduced. Since a general RAM is not installed separately from the NVRAM 101, it is not necessary to consider the current for holding the stored data in the RAM, and no countermeasure against soft errors is required. In this case, since a part of the storage area of the NVRAM 101 in which nonvolatile retention is disabled is provided, this area is used for storing data that should be kept secret. It is avoided that the data to be stored is held in the NVRAM 101 in a nonvolatile manner. As a result, it is possible to improve security when a nonvolatile memory device (NVRAM) that can be read / written by random access is mounted as a program / data memory.

(2)NVMC102で、自動書き換え(不揮発保持無効領域に対する無効化処理)を行うことにより、CPU103は既存のものを使用することができる。CPU103を停止して、NVRAM101他のモジュールを、外部からリード/ライトするようなテストモードなどがあっても、自動書き換えを行うことができる。   (2) By performing automatic rewriting (invalidation processing for the nonvolatile holding invalid area) in the NVMC 102, the CPU 103 can use the existing one. Even if there is a test mode in which the CPU 103 is stopped and the NVRAM 101 and other modules are read / written from the outside, automatic rewriting can be performed.

(3)NVMC102による自動書き換え中、CPU103をリセット状態に保持すれば、マイクロコンピュータ100の内部状態を簡略化できる。   (3) The internal state of the microcomputer 100 can be simplified by keeping the CPU 103 in a reset state during automatic rewriting by the NVMC 102.

(4)例外処理ベクタ領域が、不揮発保持無効領域を含むNVRAM101以外に存在する場合は、自動書き換え中も、CPU103を動作させ、自動書き換え中のNVRAM101に対するアクセスがあったときにウェイトを要求することにより、不所望の待機時間を抑止することができる。   (4) When the exception processing vector area exists in a place other than the NVRAM 101 including the nonvolatile holding invalid area, the CPU 103 is operated even during automatic rewriting, and a wait is requested when the NVRAM 101 being automatically rewritten is accessed. Thus, an undesired waiting time can be suppressed.

(5)CPU103によって、自動書き換えを行うことにより、NVMC102を不要とすることができる。   (5) By performing automatic rewriting by the CPU 103, the NVMC 102 can be made unnecessary.

(6)NVRAM102のプログラム用に使用する領域を、ライト禁止にすることによって、フラッシュメモリなどに相違して、書き換えが容易であることによる、不所望のプログラムの書き換えを抑止できる。   (6) By prohibiting the area used for the program in the NVRAM 102 from being written, it is possible to suppress rewriting of an undesired program due to easy rewriting unlike a flash memory or the like.

図2には、上記マイクロコンピュータ100における主要部の別の構成例が示される。   FIG. 2 shows another configuration example of the main part of the microcomputer 100.

図2に示されるマイクロコンピュータ100は、二つの半導体チップによって構成される。すなわち、図2に示されるマイクロコンピュータ100が、図1に示されるのと大きく相違するのは、それぞれNVRAM101及びNVMC102に対応するNVRAM201及びNVMC202が、CPU103とは別のチップ300に形成されている点である。また、このチップ300内には、チップ300内の電源電圧を検出可能な電源検出回路214を含むRESC213が設けられ、このRESC214によって形成されるリセット状態遷移信号によってNVMC202がリセットされるようになっている。また、NVMC202は、外部バス117及びBUF108を介してIバス115に結合される。NVRAM201、NVMC202、及びRESC213の機能は、それぞれ図1に示されるNVRAM201、NVMC202、及びRESC113と同様とされるため、その詳細な説明は省略する。このようにマイクロコンピュータシステム100が複数の半導体チップによって構成される場合にも、図1に示される場合と同様の作用効果を得ることができる。   The microcomputer 100 shown in FIG. 2 is composed of two semiconductor chips. That is, the microcomputer 100 shown in FIG. 2 is greatly different from that shown in FIG. 1 in that the NVRAM 201 and the NVMC 202 corresponding to the NVRAM 101 and the NVMC 102 are formed on a chip 300 different from the CPU 103, respectively. It is. Further, in this chip 300, a RESC 213 including a power supply detection circuit 214 capable of detecting the power supply voltage in the chip 300 is provided, and the NVMC 202 is reset by a reset state transition signal formed by this RESC 214. Yes. The NVMC 202 is coupled to the I bus 115 via the external bus 117 and the BUF 108. The functions of NVRAM 201, NVMC 202, and RESC 213 are the same as those of NVRAM 201, NVMC 202, and RESC 113 shown in FIG. As described above, even when the microcomputer system 100 is configured by a plurality of semiconductor chips, it is possible to obtain the same operational effects as those shown in FIG.

図4には、NVMC102の別の構成例が示される。   FIG. 4 shows another configuration example of the NVMC 102.

NVMC102は、アドレス判定部1033、リード制御部1031を含んで成る。アドレス判定部1033は、動作開始後に、リセットによってリード阻止状態に遷移される。この状態では、アドレスの判定結果に従い、不揮発保持無効領域以外のリードは許可される。また、不揮発保持無効領域のリードは禁止される。ライトは領域によらず許可される。さらに、不揮発保持無効領域へのライトが観測される。不揮発保持無効領域の全てのアドレスにライトされたことが判定され、リード許可状態に遷移される。この状態では、領域によらず、リードを許可する。リード制御部1031は、アドレス判定のリード許可/禁止に従って、NVRAM101のリードの許可/禁止が行われる。これによって、不揮発保持無効領域は、ライトするまでリードすることができないから、動作開始以前の内容をリードすることを阻止できる。ライトした内容はリードできるから、作業領域として使用することに不都合はない。リードの禁止は、NVRAM101に対するリード信号を抑止してもよいし、リードデータをマスクするようにしてもよい。   The NVMC 102 includes an address determination unit 1033 and a read control unit 1031. The address determination unit 1033 transitions to the read blocking state by reset after the operation starts. In this state, according to the determination result of the address, reading other than the nonvolatile holding invalid area is permitted. In addition, reading of the nonvolatile holding invalid area is prohibited. Writing is permitted regardless of the area. Furthermore, a write to the non-volatile holding invalid area is observed. It is determined that data has been written to all addresses in the nonvolatile holding invalid area, and a transition is made to a read permission state. In this state, reading is permitted regardless of the area. The read control unit 1031 permits / inhibits reading of the NVRAM 101 in accordance with read permission / inhibition of address determination. As a result, since the nonvolatile holding invalid area cannot be read until it is written, it is possible to prevent reading the contents before the start of the operation. Since the written content can be read, there is no inconvenience in using it as a work area. For prohibition of reading, a read signal to the NVRAM 101 may be suppressed, or read data may be masked.

図12には、図4に示される構成を採用した場合のマイクロコンピュータ100の動作タイミングが示される。   FIG. 12 shows the operation timing of the microcomputer 100 when the configuration shown in FIG. 4 is adopted.

リセット状態遷移信号rstが論理値‘1’となると、NVMC102はリード阻止状態に遷移される。CPU103による、所定のアドレス(addr−1〜addr−4)に対するライトを検出すると、リード許可状態に遷移される。この例では、4回のライト後に遷移するようにしている。尚、1つのライト毎に、当該アドレスに対するリードを許可するようにしてもよい。   When the reset state transition signal rst becomes the logical value “1”, the NVMC 102 is transitioned to the read blocking state. When the CPU 103 detects a write to a predetermined address (addr-1 to addr-4), it shifts to a read permission state. In this example, a transition is made after four writes. In addition, you may make it permit the read with respect to the said address for every write.

リード禁止を行うことで、リセット後のCPU103のプログラム実行を早期に開始することができる。プログラムの実行によって、作業領域の初期化を行う場合は、二重にライトしたり、使用しないアドレスにライトしたりすることがない。   By prohibiting reading, the program execution of the CPU 103 after reset can be started early. When the work area is initialized by executing the program, there is no double writing or writing to an unused address.

以上本発明者によってなされた発明を具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   Although the invention made by the present inventor has been specifically described above, the present invention is not limited thereto, and it goes without saying that various changes can be made without departing from the scope of the invention.

例えば、NVRAM101は、MRAMに限らず、ランダムなライトアクセスが可能で、不揮発保持が可能であればよい。NVRAM101の構成も任意にでき、例えば、プログラム用とデータ用に複数のNVRAM101を持ってもよい。プログラム用とデータ用に、一種類のNVRAM101で構成することが望ましい。NVRAM101とNVMC102とを一体的に構成してもよい。メモリアレイとNVMCに相当する機能を持てばよい。NVRAMは、ECC(Error-Correcting Code)によるエラー訂正が行えるように、データとシンドロームを持つようにしてもよい。   For example, the NVRAM 101 is not limited to the MRAM, and may be a random write access and a non-volatile storage. The configuration of the NVRAM 101 can also be arbitrarily set. For example, a plurality of NVRAMs 101 may be provided for programs and data. It is desirable to use a single type of NVRAM 101 for programs and data. The NVRAM 101 and the NVMC 102 may be configured integrally. It is only necessary to have a function corresponding to a memory array and NVMC. The NVRAM may have data and a syndrome so that error correction by ECC (Error-Correcting Code) can be performed.

また、リード禁止の手段も任意にできる。動作開始以前の内容をリードできず、動作開始以後にライトした内容をリードできるものであればよい。   Further, the means for prohibiting reading can be arbitrarily set. Anything can be used as long as the contents before the operation start cannot be read and the contents written after the operation start can be read.

自動書き換え(不揮発保持無効領域に対する無効化処理)用データの内容も任意にできる。古いデータを保持しなければよく、固定値のほか、ランダムなものであってもよい。不揮発保持無効化とは、動作開始以前にすでに格納されているデータをリードできなくすることであって、フラッシュメモリのように、記憶素子の状態を、書き込み可能な状態に戻すことに限らない。不揮発保持無効化動作ということができる。自動書き換えのためのアドレス配置やアドレス範囲も任意にできる。自動書き換えのためのアドレス範囲については、フラッシュメモリで採用されているようにブロック単位で一括書き込みを可能とする構成を採ってもよい。   The contents of data for automatic rewriting (invalidation processing for the non-volatile holding invalid area) can be arbitrarily set. It is sufficient that old data is not retained, and a fixed value or a random value may be used. Nonvolatile holding invalidation means that data already stored before the start of operation cannot be read, and is not limited to returning the state of a storage element to a writable state like a flash memory. This can be referred to as a nonvolatile retention invalidation operation. Address arrangement and address range for automatic rewriting can be arbitrarily set. The address range for automatic rewriting may be configured so that batch writing can be performed in units of blocks as employed in flash memory.

さらに、自動書き換えのためのアドレス範囲については、CPU103のプログラム実行によるライトシーケンスと異なるようにしてもよい。例えば、アドレスに対応したバイト領域をライトする代わりに、ビット0のみを、8アドレスに対してライトしてもよい。バイト単位で意味を持つデータは、そのうちの1ビットを書き換えるだけでも意味をなさなくなるからである。上記ECCによるエラー訂正を行っている場合は、シンドロームのみをライトするようにしてもよい。   Furthermore, the address range for automatic rewriting may be different from the write sequence by the CPU 103 executing the program. For example, instead of writing a byte area corresponding to an address, only bit 0 may be written to 8 addresses. This is because data having meaning in byte units does not make sense even by rewriting one bit. When error correction by the ECC is performed, only the syndrome may be written.

マイクロコンピュータの構成や、アドレス空間の大きさや配置についても限定されない。そのほかや機能ブロックなども種々変更できる。CPU103や、暗号機能部106の他に、DMAコントローラなどのように、NVRAM101に対するライトを可能とするモジュールを搭載してもよい。   The configuration of the microcomputer and the size and arrangement of the address space are not limited. In addition, various functional blocks can be changed. In addition to the CPU 103 and the cryptographic function unit 106, a module capable of writing to the NVRAM 101, such as a DMA controller, may be mounted.

マイクロコンピュータ100と通信を行うべき相手は、マイクロコンピュータに限定されない。通信すべきデータは、ID情報や鍵情報に限定されず、任意の著作物などであってもよい。不揮発保持無効領域に格納すべきデータとしては、ID情報や鍵情報に限定されず、マイクロコンピュータ内部で生成又は復号化される全ての秘密情報に対応できる。   The partner to communicate with the microcomputer 100 is not limited to the microcomputer. Data to be communicated is not limited to ID information and key information, and may be any copyrighted work. Data to be stored in the nonvolatile holding invalid area is not limited to ID information and key information, and can correspond to all secret information generated or decrypted inside the microcomputer.

以上の説明では主として本発明者によってなされた発明をその背景となった利用分野であるシングルチップマイクロコンピュータに適用した場合について説明したが、本発明はそれに限定されるものではなく、ランダムアクセスを可能とする不揮発性記憶装置を含むマイクロコンピュータに広く適用することができる。   In the above description, the case where the invention made mainly by the inventor is applied to the single-chip microcomputer, which is the field of use behind it, has been described. However, the present invention is not limited to this, and random access is possible. The present invention can be widely applied to microcomputers including nonvolatile storage devices.

101,201 NVRAM
102,202 NVMC
103 CPU
104 制御部
105 実行部
106 暗号機能部
107 I/O部
108 BUF
109 WDT
110 SCI
111 BSC
112 INT
113,213 RESC
114,214 電源検出回路
115 Iバス
116 Pバス
117 外部バス
121 I/Oレジスタ
122 A/D変換器
1021 マルチプレクサ
1022 ライト制御部
1023 アドレス判定部
1031 リード制御部
101, 201 NVRAM
102,202 NVMC
103 CPU
104 Control Unit 105 Execution Unit 106 Cryptographic Function Unit 107 I / O Unit 108 BUF
109 WDT
110 SCI
111 BSC
112 INT
113,213 RESC
114, 214 Power supply detection circuit 115 I bus 116 P bus 117 External bus 121 I / O register 122 A / D converter 1021 Multiplexer 1022 Write control unit 1023 Address determination unit 1031 Read control unit

Claims (2)

予め設定されたプログラムに基づく演算処理を可能とするCPUと、
上記CPUによるランダムアクセスによってリード・ライト可能な不揮発性記憶装置と、
を含むシングルチップマイクロコンピュータであり、
上記不揮発性記憶装置は、記憶領域として上記プログラムが格納される不揮発保持領域とデータを格納可能な不揮発性保持無効化領域とを含み、
リセット状態を示すリセット信号により、上記記憶領域のうち上記不揮発性保持無効化領域に対してライト動作を行うことで、上記不揮発性保持無効化領域のデータを消去することを特徴とするシングルチップマイクロコンピュータ。
A CPU that enables arithmetic processing based on a preset program;
A nonvolatile storage device that can be read and written by random access by the CPU;
A single chip microcomputer including
The non-volatile storage device includes a non-volatile holding area in which the program is stored as a storage area and a non-volatile holding invalidation area capable of storing data,
A single chip micro that erases data in the nonvolatile retention invalidation area by performing a write operation to the nonvolatile retention invalidation area in the storage area in response to a reset signal indicating a reset state. Computer.
上記不揮発保持領域には、前記リセット信号により消去されないデータを保持するデータ保存領域を含む請求項1記載のシングルチップマイクロコンピュータ。   The single-chip microcomputer according to claim 1, wherein the nonvolatile holding area includes a data storage area that holds data that is not erased by the reset signal.
JP2011053899A 2011-03-11 2011-03-11 Single chip microcomputer Pending JP2011141888A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011053899A JP2011141888A (en) 2011-03-11 2011-03-11 Single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011053899A JP2011141888A (en) 2011-03-11 2011-03-11 Single chip microcomputer

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2006210751A Division JP2008040585A (en) 2006-08-02 2006-08-02 Microcomputer

Publications (1)

Publication Number Publication Date
JP2011141888A true JP2011141888A (en) 2011-07-21

Family

ID=44457633

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011053899A Pending JP2011141888A (en) 2011-03-11 2011-03-11 Single chip microcomputer

Country Status (1)

Country Link
JP (1) JP2011141888A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63293664A (en) * 1987-05-27 1988-11-30 Sharp Corp Electronic equipment
JP2003104137A (en) * 2001-09-27 2003-04-09 Hitachi Ltd On-vehicle control device
JP2005236782A (en) * 2004-02-20 2005-09-02 Ricoh Co Ltd Unit and program for image processing
JP2005292959A (en) * 2004-03-31 2005-10-20 Toshiba Corp Nonvolatile memory module and nonvolatile memory system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63293664A (en) * 1987-05-27 1988-11-30 Sharp Corp Electronic equipment
JP2003104137A (en) * 2001-09-27 2003-04-09 Hitachi Ltd On-vehicle control device
JP2005236782A (en) * 2004-02-20 2005-09-02 Ricoh Co Ltd Unit and program for image processing
JP2005292959A (en) * 2004-03-31 2005-10-20 Toshiba Corp Nonvolatile memory module and nonvolatile memory system

Similar Documents

Publication Publication Date Title
JP6306578B2 (en) Memory protection device and protection method
US9202061B1 (en) Security enclave processor boot control
US11714924B2 (en) Unified addressable memory
TWI620095B (en) Apparatuses and tangible machine readable medium for securing an access protection scheme
US8296528B2 (en) Methods and systems for microcode patching
US8189384B2 (en) System and method to control one time programmable memory
CN110998578B (en) System and method for booting within a heterogeneous memory environment
JP5576557B2 (en) Processor system and control method thereof
WO2016176126A1 (en) Secure access in a microcontroller system
US11544413B2 (en) Cryptographic key distribution
JP2008059052A (en) Semiconductor integrated circuit and microcomputer
JP2003521034A (en) Microprocessor system and method of operating the same
JP7332083B2 (en) Multimode protected memory
JP2008040585A (en) Microcomputer
US9373377B2 (en) Apparatuses, integrated circuits, and methods for testmode security systems
JP2011141888A (en) Single chip microcomputer
JP2007034554A (en) Semiconductor integrated circuit and microcomputer
JP2011150457A (en) Information processing apparatus and memory access control method
JP2011180963A (en) Semiconductor integrated circuit device
WO2024027975A1 (en) Execution of instructions from trusted and untrusted memories
CN117131549A (en) Chip encryption method and encryption chip
CN116501237A (en) Solid-state storage AI coprocessor and solid-state storage system
CN114968117A (en) Memory protection system
JP2009048322A (en) Interface module and semiconductor integrated circuit
JPH11120081A (en) Microcomputer system and its security control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110311

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130207

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130606