Movatterモバイル変換


[0]ホーム

URL:


JP2006350885A - Semiconductor device - Google Patents

Semiconductor device
Download PDF

Info

Publication number
JP2006350885A
JP2006350885AJP2005178829AJP2005178829AJP2006350885AJP 2006350885 AJP2006350885 AJP 2006350885AJP 2005178829 AJP2005178829 AJP 2005178829AJP 2005178829 AJP2005178829 AJP 2005178829AJP 2006350885 AJP2006350885 AJP 2006350885A
Authority
JP
Japan
Prior art keywords
access
protection information
block
protection
blocks
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.)
Granted
Application number
JP2005178829A
Other languages
Japanese (ja)
Other versions
JP4584044B2 (en
JP2006350885A5 (en
Inventor
Hitoya Kurosawa
飛斗矢 黒澤
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 Technology Corp
Original Assignee
Renesas Technology 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 Technology CorpfiledCriticalRenesas Technology Corp
Priority to JP2005178829ApriorityCriticalpatent/JP4584044B2/en
Priority to US11/454,797prioritypatent/US7421534B2/en
Publication of JP2006350885ApublicationCriticalpatent/JP2006350885A/en
Publication of JP2006350885A5publicationCriticalpatent/JP2006350885A5/ja
Priority to US12/180,666prioritypatent/US7822914B2/en
Priority to US12/884,862prioritypatent/US7979630B2/en
Application grantedgrantedCritical
Publication of JP4584044B2publicationCriticalpatent/JP4584044B2/en
Priority to US13/116,433prioritypatent/US8156280B2/en
Anticipated expirationlegal-statusCritical
Expired - Lifetimelegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromJapanese

【課題】 処理速度を低下させることなく、かつ、容易な処理により高いデータ機密保護機能を実現する。また、命令コード自体の機密保護を維持すると同時に、命令コードに基づく処理の実行を実現する。
【解決手段】 制御回路31は、設定解除の要求を受けて、当該ブロックに格納されているデータを消去した後、保護フラグの値を変更し、プロテクト設定を解除する。また、制御回路31は、いずれかのブロックに対して全体プロテクトが設定されていれば、マイコン内蔵メモリプログラム起動モードである場合を除いて、すべてのブロックへのアクセスを禁止する。さらに、制御回路31は、部分プロテクトが設定されていれば、CPU92がマイコン内蔵メモリプログラム起動モードであり、かつ、命令フェッチにより命令コードを読出すためのアクセスである場合に限りブロックMへのアクセスを許可する。
【選択図】 図4
PROBLEM TO BE SOLVED: To realize a high data security function by a simple process without reducing the processing speed. In addition, while maintaining the confidentiality of the instruction code itself, the processing based on the instruction code is executed.
A control circuit 31 receives a setting release request, erases data stored in the block, changes a protection flag value, and releases protection setting. In addition, if the entire protection is set for any block, the control circuit 31 prohibits access to all the blocks except in the microcomputer built-in memory program start mode. Further, if the partial protection is set, the control circuit 31 accesses the block M only when the CPU 92 is in the microcomputer built-in memory program start mode and is an access for reading an instruction code by an instruction fetch. Allow.
[Selection] Figure 4

Description

Translated fromJapanese

この発明は、不揮発性記憶部を備える半導体装置に関し、特にデータ機密保護機能を有する半導体装置に関するものである。  The present invention relates to a semiconductor device having a nonvolatile memory portion, and more particularly to a semiconductor device having a data security protection function.

従来から、さまざまな用途に用いられるマイクロコンピュータ(以下、マイコンと称す)では、フラッシュメモリやEEPROM(Electrical Erasable and Programmable Read Only Memory)などの不揮発性記憶部(以下、不揮発性メモリと称す)を備えたものが一般的となっている。不揮発性メモリは、一旦データが書込まれると電源が遮断されてもそのデータを保持し、かつ、データの書換えも自由に行なうことができる。そのため、プログラムを不揮発性メモリに格納して製品に組込んだマイコンに対して、プログラムの修正や新たな機能の追加といったいわゆるアップデートを容易に行なうことができるという利点がある。  2. Description of the Related Art Conventionally, microcomputers (hereinafter referred to as microcomputers) used for various purposes have a nonvolatile memory unit (hereinafter referred to as nonvolatile memory) such as flash memory or EEPROM (Electrical Erasable and Programmable Read Only Memory). Is becoming common. Once data is written, the nonvolatile memory retains the data even when the power is turned off, and data can be rewritten freely. Therefore, there is an advantage that so-called updating such as program correction and addition of a new function can be easily performed on a microcomputer in which a program is stored in a nonvolatile memory and incorporated in a product.

一方、上述のような不揮発性メモリを備えたマイコンでは、当該マイコンが組込まれた製品の使用者(以下、エンドユーザと称す)などにより、その格納しているプログラムが書換えられると、動作不具合や人的被害などの発生が懸念される。また、競業者などにより、プログラムの内容を不正に読出されることも懸念される。そこで、エンドユーザによるデータの読出しや書換え(以下、アクセスと称す)を防止するため、マイコンには、機密保護(以下、プロテクトと称す)機能を付加することが一般的となっている。  On the other hand, in a microcomputer equipped with a non-volatile memory as described above, if the stored program is rewritten by a user (hereinafter referred to as an end user) of a product in which the microcomputer is incorporated, There are concerns about the occurrence of human damage. There is also a concern that the contents of the program may be read illegally by a competitor or the like. Therefore, in order to prevent data reading and rewriting (hereinafter referred to as access) by the end user, it is common to add a security protection (hereinafter referred to as protection) function to the microcomputer.

このようなプロテクト機能は、たとえば、不揮発性メモリ内において、データが格納されるデータ領域に加え、そのデータ領域に対するプロテクトを設定するためのプロテクト情報領域を配置し、そのプロテクト情報領域に格納されるプロテクト設定に応じて、ハードウェア回路によりアクセスを禁止する構成で実現される。  Such a protection function is, for example, arranged in a non-volatile memory, in addition to a data area in which data is stored, a protection information area for setting protection for the data area, and is stored in the protection information area. This is realized by a configuration in which access is prohibited by a hardware circuit in accordance with the protection setting.

特許文献1には、メモリアレイのブロックグループ単位で、ライトプロテクトの状態を柔軟に設定できる半導体記憶装置が開示されている。  Patent Document 1 discloses a semiconductor memory device that can flexibly set a write protect state for each block group of a memory array.

一方、プロテクトが設定されたプログラムのアップデートを行なうためには、プロテクト設定を解除した上で、プログラムの書換えを行なう必要がある。したがって、プロテクト機能を付加する場合には、付随的にプロテクトの解除機能を備えておく必要がある。  On the other hand, in order to update a program with protection set, it is necessary to rewrite the program after releasing the protection setting. Therefore, when a protection function is added, it is necessary to provide a protection release function incidentally.

プロテクトの解除機能は、たとえば、マイコンと接続される外部装置から特定の信号を与えてプロテクトを解除する構成や、入力されたID(パスワード)が特定のIDと一致した場合にのみプロテクトが解除される構成で実現される場合もある。しかしながら、このような構成においては、構成の存在自体がセキュリティーホールとなる。すなわち、悪意の第三者が当該マイコンを詳細に調査するなどして、特定の信号や特定のIDを知ると、プロテクト機能は無効化されてしまう。  For example, the protection release function releases the protection only when a specific signal is given from an external device connected to the microcomputer to release the protection, or when the input ID (password) matches the specific ID. In some cases, the configuration is realized. However, in such a configuration, the existence of the configuration itself becomes a security hole. That is, when a malicious third party investigates the microcomputer in detail and learns a specific signal or a specific ID, the protection function is invalidated.

そこで、プロテクトが解除される前に、そのプロテクトされているデータを消去する構成が提案されている。  Therefore, a configuration has been proposed in which the protected data is erased before the protection is released.

特許文献2には、プロテクト設定の解除が指示されると、プロテクトの設定を無視して、格納されているすべてのデータを消去する不揮発性半導体記憶装置が開示されている。また、特許文献3には、不揮発性メモリのデータを消去した後にのみ、不揮発性メモリに対するアクセスを許可するマイクロコンピュータ装置が開示されている。  Patent Document 2 discloses a nonvolatile semiconductor memory device that, when instructed to cancel protection setting, ignores the protection setting and erases all stored data.Patent Document 3 discloses a microcomputer device that permits access to a nonvolatile memory only after erasing data in the nonvolatile memory.

さらに、一般的に不揮発性メモリは、複数のブロックに分割されており、データの読出しおよび書込みはブロック単位で行なわれる。そのため、特許文献3には、ブロック単位でプロテクトの設定を行なう構成が開示されている。  Further, generally, a nonvolatile memory is divided into a plurality of blocks, and reading and writing of data are performed in units of blocks. For this reason,Patent Document 3 discloses a configuration in which protection is set in units of blocks.

ところで、近年のマイコンの高性能化に伴い、マイコンを動作させるためのプログラムも複雑化・大規模化している。そのため、プログラム製作者は、一からプログラムを製作するより、予め機能別に用意されたライブラリソフトウェアをプログラム中で読出す(サブルーチンコールする)ことでプログラム製作の効率化を図っている。このようなライブラリソフトウェアの提供者は、マイコンの製造者以外であることも多く、IP(Intellectual Property)ベンダと呼ばれる。
特開平11−120781号公報特開2001−014871号公報特開2003−203012号公報
By the way, with the recent high performance of microcomputers, programs for operating the microcomputers have become more complex and larger in scale. Therefore, rather than creating a program from scratch, the program producer reads the library software prepared for each function in advance in the program (subroutine call) to improve the efficiency of program production. The provider of such library software is often other than the manufacturer of the microcomputer, and is called an IP (Intellectual Property) vendor.
JP-A-11-120781 JP 2001-014871 A JP 2003-203012 A

しかしながら、特許文献2に開示される構成では、プロテクトを解除しようとすると、その都度すべてのメモリが消去されるので、データ領域の容量に比較して格納されているプログラムの容量が小さい場合などには、その消去に要する時間が相対的に大きくなり、マイコンの処理速度の低下をもたらすという問題点があった。一方、特許文献3に開示されている構成では、ブロック単位でプロテクト設定が行なわれるので、プロテクト対象となるプログラムなどが複数のブロックに格納される場合などには、その格納される複数のブロックのすべてに対してプロテクト設定を行なう必要があるが、その処理は複雑となるため、プロテクト設定のミスによりデータの漏洩が生じるという問題点があった。  However, in the configuration disclosed inPatent Document 2, every time the protection is canceled, all the memories are erased. Therefore, when the capacity of the stored program is smaller than the capacity of the data area, etc. However, there is a problem that the time required for the erasure becomes relatively large and the processing speed of the microcomputer is lowered. On the other hand, in the configuration disclosed inPatent Document 3, protection is set in units of blocks. Therefore, when a program to be protected is stored in a plurality of blocks, the plurality of blocks to be stored are stored. Although it is necessary to set protection for all of them, since the processing is complicated, there is a problem that data leakage occurs due to a mistake in protection setting.

また、IPベンダにとって、ライブラリソフトウェアをプログラム中で読出して実行されることは通常の使用であり問題はないが、ライブラリソフトウェア自体(命令コード)の内容が読出されてしまうと、第三者に不当にコピーされ、開発費が回収できない事態やノウハウの流出が生じるという問題があった。そのため、プログラム製作者およびエンドユーザに対して、ライブラリソフトウェア自体の内容が読出されないように、プロテクトを設定する必要が生じている。  For IP vendors, reading and executing library software in a program is normal use and there is no problem, but if the contents of the library software itself (instruction code) are read, it is illegal for a third party. The development costs were not collected and the know-how leaked. Therefore, it is necessary to set protection for the program producer and the end user so that the contents of the library software itself are not read out.

しかしながら、従来のプロテクト機能においては、プログラム中の読出し(サブルーチンコール)であるか否かにかかわらず、プロテクトされているデータは、一律にアクセスが禁止されるため、プロテクトを設定してしまうと、ライブラリソフトウェアを利用することができずジレンマに陥るという問題点があった。  However, in the conventional protection function, access to the protected data is uniformly prohibited regardless of whether it is a read (subroutine call) in the program. There was a problem that the library software could not be used and fell into a dilemma.

そこで、この発明は、かかる問題を解決するためになされたものであり、その第1の目的は、処理速度を低下させることなく、かつ、容易な処理により高いデータ機密保護機能を実現する半導体装置を提供することである。  Accordingly, the present invention has been made to solve such a problem, and a first object of the present invention is to provide a semiconductor device that realizes a high data security function by a simple process without reducing the processing speed. Is to provide.

また、この発明の第2の目的は、格納される命令コード自体の機密保護を実現すると同時に、命令コードに基づく処理を実行できる半導体装置を提供することである。  A second object of the present invention is to provide a semiconductor device capable of executing processing based on an instruction code while realizing the security of the stored instruction code itself.

また、この発明の第3の目的は、上記の第1および第2の目的を同時に実現する半導体装置を提供することである。  A third object of the present invention is to provide a semiconductor device that simultaneously realizes the first and second objects.

第1の発明によれば、複数のブロックに分割されたデータ領域と、ブロック毎にアクセスを禁止するための保護情報が格納される保護情報領域とを含む不揮発性記憶部と、保護情報領域に格納された保護情報を読出す読出部と、いずれかのブロックに対するアクセスの禁止を解除する前に、当該ブロックに格納されているデータを消去する制御部とを備える半導体装置である。そして、制御部は、読出部から保護情報を受け、保護情報によりアクセスを禁止され得るいずれかのブロックにおいてアクセスが禁止されていれば、保護情報によりアクセスを禁止され得るすべてのブロックへのアクセスを禁止する。  According to the first invention, a nonvolatile storage unit including a data area divided into a plurality of blocks, and a protection information area in which protection information for prohibiting access is stored for each block, and the protection information area A semiconductor device includes a reading unit that reads stored protection information and a control unit that erases data stored in the block before canceling the prohibition of access to any block. Then, the control unit receives the protection information from the reading unit, and if access is prohibited in any of the blocks that can be prohibited by the protection information, the control unit accesses all the blocks that can be prohibited from access by the protection information. Ban.

また、第2の発明によれば、複数のブロックに分割されたデータ領域と、ブロック毎にアクセスを禁止するための保護情報が格納される保護情報領域とを含む不揮発性記憶部と、保護情報領域に格納された保護情報を読出す読出部と、いずれかのブロックに対するアクセスの禁止を解除する前に、当該ブロックに格納されているデータを消去する制御部と、データ領域に格納された命令コードを読出して処理を実行する演算部とを備える半導体装置である。そして、制御部は、読出部から受けた保護情報に基づいて、保護情報によりアクセスを禁止され得るブロックへのアクセスを許可するか否かを決定し、かつ、演算部から命令コードの読出しを行なうためのアクセス要求を受けると、保護情報にかかわらず当該アクセスを許可する。  According to the second invention, the non-volatile storage unit including a data area divided into a plurality of blocks, and a protection information area for storing protection information for prohibiting access for each block, and the protection information A read unit for reading the protection information stored in the area, a control unit for erasing the data stored in the block before canceling the prohibition of access to any block, and an instruction stored in the data area A semiconductor device including an arithmetic unit that reads a code and executes processing. Then, based on the protection information received from the reading unit, the control unit determines whether to permit access to a block whose access can be prohibited by the protection information, and reads the instruction code from the arithmetic unit. When the access request is received, the access is permitted regardless of the protection information.

また、第3の発明によれば、複数のブロックに分割されたデータ領域と、ブロック毎にそれぞれアクセスを禁止するための第1および第2の保護情報が格納される保護情報領域とを含む不揮発性記憶部と、保護情報領域に格納された第1および第2の保護情報を読出す読出部と、いずれかのブロックに対するアクセスの禁止を解除する前に、当該ブロックに格納されているデータを消去する制御部と、データ領域に格納された命令コードを読出して処理を実行する演算部とを備える半導体装置である。そして、制御部は、読出部から第1の保護情報を受け、第1の保護情報によりアクセスを禁止され得るいずれかのブロックにおいてアクセスが禁止されていれば、第1の保護情報によりアクセスを禁止され得るすべてのブロックへのアクセスを禁止し、かつ、読出部から受けた第2の保護情報に基づいて、第2の保護情報によりアクセスを禁止され得るブロックへのアクセスを許可するか否かを決定し、かつ、演算部から命令コードの読出しを行なうためのアクセス要求を受けると、第2の保護情報にかかわらず当該アクセスを許可する。  According to the third aspect of the present invention, the nonvolatile memory includes a data area divided into a plurality of blocks and a protection information area in which first and second protection information for prohibiting access is stored for each block. Data storage unit, a reading unit for reading the first and second protection information stored in the protection information area, and the data stored in the block before canceling the prohibition of access to any block The semiconductor device includes a control unit for erasing and an arithmetic unit for reading an instruction code stored in a data area and executing processing. The control unit receives the first protection information from the reading unit, and if the access is prohibited in any of the blocks that can be prohibited by the first protection information, the control unit prohibits the access by the first protection information. Whether to allow access to all blocks that can be accessed and whether to permit access to blocks that can be prohibited to access by the second protection information based on the second protection information received from the reading unit When the access request for determining and reading the instruction code is received from the arithmetic unit, the access is permitted regardless of the second protection information.

第1の発明によれば、アクセスの禁止が解除される場合において、ブロック単位でデータが消去される一方、アクセスを禁止され得るすべてのブロックに対するアクセスの禁止が解除されない限り、いずれのブロックに対するアクセスも許可されない。よって、すべてのブロックに格納されているデータを一括で消去する場合に比較して、効率的にデータ消去ができるので、処理速度の低下を抑制でき、かつ、すべてのブロックに対するアクセスの禁止を一体的に行なうことができるので、高いデータ機密保護機能を実現できる。  According to the first invention, when access prohibition is released, data is erased in units of blocks, while any block access is prohibited unless access prohibition for all blocks that can be prohibited from access is released. Is also not allowed. Therefore, data can be erased more efficiently than when erasing data stored in all blocks at once, so that the reduction in processing speed can be suppressed and access to all blocks can be prohibited. Therefore, a high data security function can be realized.

また、第2の発明によれば、アクセスの禁止が設定されているブロックに対しては、アクセスが許可されず、かつ、アクセスの禁止を解除する場合には、必ず当該ブロックに格納されているデータは消去される。例外的に、演算部がデータ領域に格納されている処理コードを読出して処理を実行する場合に限り、アクセス先のブロックにおける保護情報にかかわらずアクセスが許可される。よって、命令コード自体の機密保護が確保されると同時に、演算部は命令コードに基づく処理の実行を実現できる。  According to the second invention, access is not permitted to a block for which access prohibition is set, and the block is always stored in the block when access prohibition is released. Data is erased. Exceptionally, access is permitted regardless of the protection information in the access destination block only when the arithmetic unit reads the processing code stored in the data area and executes the processing. Therefore, the confidentiality protection of the instruction code itself is ensured, and at the same time, the arithmetic unit can implement processing based on the instruction code.

また、第3の発明によれば、第1の保護情報によるアクセスの禁止が解除される場合において、ブロック単位でデータが消去される一方、アクセスを禁止され得るすべてのブロックに対するアクセスの禁止が解除されない限り、いずれのブロックに対するアクセスも許可されない。よって、すべてのブロックに格納されているデータを一括で消去する場合に比較して、効率的にデータ消去ができるので、処理速度の低下を抑制でき、かつ、すべてのブロックに対するアクセスの禁止を一体的に行なうことができるので、高いデータ機密保護機能を実現できる。また、第2の保護情報によりアクセスの禁止が設定されているブロックに対しては、アクセスが許可されず、かつ、アクセスの禁止を解除する場合には、必ず当該ブロックに格納されているデータは消去される。例外的に、演算部がデータ領域に格納されている処理コードを読出して処理を実行する場合に限り、アクセス先のブロックにおける保護情報にかかわらずアクセスが許可される。よって、命令コード自体の機密保護が確保されると同時に、演算部は命令コードに基づく処理の実行を実現できる。  According to the third invention, when the prohibition of access by the first protection information is canceled, the data is erased in units of blocks, while the prohibition of access to all the blocks that can be prohibited from access is canceled. Unless it is, access to any block is not allowed. Therefore, data can be erased more efficiently than when erasing data stored in all blocks at once, so that the reduction in processing speed can be suppressed and access to all blocks can be prohibited. Therefore, a high data security function can be realized. In addition, for a block for which access prohibition is set by the second protection information, access is not permitted, and when the access prohibition is canceled, the data stored in the block is always Erased. Exceptionally, access is permitted regardless of the protection information in the access destination block only when the arithmetic unit reads the processing code stored in the data area and executes the processing. Therefore, the confidentiality protection of the instruction code itself is ensured, and at the same time, the arithmetic unit can implement processing based on the instruction code.

この発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。  Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings are denoted by the same reference numerals and description thereof will not be repeated.

[実施の形態1]
実施の形態1では、IPベンダまたはプログラム製作者がエンドユーザに対するプロテクトを目的とするプロテクト機能について説明する。
[Embodiment 1]
In the first embodiment, a protection function for protecting an end user by an IP vendor or a program producer will be described.

図1は、実施の形態1に従う半導体装置101の概略構成図である。
図1を参照して、半導体装置101は、データバス98と、演算部(CPU:Central Processing Unit;以下、CPUと称す)90と、不揮発性メモリ1と、読出部12と、制御部10と、電源部97とからなる。
FIG. 1 is a schematic configuration diagram of asemiconductor device 101 according to the first embodiment.
Referring to FIG. 1, asemiconductor device 101 includes adata bus 98, a calculation unit (CPU: Central Processing Unit; hereinafter referred to as CPU) 90, anonvolatile memory 1, areading unit 12, and acontrol unit 10. , And apower supply unit 97.

データバス98は、CPU90、制御部10、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 90, thecontrol unit 10, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU90は、データバス98を介して不揮発性メモリ1との間でデータの授受を行なう。そして、CPU90は、外部からリセット信号を受けると、後述する動作モードに応じて、不揮発性メモリ1または外部メモリ(図示しない)に格納されているプログラムを読出して起動する。さらに、CPU90は、不揮発性メモリ1からプログラムを読出して起動する場合には、そのモード信号を制御部10へ出力する。  TheCPU 90 exchanges data with thenonvolatile memory 1 via thedata bus 98. When receiving a reset signal from the outside, theCPU 90 reads and starts a program stored in thenonvolatile memory 1 or the external memory (not shown) according to an operation mode described later. Further,CPU 90 outputs a mode signal to controlunit 10 when the program is read fromnonvolatile memory 1 and activated.

不揮発性メモリ1は、フラッシュメモリやEEPROMなどの半導体からなり、複数のブロックに分割されたデータ領域1.1とプロテクト情報領域1.2とを含む。  Thenonvolatile memory 1 is made of a semiconductor such as a flash memory or an EEPROM, and includes a data area 1.1 and a protect information area 1.2 divided into a plurality of blocks.

データ領域1.1は、ブロック1,2,・・・,Nに分割されており、それぞれデータ1,2,・・・,Nが格納される。  The data area 1.1 is divided intoblocks 1, 2,..., N, andstores data 1, 2,.

プロテクト情報領域1.2は、データ領域1.1におけるブロックに対応するように分割されており、データ領域のそれぞれのブロックに対するプロテクト設定が格納される。実施の形態1におけるプロテクト情報領域1.2には、それぞれ1ビットからなる全体保護フラグ1a,2a,・・・,Naが格納され、このフラグ値(「0」または「1」)に応じて、データ領域1.1のそれぞれのブロックに対するプロテクト設定の有無が判断される。  The protect information area 1.2 is divided so as to correspond to the blocks in the data area 1.1, and protect settings for the respective blocks in the data area are stored. The protection information area 1.2 according to the first embodiment stores 1-bit total protection flags 1a, 2a,..., Na, and according to the flag value (“0” or “1”). The presence / absence of protection setting for each block in the data area 1.1 is determined.

読出部12は、不揮発性メモリ1のプロテクト情報領域1.2に格納されている全体保護フラグ1a,2a,・・・,Naを読出し、制御部10へ出力する。そして、読出部12は、読出回路16と、読出レジスタ18とからなる。  Thereading unit 12 reads the overall protection flags 1a, 2a,..., Na stored in the protection information area 1.2 of thenonvolatile memory 1 and outputs them to thecontrol unit 10. Thereading unit 12 includes areading circuit 16 and areading register 18.

読出回路16は、外部からのリセット信号や電源部97からの投入信号を受けて、プロテクト情報領域1.2に格納されている全体保護フラグ1a,2a,・・・,Naを読出し、読出レジスタ18へ出力する。  Theread circuit 16 receives the reset signal from the outside and the input signal from thepower supply unit 97, reads the overall protection flags 1a, 2a,..., Na stored in the protection information area 1.2, and reads theread register 18 is output.

読出レジスタ18は、全体保護フラグ1a,2a,・・・,Naのそれぞれを一旦格納し、その値を制御部10へ出力する。読出レジスタ18は、読出回路16から新たに全体保護フラグを受けるまで、その値を保持する。そのため、読出レジスタ18から出力される値は、外部からのリセット信号や電源部97からの投入信号を受けるタイミングでのみ更新される。  The read register 18 temporarily stores each of the overall protection flags 1a, 2a,..., Na and outputs the value to thecontrol unit 10. Readregister 18 holds the value until a new overall protection flag is received from readcircuit 16. For this reason, the value output from the readregister 18 is updated only at the timing of receiving an external reset signal or an input signal from thepower supply unit 97.

制御部10は、OR回路15と、起動モード判断部(判断部a)14と、制御回路11とからなる。  Thecontrol unit 10 includes an ORcircuit 15, an activation mode determination unit (determination unit a) 14, and acontrol circuit 11.

OR回路15は、読出レジスタ18から全体保護フラグ1a,2a,・・・,Naを受けて論理和(OR)演算を行ない、全体保護フラグ1a,2a,・・・,Naのうちいずれか1つでもプロテクト設定がなされていれば、起動モード判断部14へ「ON」を出力する。  The ORcircuit 15 receives the overall protection flags 1a, 2a,..., Na from the readregister 18 and performs a logical sum (OR) operation, and any one of the overall protection flags 1a, 2a,. If protection is set at any time, “ON” is output to the activationmode determination unit 14.

起動モード判断部14は、OR回路15から「ON」を受けている場合には、データ領域1.1のすべてのブロックに対する読出しおよび書込み(以下、アクセスとも称す)を禁止させるプロテクト制御信号を制御回路11へ出力する。そして、起動モード判断部14は、例外的にCPU90からモード信号を受けている場合においては、そのアクセスを禁止させるプロテクト制御信号をマスクする。これは、CPU90は、不揮発性メモリ1に格納されているプログラムを読出して起動するため、アクセスの禁止が解除されていないと、CPU90が起動できないという問題が生じるからである。  The activationmode determination unit 14 controls a protection control signal for prohibiting reading and writing (hereinafter also referred to as access) to all blocks in the data area 1.1 when receiving “ON” from theOR circuit 15. Output to thecircuit 11. If the mode signal is exceptionally received from theCPU 90, the activationmode determination unit 14 masks the protection control signal that prohibits the access. This is because theCPU 90 reads and starts the program stored in thenon-volatile memory 1, so that there is a problem that theCPU 90 cannot be started unless access prohibition is lifted.

制御回路11は、データバスを介して、データ領域1.1のいずれかのブロックに対するプロテクトの設定解除の要求を受けると、当該ブロックに格納されているデータを消去し、そのデータが消去されたことを確認した後に、プロテクト情報領域1.2に格納されている当該ブロックに対応する保護フラグの値を変更し、プロテクトの設定を解除する。また、制御回路11は、データバスを介して、データ領域1.1のいずれかのブロックに対するアクセスの要求を受けると、起動モード判断部14からアクセスを禁止するプロテクト制御信号を受けているか否かを判断する。そして、制御回路11は、アクセスを禁止するプロテクト制御信号を受けていなければ、そのアクセスを許可し、その要求先のブロックに格納されているデータを読出し、またはその要求先のブロックへデータを書込む。さらに、制御回路11は、データバスを介して、データ領域1.1のいずれかのブロックに対するプロテクトの設定要求を受けると、プロテクト情報領域1.2に格納されている当該ブロックに対応する全体保護フラグの値を変更し、プロテクトを設定する。  When thecontrol circuit 11 receives a request to cancel the protection setting for any block in the data area 1.1 via the data bus, thecontrol circuit 11 erases the data stored in the block, and the data is erased. After confirming this, the value of the protection flag corresponding to the block stored in the protection information area 1.2 is changed to cancel the protection setting. When thecontrol circuit 11 receives a request for access to any block in the data area 1.1 via the data bus, thecontrol circuit 11 receives a protection control signal for prohibiting access from the activationmode determination unit 14. Judging. If thecontrol circuit 11 has not received a protect control signal for prohibiting access, thecontrol circuit 11 permits the access and reads the data stored in the requested block or writes the data to the requested block. Include. Further, when thecontrol circuit 11 receives a protection setting request for any block in the data area 1.1 via the data bus, the entire protection corresponding to the block stored in the protection information area 1.2 is received. Change the flag value and set protection.

電源部97は、外部からの指令を受けて、半導体装置101の各部への電源供給を開始し、かつ、その電源供給の開始と同時に投入信号を読出回路16へ出力する。  In response to an external command, thepower supply unit 97 starts supplying power to each unit of thesemiconductor device 101 and outputs a turn-on signal to thereading circuit 16 simultaneously with the start of the power supply.

上述したように、半導体装置101は、複数の動作モードを有し、その動作モードに応じて、プロテクト設定の有効および無効を判断する必要がある。  As described above, thesemiconductor device 101 has a plurality of operation modes, and it is necessary to determine whether the protection setting is valid or invalid according to the operation modes.

図2は、半導体装置101の動作モードを説明するための図である。
図2(a)は、マイコン内蔵メモリプログラム起動モードである。
FIG. 2 is a diagram for explaining an operation mode of thesemiconductor device 101.
FIG. 2A shows the microcomputer built-in memory program start mode.

図2(b)は、マイコン外部メモリプログラム起動モードである。
図2(c)は、CPU非動作起動モードである。
FIG. 2B shows a microcomputer external memory program start mode.
FIG. 2C shows a CPU non-operation start mode.

図2(a)を参照して、「マイコン内蔵メモリプログラム起動モード」では、CPU90は、不揮発性メモリ1からデータバス98を介してプログラムを読出し、起動する。そのため、CPU90が起動できるように、不揮発性メモリ1のプロテクト設定を一時的に無効にする必要がある。  Referring to FIG. 2A, in the “microcomputer built-in memory program start mode”, theCPU 90 reads the program from thenonvolatile memory 1 via thedata bus 98 and starts it. Therefore, it is necessary to temporarily disable the protection setting of thenonvolatile memory 1 so that theCPU 90 can be activated.

図2(b)を参照して、「マイコン外部メモリプログラム起動モード」では、半導体装置101にデータバス98を介して、外部メモリ200が接続される。そして、CPU90は、外部メモリ200からデータバス98を介してプログラムを読出し、起動する。ここで、IPベンダおよびプログラム製作者以外の何人でも外部メモリ200にプログラムを書込むことが可能であるので、プロテクト設定されたブロックに格納されているデータを読出すような悪意のあるプログラムが実行されるおそれがある。そのため、「マイコン外部メモリプログラム起動モード」では、CPU90の処理状態にかかわらず不揮発性メモリ1のプロテクト設定を常時有効とする。  Referring to FIG. 2B, in the “microcomputer external memory program start mode”, theexternal memory 200 is connected to thesemiconductor device 101 via thedata bus 98. Then, theCPU 90 reads the program from theexternal memory 200 via thedata bus 98 and starts it. Here, since anyone other than the IP vendor and the program creator can write the program to theexternal memory 200, a malicious program that reads data stored in the protected block is executed. There is a risk of being. Therefore, in the “microcomputer external memory program start mode”, the protection setting of thenonvolatile memory 1 is always valid regardless of the processing state of theCPU 90.

図2(c)を参照して、「CPU非動作起動モード」では、半導体装置101のデータバス98に外部装置202が接続される。そして、外部装置202は、CPU90の処理にかかわらず、不揮発性メモリ1に対して直接アクセスを行なう。ここで、IPベンダおよびプログラム製作者以外の何人でも半導体装置101に外部装置202を接続できるので、悪意のある第三者が不揮発性メモリ1に格納されているデータを直接読出すおそれがある。そのため、「CPU非動作起動モード」では、CPU90の処理状態にかかわらず不揮発性メモリ1のプロテクト設定を常時有効とする。  With reference to FIG. 2C, in the “CPU non-operation start mode”, theexternal device 202 is connected to thedata bus 98 of thesemiconductor device 101. Theexternal device 202 directly accesses thenonvolatile memory 1 regardless of the processing of theCPU 90. Here, any number of persons other than the IP vendor and the program producer can connect theexternal device 202 to thesemiconductor device 101, so that a malicious third party may directly read the data stored in thenonvolatile memory 1. Therefore, in the “CPU non-operation start mode”, the protection setting of thenonvolatile memory 1 is always valid regardless of the processing state of theCPU 90.

(プロテクト設定)
データ領域1.1のいずれのブロックに対してもプロテクトが設定されていない状態において、CPU90または外部からプロテクト対象のデータが転送されると、制御回路11は、転送されたデータを所定のブロックに書込む。さらに、CPU90または外部から当該データに対するプロテクトの設定が要求されると、制御回路11は、データを格納したブロックに対応するプロテクト情報領域1.2の全体保護フラグの値を変更し、プロテクト設定を行なう。以下、同様の処理により、不揮発性メモリ1に格納されるすべてのデータをプロテクトすることができる。
(Protect setting)
When the protection target data is transferred from theCPU 90 or the outside in a state where no protection is set for any block in the data area 1.1, thecontrol circuit 11 transfers the transferred data to a predetermined block. Write. Further, when the protection setting for the data is requested from theCPU 90 or the outside, thecontrol circuit 11 changes the value of the entire protection flag in the protection information area 1.2 corresponding to the block storing the data, and sets the protection setting. Do. Thereafter, all data stored in thenonvolatile memory 1 can be protected by the same processing.

なお、制御回路11は、プロテクトされているブロックに対するデータの読出し要求を受けると、格納されているデータと異なるデータを応答する。また、制御回路11は、プロテクトされているブロックに対するデータの書込み要求を受けると、何らの動作も行なわない(無視)、または、その要求を違反動作として扱う。  When thecontrol circuit 11 receives a data read request for the protected block, thecontrol circuit 11 responds with data different from the stored data. Further, when receiving a data write request for a protected block, thecontrol circuit 11 does not perform any operation (ignore) or treats the request as a violation operation.

(プロテクト解除)
CPU90または外部からデータ領域1.1のいずれかのブロックに対するプロテクトの設定解除が要求されると、制御回路11は、指定されたブロックに格納されているデータを消去する。そして、制御回路11は、消去ベリファイ動作などにより、格納されているデータの消去が完了したことを確認した後、そのブロックに対応するプロテクト情報領域1.2の全体保護フラグの値を変更し、当該ブロックのプロテクト設定を解除する。
(Unprotect)
When it is requested from theCPU 90 or the outside to cancel the protection setting for any block in the data area 1.1, thecontrol circuit 11 erases the data stored in the designated block. Then, after confirming that the stored data has been erased by an erase verify operation or the like, thecontrol circuit 11 changes the value of the overall protection flag in the protect information area 1.2 corresponding to the block, Cancel the protection setting of the block.

一方、制御回路11は、データ領域1.1のいずれかのブロックに対するプロテクト設定がされていれば、起動モード判断部14からアクセスを禁止するプロテクト制御信号を受けるため、すべてのブロックに対するアクセスを禁止する。そのため、1つのブロックに対するプロテクト設定が解除されたとしても、プロテクト設定がされている他のブロックが存在すれば、データ領域1.1のすべてのブロックに対してプロテクトが設定されていることになる。すなわち、制御回路11は、データ領域1.1のすべてのブロックに対してプロテクトの設定を解除しなければ、データ領域1.1のいずれのブロックに対してもアクセスを許可しない。  On the other hand, if the protection setting is set for any block in the data area 1.1, thecontrol circuit 11 receives a protection control signal for prohibiting access from the activationmode determination unit 14, and therefore prohibits access to all blocks. To do. Therefore, even if the protection setting for one block is canceled, if there is another block for which protection setting has been made, protection is set for all the blocks in the data area 1.1. . That is, thecontrol circuit 11 does not permit access to any block in the data area 1.1 unless the protection setting is released for all the blocks in the data area 1.1.

そこで、CPU90または外部から、データ領域1.1のすべてのブロックに対して、プロテクトの設定解除が要求され、すべてのブロックに格納されているデータが消去されて、初めてデータ領域1.1へのアクセスが可能となる。  Therefore, theCPU 90 or the outside requests that all blocks in the data area 1.1 be released from the protection setting, and the data stored in all the blocks is erased. Access is possible.

なお、読出部12は、外部からのリセット信号や電源部97からの投入信号を受けるまで、保護フラグの値を更新しないので、プロテクト設定または設定解除は、半導体装置101がリセットされた場合または、電源が再投入された場合に有効となる。  Note that thereading unit 12 does not update the value of the protection flag until it receives a reset signal from the outside or a turn-on signal from thepower supply unit 97. Therefore, the protection setting or setting cancellation is performed when thesemiconductor device 101 is reset or This is effective when the power is turned on again.

以上のように、少なくともデータ領域1.1のいずれか1つのブロックに対してプロテクト設定が行なわれれば、すべてのブロックに対してプロテクトが有効となる。一方、データ領域1.1のすべてのブロックに対してプロテクト設定が解除されなければ、すべてのブロックに対してプロテクト設定が解除されない。  As described above, when protection is set for at least one block in the data area 1.1, protection is effective for all blocks. On the other hand, unless the protection setting is released for all the blocks in the data area 1.1, the protection setting is not released for all the blocks.

すなわち、データ領域1.1のプロテクトを設定する場合には、ブロック単位で容易に行なうことができるが、データ領域1.1のプロテクト設定を解除する場合には、すべてのブロックのそれぞれに対して複雑な処理が必要となる。  That is, when the protection of the data area 1.1 is set, it can be easily performed in units of blocks. However, when the protection setting of the data area 1.1 is cancelled, for each of all the blocks. Complex processing is required.

この発明の実施の形態1によれば、データ領域のプロテクト設定を解除する場合には、ブロック単位でデータ消去および保護フラグ値の変更が行なわれる。そのため、すべてのブロックを一括で消去する場合に比較して、効率的にデータ消去が行なえるので、処理速度の低下を抑制できる。一方、データ領域のプロテクト設定を解除するためには、すべてのブロックに対するプロテクト設定を解除しなければならない。よって、プロテクト設定を解除するためには、すべてのブロックに格納されているデータを消去する必要があり、高いデータ機密保護機能を実現できる。  According to the first embodiment of the present invention, when the protection setting of the data area is canceled, the data erasure and the protection flag value are changed in units of blocks. Therefore, data can be erased more efficiently than when all the blocks are erased at once, so that a reduction in processing speed can be suppressed. On the other hand, in order to cancel the protection setting for the data area, the protection setting for all blocks must be canceled. Therefore, in order to cancel the protection setting, it is necessary to erase the data stored in all the blocks, and a high data security protection function can be realized.

また、この発明の実施の形態1によれば、制御部は、CPUが「マイコン内蔵メモリプログラム起動モード」であれば、CPUからのアクセスを許可する一方、他のモードであればアクセスを許可しない。よって、半導体装置と接続された外部装置からの要求によるデータ漏洩を防止できる。  Further, according to the first embodiment of the present invention, the control unit permits access from the CPU when the CPU is in the “microcomputer built-in memory program start mode”, but does not permit access when the CPU is in another mode. . Therefore, data leakage due to a request from an external device connected to the semiconductor device can be prevented.

[実施の形態2]
実施の形態1においては、IPベンダまたはプログラム製作者がエンドユーザに対するプロテクトを目的としたプロテクト機能を備える半導体装置について説明した。
[Embodiment 2]
In the first embodiment, the semiconductor device provided with the protection function for the purpose of protecting the end user by the IP vendor or the program producer has been described.

一方、実施の形態2では、IPベンダがプログラム製作者およびエンドユーザに対するプロテクトを目的としたプロテクト機能を備える半導体装置について説明する。  On the other hand, in the second embodiment, a description will be given of a semiconductor device provided with a protection function for the purpose of protecting IP program vendors and end users from IP vendors.

図3は、実施の形態2に従う半導体装置102の概略構成図である。
図3を参照して、半導体装置102は、データバス98と、CPU92と、不揮発性メモリ2と、読出部22と、制御部20と、電源部97とからなる。
FIG. 3 is a schematic configuration diagram of thesemiconductor device 102 according to the second embodiment.
Referring to FIG. 3,semiconductor device 102 includesdata bus 98,CPU 92,nonvolatile memory 2, readingunit 22,control unit 20, andpower supply unit 97.

データバス98は、CPU92、制御部20、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 92, thecontrol unit 20, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU92は、データバス98を介して不揮発性メモリ2との間でデータの授受を行なう。そして、CPU92は、実施の形態1におけるCPU90と同様に、不揮発性メモリ2からプログラムを読出して起動する(「マイコン内蔵メモリプログラム起動モード」の)場合には、そのモード信号を制御部20へ出力する。  TheCPU 92 exchanges data with thenonvolatile memory 2 through thedata bus 98. Then, as withCPU 90 in the first embodiment,CPU 92 outputs a mode signal to controlunit 20 when the program is read out fromnonvolatile memory 2 and activated ("microcomputer built-in memory program activation mode"). To do.

また、CPU92は、プログラムカウンタ(PC)95を含み、プログラムカウンタ95に格納されるプログラムカウンタ値に従い、不揮発性メモリ2から命令コードを読出して処理を実行する。このようなCPU92による命令コードの読出しは、命令フェッチと称される。なお、プログラムカウンタ値は、CPU92の処理実行に伴い、順次カウントアップされる。  Further, theCPU 92 includes a program counter (PC) 95, and reads out an instruction code from thenonvolatile memory 2 according to a program counter value stored in theprogram counter 95 and executes processing. Such reading of the instruction code by theCPU 92 is referred to as instruction fetch. The program counter value is sequentially counted up as theCPU 92 executes the process.

さらに、CPU92は、不揮発性メモリ2に対するアクセスを実行する際に、その不揮発性メモリ2のアクセス先のアドレス(以下、アクセスアドレスと称す)を制御部20へ出力する。同時に、CPU92は、そのアクセスが命令フェッチによるものであるか、命令フェッチ以外のデータへのアクセス(以下、データアクセスと称す)によるものであるかを示すステータス信号(以下、アクセスステータスと称す)を制御部20へ出力する。  Further, when executing access to thenonvolatile memory 2, theCPU 92 outputs an access destination address (hereinafter referred to as an access address) of thenonvolatile memory 2 to thecontrol unit 20. At the same time, theCPU 92 generates a status signal (hereinafter referred to as an access status) indicating whether the access is due to an instruction fetch or an access to data other than the instruction fetch (hereinafter referred to as data access). Output to thecontrol unit 20.

不揮発性メモリ2は、フラッシュメモリやEEPROMなどの半導体からなり、複数のブロックに分割されたデータ領域2.1とプロテクト情報領域2.2とを含む。  Thenonvolatile memory 2 is made of a semiconductor such as flash memory or EEPROM, and includes a data area 2.1 and a protect information area 2.2 divided into a plurality of blocks.

データ領域2.1は、ブロック1,2,・・・,M,・・・,Nに分割されており、それぞれデータ1,2,・・・,M,・・・,Nが格納される。  The data area 2.1 is divided intoblocks 1, 2,..., M,..., N, andstores data 1, 2,. .

プロテクト情報領域2.2は、データ領域2.1に含まれるブロックのうち所定のブロックに対応するように配置されており、その所定のブロックに対するプロテクト設定が格納される。実施の形態2におけるプロテクト情報領域2.2には、データ領域2.1に含まれるブロック1,2,・・・,M,・・・,Nのうち、ブロックMに対する1ビットの部分保護フラグMbが格納され、このフラグ値(「0」または「1」)に応じて、ブロックMに対するプロテクト設定の有無が判断される。  The protect information area 2.2 is arranged so as to correspond to a predetermined block among the blocks included in the data area 2.1, and stores protection settings for the predetermined block. In the protect information area 2.2 in the second embodiment, a 1-bit partial protection flag for the block M among theblocks 1, 2,..., M,. Mb is stored, and the presence / absence of protection setting for the block M is determined according to the flag value (“0” or “1”).

読出部22は、不揮発性メモリ2のプロテクト情報領域2.2に格納されている部分保護フラグMbを読出し、制御部20へ出力する。そして、読出部22は、読出回路26と、読出レジスタ28とからなる。  Thereading unit 22 reads the partial protection flag Mb stored in the protection information area 2.2 of thenonvolatile memory 2 and outputs it to thecontrol unit 20. Thereading unit 22 includes areading circuit 26 and areading register 28.

読出回路26は、外部からのリセット信号や電源部97からの投入信号を受けて、プロテクト情報領域2.2に格納されている部分保護フラグMbを読出し、読出レジスタ28へ出力する。  Theread circuit 26 receives a reset signal from the outside and an input signal from thepower supply unit 97, reads the partial protection flag Mb stored in the protect information area 2.2 and outputs it to theread register 28.

読出レジスタ28は、部分保護フラグMbを一旦格納し、その値を制御部20へ出力する。読出レジスタ28は、読出回路26から新たに部分保護フラグMbを受けるまで、その値を保持する。そのため、読出レジスタ28から出力される値は、外部からのリセット信号や電源部97からの投入信号を受けるタイミングでのみ更新される。  Readregister 28 temporarily stores partial protection flag Mb and outputs the value to controlunit 20. Theread register 28 holds the value until a new partial protection flag Mb is received from the readcircuit 26. For this reason, the value output from the readregister 28 is updated only at the timing of receiving an external reset signal or an input signal from thepower supply unit 97.

制御部20は、アクセスモード判断部(判断部b)24と、制御回路21とからなる。
アクセスモード判断部24は、読出レジスタ28に格納される部分保護フラグMbに基づいて、ブロックMに対するプロテクトの設定がされている場合には、データ領域2.1のブロックMに対するアクセスを禁止させるプロテクト制御信号を制御回路21へ出力する。そして、アクセスモード判断部24は、例外的に、CPU92からモード信号を受けている場合で、かつ、CPU92からブロックMに対する命令フェッチによる命令コードの読出しである場合に限り、そのアクセスを禁止させるプロテクト制御信号をマスクする。これは、CPU92においてプログラム製作者により製作されたプログラムが実行される際に、サブルーチンコールだけを許可するためである。
Thecontrol unit 20 includes an access mode determination unit (determination unit b) 24 and a control circuit 21.
The accessmode determination unit 24 protects the access to the block M in the data area 2.1 when the protection is set for the block M based on the partial protection flag Mb stored in theread register 28. A control signal is output to the control circuit 21. The accessmode determination unit 24 exceptionally protects the access only when the mode signal is received from theCPU 92 and only when the instruction code is read from theCPU 92 by the instruction fetch with respect to the block M. Mask control signals. This is to allow only a subroutine call when the program produced by the program producer is executed in theCPU 92.

制御回路21は、データバスを介して、データ領域2.1のブロックMに対するプロテクトの設定解除の要求を受けると、ブロックMに格納されているデータを消去し、そのデータが消去されたことを確認した後に、プロテクト情報領域2.2に格納されているブロックMに対応する部分保護フラグMbの値を変更し、プロテクトの設定を解除する。また、制御回路21は、データバスを介して、データ領域2.1のブロックMに対するアクセスの要求を受けると、起動モード判断部14からアクセスを禁止するプロテクト制御信号を受けているか否かを判断する。そして、制御回路21は、アクセスを禁止するプロテクト制御信号を受けていなければ、そのアクセスを許可し、その要求先のブロックMに格納されているデータを読出し、またはその要求先のブロックMへデータを書込む。さらに、制御回路21は、データバスを介して、データ領域2.1のブロックMに対するプロテクトの設定要求を受けると、プロテクト情報領域2.1に格納されている部分保護フラグMbの値を変更し、プロテクトを設定する。  When the control circuit 21 receives a request to cancel the protection setting for the block M in the data area 2.1 via the data bus, the control circuit 21 erases the data stored in the block M and confirms that the data has been erased. After confirmation, the value of the partial protection flag Mb corresponding to the block M stored in the protection information area 2.2 is changed, and the protection setting is canceled. When the control circuit 21 receives a request for access to the block M in the data area 2.1 via the data bus, the control circuit 21 determines whether a protection control signal for prohibiting access is received from the activationmode determination unit 14. To do. If the control circuit 21 has not received a protection control signal for prohibiting access, the control circuit 21 permits the access, reads data stored in the requested block M, or sends data to the requested block M. Write. Further, upon receiving a protection setting request for the block M in the data area 2.1 via the data bus, the control circuit 21 changes the value of the partial protection flag Mb stored in the protection information area 2.1. Set protection.

電源部97については、実施の形態1と同様であるので、詳細な説明は繰返さない。
(プロテクト設定)
データ領域2.1のブロックMに対してプロテクト設定がなされていない状態において、CPU92または外部からプロテクト対象のデータが転送されると、制御回路21は、転送されたデータをブロックMに書込む。さらに、CPU92または外部から当該データに対するプロテクトの設定が要求されると、制御回路21は、データを格納したブロックMに対応する部分保護フラグMbの値を変更し、プロテクトを設定する。
Sincepower supply unit 97 is similar to that of the first embodiment, detailed description thereof will not be repeated.
(Protect setting)
In the state where the protection setting is not made for the block M in the data area 2.1, when the data to be protected is transferred from theCPU 92 or the outside, the control circuit 21 writes the transferred data into the block M. Further, when the protection setting for the data is requested from theCPU 92 or the outside, the control circuit 21 changes the value of the partial protection flag Mb corresponding to the block M storing the data and sets the protection.

上述のように、ブロックMに対してプロテクトが設定された場合には、制御回路21は、CPU92がマイコン内蔵メモリプログラム起動モードであり、かつ、命令フェッチにより命令コードを読出すためのアクセスであれば、ブロックMに対するアクセスを許可する。そのため、CPU92がブロックM以外のブロックに格納されている命令コードを命令フェッチして実行し、その実行処理中においてブロックMに対してデータアクセスがなされたとしても、制御回路21はそのアクセスを禁止する。  As described above, when the protection is set for the block M, the control circuit 21 can access theCPU 92 in the microcomputer built-in memory program start mode and read the instruction code by the instruction fetch. For example, access to the block M is permitted. Therefore, even if theCPU 92 fetches and executes an instruction code stored in a block other than the block M and executes data access to the block M during the execution process, the control circuit 21 prohibits the access. To do.

なお、制御回路21は、プロテクトされているブロックに対するデータの読出し要求を受けると、格納されているデータと異なるデータを応答する。また、制御回路21は、プロテクトされているブロックに対するデータの書込み要求を受けると、何らの動作も行なわない(無視)、または、その要求を違反動作として扱う。  When the control circuit 21 receives a data read request for the protected block, the control circuit 21 responds with data different from the stored data. When receiving a data write request for the protected block, the control circuit 21 does not perform any operation (ignore) or treats the request as a violation operation.

(プロテクト解除)
CPU92または外部からデータ領域2.1のブロックMに対するプロテクトの設定解除が要求されると、制御回路21は、ブロックMに格納されているデータを消去する。そして、制御回路21は、消去ベリファイ動作などにより、格納されているデータの消去が完了したことを確認した後、プロテクト情報領域2.2の部分保護フラグMbの値を変更し、ブロックMのプロテクト設定を解除する。
(Unprotect)
When theCPU 92 or the outside requests to cancel the protection setting for the block M in the data area 2.1, the control circuit 21 erases the data stored in the block M. The control circuit 21 confirms that the stored data has been erased by an erase verify operation or the like, and then changes the value of the partial protection flag Mb in the protect information area 2.2 to protect the block M. Cancel the setting.

以上のように、制御回路21は、データ領域2.1に格納されるライブラリソフトウェアに対して、命令フェッチによる命令コードの読出しに限定して、プロテクトを無効にするので、CPU92で実行されるプログラム中のサブルーチンコールを実現しながら、命令コード自体の漏洩を防止することができる。  As described above, since the control circuit 21 invalidates the protection for the library software stored in the data area 2.1 only by reading the instruction code by the instruction fetch, the program executed by theCPU 92 While realizing the subroutine call in the middle, it is possible to prevent the leakage of the instruction code itself.

この発明の実施の形態2によれば、プロテクトが設定されているブロックに対してのアクセスは許可されず、かつ、プロテクト設定を解除する場合には、当該ブロックに格納されているデータは必ず消去される。例外的に、CPUがデータ領域に格納されているライブラリソフトウェアなどの処理コードを読出して処理する場合に限り、保護情報にかかわらずアクセスが許可される。よって、命令コード自体の漏洩を防止し、かつ、CPUによるサブルーチンコールを制限なく実行させることができる。  According to the second embodiment of the present invention, access to a block for which protection is set is not permitted, and when the protection setting is canceled, the data stored in the block is always erased. Is done. Exceptionally, access is permitted regardless of the protection information only when the CPU reads and processes a processing code such as library software stored in the data area. Therefore, leakage of the instruction code itself can be prevented, and subroutine calls by the CPU can be executed without restriction.

[実施の形態3]
実施の形態1および2においては、それぞれ目的とする対象が異なるプロテクト機能について説明した。
[Embodiment 3]
In the first and second embodiments, the protect functions having different target objects have been described.

一方、実施の形態3では、実施の形態1および2の機能を同時に実現する半導体装置について説明する。なお、以下の説明では、明確化のため、実施の形態1におけるプロテクトを「全体プロテクト」とも称し、実施の形態2におけるプロテクトを「部分プロテクト」とも称す。  On the other hand, in the third embodiment, a semiconductor device that simultaneously realizes the functions of the first and second embodiments will be described. In the following description, for the sake of clarity, protection in the first embodiment is also referred to as “overall protection”, and protection in the second embodiment is also referred to as “partial protection”.

図4は、実施の形態3に従う半導体装置103の概略構成図である。
図4を参照して、半導体装置103は、データバス98と、CPU92と、不揮発性メモリ3と、読出部32と、制御部30と、電源部97とからなる。
FIG. 4 is a schematic configuration diagram ofsemiconductor device 103 according to the third embodiment.
Referring to FIG. 4,semiconductor device 103 includesdata bus 98,CPU 92,nonvolatile memory 3, readingunit 32,control unit 30, andpower supply unit 97.

データバス98は、CPU92、制御部30、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 92, thecontrol unit 30, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU92は、データバス98を介して不揮発性メモリ3との間でデータの授受を行なう。そして、CPU92は、実施の形態1におけるCPU90と同様に、不揮発性メモリ2からプログラムを読出して起動する(「マイコン内蔵メモリプログラム起動モード」の)場合には、そのモード信号を制御部10へ出力する。  TheCPU 92 exchanges data with thenonvolatile memory 3 through thedata bus 98. In the same manner asCPU 90 in the first embodiment,CPU 92 outputs a mode signal to controlunit 10 when the program is read fromnonvolatile memory 2 and activated (in “microcomputer built-in memory program activation mode”). To do.

また、CPU92は、実施の形態2におけるCPU92と同様に、プログラムカウンタ(PC)95を含み、プログラムカウンタ95に格納されるプログラムカウンタ値に従い、不揮発性メモリ3から命令コードを読出して処理を実行する。そして、CPU92は、不揮発性メモリ3に対するアクセスを実行する際に、アクセスアドレスおよびアクセスステータスを制御部30へ出力する。  Similarly toCPU 92 in the second embodiment,CPU 92 includes a program counter (PC) 95, and reads out an instruction code fromnonvolatile memory 3 according to the program counter value stored inprogram counter 95 to execute processing. . TheCPU 92 outputs an access address and an access status to thecontrol unit 30 when executing access to thenonvolatile memory 3.

不揮発性メモリ3は、フラッシュメモリやEEPROMなどの半導体からなり、複数のブロックに分割されたデータ領域3.1とプロテクト情報領域3.2および3.3とを含む。  Thenonvolatile memory 3 is made of a semiconductor such as flash memory or EEPROM, and includes a data area 3.1 and protect information areas 3.2 and 3.3 divided into a plurality of blocks.

データ領域3.1は、ブロック1,2,・・・,M,・・・,Nに分割されており、それぞれデータ1,2,・・・,M,・・・,Nが格納される。  The data area 3.1 is divided intoblocks 1, 2,..., M,..., N, andstores data 1, 2,. .

プロテクト情報領域3.2は、データ領域3.1におけるブロックに対応するように分割されており、データ領域のそれぞれのブロックに対する全体プロテクト設定が格納される。実施の形態3におけるプロテクト情報領域3.2には、それぞれ1ビットからなる全体保護フラグ1a,2a,・・・,Ma,・・・,Naが格納され、このフラグ値(「0」または「1」)に応じて、データ領域3.1のそれぞれのブロックに対する全体プロテクト設定の有無が判断される。  The protect information area 3.2 is divided so as to correspond to the blocks in the data area 3.1, and the entire protect setting for each block in the data area is stored. In the protect information area 3.2 in the third embodiment, overall protection flags 1a, 2a,..., Ma,..., Na each consisting of 1 bit are stored, and this flag value (“0” or “ 1 "), it is determined whether or not there is an overall protection setting for each block in the data area 3.1.

プロテクト情報領域3.3は、データ領域3.1に含まれるブロックのうち所定のブロックに対応するように配置されており、その所定のブロックに対する部分プロテクト設定が格納される。実施の形態3におけるプロテクト情報領域3.3には、データ領域3.1に含まれるブロック1,2,・・・,M,・・・,Nのうち、ブロックMに対する部分保護フラグMbが格納され、このフラグ値(「0」または「1」)に応じて、ブロックMに対する部分プロテクト設定の有無が判断される。  The protect information area 3.3 is arranged so as to correspond to a predetermined block among the blocks included in the data area 3.1, and stores a partial protect setting for the predetermined block. In the protect information area 3.3 in the third embodiment, the partial protection flag Mb for the block M among theblocks 1, 2,..., M,. Whether or not partial protection is set for the block M is determined according to the flag value (“0” or “1”).

読出部32は、不揮発性メモリ3のプロテクト情報領域3.2および3.3に格納されている全体保護フラグ1a,2a,・・・,Ma,・・・,Naおよび部分保護フラグMbを読出し、制御部30へ出力する。そして、読出部32は、読出回路36と、読出レジスタ18および28とからなる。  Thereading unit 32 reads the overall protection flags 1a, 2a, ..., Ma, ..., Na and the partial protection flag Mb stored in the protection information areas 3.2 and 3.3 of thenonvolatile memory 3. To thecontrol unit 30. Theread unit 32 includes a readcircuit 36 and readregisters 18 and 28.

読出回路36は、外部からのリセット信号や電源部97からの投入信号を受けて、プロテクト情報領域3.2に格納されている全体保護フラグ1a,2a,・・・,Naを読出して読出レジスタ18へ出力し、プロテクト情報領域3.3に格納されている部分保護フラグMbを読出して読出レジスタ28へ出力する。  Theread circuit 36 receives the reset signal from the outside and the input signal from thepower supply unit 97, and reads the overall protection flags 1a, 2a,..., Na stored in the protection information area 3.2 to read the read register. 18 to read the partial protection flag Mb stored in the protection information area 3.3 and output it to theread register 28.

読出レジスタ18は、実施の形態1と同様であるので詳細な説明は省略する。また、読出レジスタ28は、実施の形態2と同様であるので詳細な説明は省略する。  Since theread register 18 is the same as that of the first embodiment, detailed description thereof is omitted. Further, theread register 28 is the same as that of the second embodiment, and thus detailed description thereof is omitted.

制御部30は、優先回路(優先回路M)34と、OR回路35および38と、起動モード判断部(判断部a)14と、アクセスモード判断部(判断部b)24と、制御回路31とからなる。  Thecontrol unit 30 includes a priority circuit (priority circuit M) 34, ORcircuits 35 and 38, a startup mode determination unit (determination unit a) 14, an access mode determination unit (determination unit b) 24, acontrol circuit 31, Consists of.

優先回路34は、後述するように、ブロックMに対して全体プロテクトおよび部分プロテクトが同時に設定された場合に生じる問題を回避するため、部分プロテクトを全体プロテクトに優先させるための回路である。そして、優先回路34は、データ領域3.1のブロックMに対して設定される全体保護フラグMaおよび部分保護フラグMbを受けて、部分保護フラグMbによる設定を優先する。すなわち、優先回路34は、読出レジスタ18から受けた全体保護フラグMaと読出レジスタ28から受けた部分保護フラグMbとの論理演算を行ない、部分保護フラグMbにより部分プロテクトが設定されていれば、全体保護フラグMaのプロテクト設定を無視して、全体プロテクト設定の解除を示す値をOR回路35へ出力する。  As will be described later, thepriority circuit 34 is a circuit for giving priority to the partial protection over the whole protection in order to avoid a problem that occurs when the whole protection and the partial protection are simultaneously set for the block M. Thepriority circuit 34 receives the overall protection flag Ma and the partial protection flag Mb set for the block M in the data area 3.1, and gives priority to the setting by the partial protection flag Mb. That is, thepriority circuit 34 performs a logical operation on the overall protection flag Ma received from the readregister 18 and the partial protection flag Mb received from the readregister 28, and if the partial protection is set by the partial protection flag Mb, The protection setting of the protection flag Ma is ignored, and a value indicating cancellation of the overall protection setting is output to theOR circuit 35.

OR回路35は、読出レジスタ18から受けた全体保護フラグ1a,2a,・・・,Na(Maを除く)および優先回路34から受けた値で論理和(OR)演算を行ない、全体保護フラグ1a,2a,・・・,Na(Maを除く)および優先回路34から受けた値のうちいずれか1つでも全体プロテクトの設定を示す値であれば、起動モード判断部14へ「ON」を出力する。  The ORcircuit 35 performs a logical sum (OR) operation with the total protection flags 1a, 2a,..., Na (excluding Ma) received from the readregister 18 and the value received from thepriority circuit 34, and the total protection flag 1a. , 2a,..., Na (excluding Ma) and any one of the values received from thepriority circuit 34, if the value indicates the setting of the overall protection, “ON” is output to the activationmode determination unit 14 To do.

起動モード判断部14は、実施の形態1と同様であるので、詳細な説明は繰返さない。また、アクセスモード判断部24は、実施の形態2と同様であるので、詳細な説明は繰返さない。  Since startupmode determination unit 14 is the same as that of the first embodiment, detailed description thereof will not be repeated. Since accessmode determination unit 24 is the same as that of the second embodiment, detailed description will not be repeated.

OR回路38は、起動モード判断部14およびアクセスモード判断部24から出力されるプロテクト制御信号を結合し、制御回路31へ出力する。  The ORcircuit 38 combines the protection control signals output from the activationmode determination unit 14 and the accessmode determination unit 24 and outputs the combined signal to thecontrol circuit 31.

制御回路31は、データバスを介して、データ領域3.1のいずれかのブロックに対する全体プロテクトの設定解除の要求を受けると、当該ブロックに格納されているデータを消去し、そのデータが消去されたことを確認した後に、プロテクト情報領域3.2に格納されている当該ブロックに対応する全体保護フラグの値を変更し、全体プロテクトの設定を解除する。また、制御回路31は、データバスを介して、データ領域3.1のブロックMに対する部分プロテクトの設定解除の要求を受けると、ブロックMに格納されているデータを消去し、そのデータが消去されたことを確認した後に、プロテクト情報領域3.3に格納されている部分保護フラグMbの値を変更し、部分プロテクトの設定を解除する。なお、制御回路31は、全体プロテクトおよび部分プロテクトを互いに独立に扱うので、たとえば、ブロックMに対する全体プロテクトの設定解除の要求を受けると、格納されているデータを消去した後にブロックMに対する全体保護フラグMaの値を変更するが、部分保護フラグMbの値を変更することはない。そのため、全体プロテクトおよび部分プロテクトのいずれもが設定されている場合には、それぞれに対してプロテクト設定を解除する必要がある。  When thecontrol circuit 31 receives a request to cancel the overall protection setting for any block in the data area 3.1 via the data bus, thecontrol circuit 31 erases the data stored in the block, and the data is erased. After confirming this, the value of the overall protection flag corresponding to the block stored in the protection information area 3.2 is changed to release the overall protection setting. When thecontrol circuit 31 receives a request to cancel the partial protection setting for the block M in the data area 3.1 via the data bus, thecontrol circuit 31 erases the data stored in the block M, and the data is erased. After confirming this, the value of the partial protection flag Mb stored in the protection information area 3.3 is changed to cancel the setting of partial protection. Since thecontrol circuit 31 handles the overall protection and the partial protection independently of each other, for example, when a request for releasing the setting of the overall protection for the block M is received, the entire protection flag for the block M is erased after erasing stored data. Although the value of Ma is changed, the value of the partial protection flag Mb is not changed. Therefore, when both the overall protection and the partial protection are set, it is necessary to cancel the protection setting for each.

また、制御回路31は、データバスを介して、データ領域3.1のいずれかのブロックに対するアクセスの要求を受けると、OR回路38からアクセスを禁止するプロテクト制御信号を受けているか否かを判断する。そして、制御回路31は、アクセスを禁止するプロテクト制御信号を受けていなければ、そのアクセスを許可し、その要求先のブロックに格納されているデータを読出し、またはその要求先のブロックへデータを書込む。  When thecontrol circuit 31 receives a request for access to any block in the data area 3.1 via the data bus, thecontrol circuit 31 determines whether a protection control signal for prohibiting access is received from theOR circuit 38. To do. If thecontrol circuit 31 has not received a protect control signal for prohibiting access, thecontrol circuit 31 permits the access and reads the data stored in the requested block or writes the data to the requested block. Include.

さらに、制御回路31は、データバスを介して、データ領域3.1のいずれかのブロックに対する全体プロテクトの設定要求を受けると、プロテクト情報領域3.2に格納されている当該ブロックに対応する全体保護フラグの値を変更し、全体プロテクトを設定する。また、制御回路31は、データバスを介して、データ領域3.1のブロックMに対する部分プロテクトの設定要求を受けると、プロテクト情報領域3.3に格納されている部分保護フラグMbの値を変更し、部分プロテクトを設定する。  Further, when thecontrol circuit 31 receives a request for setting the overall protection for any block in the data area 3.1 via the data bus, theentire control circuit 31 corresponds to the block stored in the protection information area 3.2. Change the value of the protection flag and set the overall protection. When thecontrol circuit 31 receives a partial protection setting request for the block M in the data area 3.1 via the data bus, thecontrol circuit 31 changes the value of the partial protection flag Mb stored in the protection information area 3.3. And set partial protection.

電源部97については、実施の形態1と同様であるので、詳細な説明は繰返さない。
(プロテクト設定)
データ領域3.1に対して全体プロテクトおよび部分プロテクトのいずれも設定されていない状態において、CPU92または外部からプロテクト対象のデータが転送されると、制御回路31は、転送されたデータを所定のブロックに書込む。さらに、CPU92または外部から当該データに対する全体プロテクトまたは部分プロテクトの設定が要求されると、制御回路31は、データを格納したブロックに対応する全体保護フラグ1a,2a,・・・,Ma,・・・,Naまたは部分保護フラグMbの値を変更し、プロテクト設定を行なう。なお、制御回路31は、全体プロテクト要求または部分プロテクト要求を受けて、互いに独立にプロテクトを設定する。
Sincepower supply unit 97 is similar to that of the first embodiment, detailed description thereof will not be repeated.
(Protect setting)
When the data to be protected is transferred from theCPU 92 or the outside in a state where neither full protection nor partial protection is set for the data area 3.1, thecontrol circuit 31 transfers the transferred data to a predetermined block. Write to. Further, when theCPU 92 or the outside requests the setting of the entire protection or the partial protection for the data, thecontrol circuit 31 causes the entire protection flags 1a, 2a,..., Ma,. • Change the value of Na or the partial protection flag Mb to set protection. Thecontrol circuit 31 receives the entire protection request or the partial protection request and sets protection independently of each other.

したがって、制御回路31は、全体保護フラグ1a,2a,・・・,Ma,・・・,Naのうちいずれかのフラグにおいて全体プロテクトが設定されていれば、CPU92がマイコン内蔵メモリプログラム起動モードである場合を除いて、すべてのブロックへのアクセスを禁止する。  Therefore, if the overall protection is set in any of the overall protection flags 1a, 2a,..., Ma,. Access to all blocks is prohibited except in certain cases.

さらに、制御回路31は、部分保護フラグMbにおいて部分プロテクトが設定されていれば、CPU92がマイコン内蔵メモリプログラム起動モードであっても、ブロックMへのアクセスを禁止する。そして、制御回路31は、CPU92がマイコン内蔵メモリプログラム起動モードであり、かつ、命令フェッチにより命令コードを読出すためのアクセスである場合に限りブロックMへのアクセスを許可する。  Furthermore, if partial protection is set in the partial protection flag Mb, thecontrol circuit 31 prohibits access to the block M even when theCPU 92 is in the microcomputer built-in memory program activation mode. Thecontrol circuit 31 permits access to the block M only when theCPU 92 is in the microcomputer built-in memory program start mode and access is for reading an instruction code by instruction fetch.

(プロテクト解除)
CPU92または外部からデータ領域3.1のいずれかのブロックに対する全体プロテクトまたは部分プロテクトの設定解除が要求されると、制御回路31は、指定されたブロックに格納されているデータを消去する。そして、制御回路31は、消去ベリファイ動作などにより、格納されているデータの消去が完了したことを確認した後、そのブロックに対応する全体保護フラグまたは部分保護フラグの値を変更し、当該ブロックのプロテクト設定を解除する。なお、制御回路31は、全体プロテクトの解除要求または部分プロテクトの解除要求を受けて、互いに独立にプロテクト設定を解除する。
(Unprotect)
When theCPU 92 or the outside requests the setting of the entire protection or the partial protection for any block in the data area 3.1, thecontrol circuit 31 erases the data stored in the designated block. Then, after confirming that the stored data has been erased by an erase verify operation or the like, thecontrol circuit 31 changes the value of the overall protection flag or the partial protection flag corresponding to the block, and Cancel the protection setting. Thecontrol circuit 31 releases the protection setting independently of each other in response to the request for releasing the entire protection or the request for releasing the partial protection.

したがって、ブロックMに対して全体プロテクトおよび部分プロテクトが設定されていれば、これらのプロテクトを解除するためには、それぞれのプロテクトに対する解除要求を制御回路31へ与える必要がある。  Therefore, if full protection and partial protection are set for the block M, a release request for each protection must be given to thecontrol circuit 31 in order to release these protections.

(優先回路)
上述したように、全体プロテクトは、IPベンダまたはプログラム製作者がエンドユーザに対するプロテクトを設定するための機能である。一方、部分プロテクトは、IPベンダがプログラム製作者およびエンドユーザに対するプロテクトを設定するための機能である。すなわち、通常の流通過程においては、IPベンダが、自身のライブラリソフトウェアに対して部分プロテクトを設定し、その後、プログラム製作者が、自身の製作したプログラムに対して全体プロテクトを設定する。そして、エンドユーザへ提供されることになる。
(Priority circuit)
As described above, the overall protection is a function for setting protection for an end user by an IP vendor or a program producer. On the other hand, the partial protection is a function for the IP vendor to set protection for the program producer and the end user. That is, in the normal distribution process, the IP vendor sets partial protection for its own library software, and then the program producer sets overall protection for the program that it produces. And it will be provided to the end user.

ところで、プログラム製作者が、自己の製作したプログラムをブロックM以外のブロックに格納した後、ブロックMに対して全体プロテクトを設定してしまった場合を考えると、不揮発性メモリ3のデータ領域3.1に格納されているプログラムを更新するためには、ブロックMに対する全体プロテクト設定を解除する必要がある。上述したように、プロテクト設定を解除するためには、そのブロックに格納されているデータを消去する必要があるため、ブロックMに対する全体プロテクト設定の解除は、ブロックMに格納されているソフトウェアライブラリの消去を意味する。すなわち、プログラム製作者は、自己の製作したプログラムを更新するために、IPベンダに対してライブラリソフトウェアの再提供を求めるという不合理な状況が生じる。  By the way, when the program producer stores the program he / she has created in a block other than the block M and then sets the overall protection for the block M, thedata area 3. In order to update the program stored in 1, it is necessary to cancel the overall protection setting for the block M. As described above, in order to cancel the protection setting, it is necessary to erase the data stored in the block. Therefore, the cancellation of the entire protection setting for the block M is performed by the software library stored in the block M. Means erasure. In other words, an unreasonable situation occurs in which the program creator requests the IP vendor to re-provide the library software in order to update the program produced by the program creator.

そこで、優先回路34は、ライブラリソフトウェアが格納されるブロックMに対して、全体プロテクト設定を無効にする。すなわち、優先回路34は、ブロックMに対して部分プロテクトが設定されていれば、同時に全体プロテクトが設定されていても、全体プロテクトが設定されていないとみなす。  Therefore, thepriority circuit 34 invalidates the overall protection setting for the block M in which the library software is stored. That is, if the partial protection is set for the block M, thepriority circuit 34 regards that the overall protection is not set even if the overall protection is set at the same time.

よって、プログラム製作者が、誤って、ライブラリソフトウェアが格納されているブロックに対して全体プロテクトを設定したとしても、ライブラリソフトウェアを消去することなく、プログラムの更新が可能となる。  Therefore, even if the program producer mistakenly sets the overall protection for the block in which the library software is stored, the program can be updated without deleting the library software.

なお、優先回路34は、あくまでも、プログラム製作者などのミスを補うものであり、必須の構成要件ではないが、どのような状況においても不合理な状況を生じさせないために、配置することが望ましい。  It should be noted that thepriority circuit 34 compensates for mistakes by a program producer and the like, and is not an essential constituent element, but is preferably arranged in order not to cause an unreasonable situation in any situation. .

この発明の実施の形態3によれば、データ領域の全体プロテクト設定を解除する場合には、ブロック単位でデータ消去および全体保護フラグ値の変更が行なわれる。そのため、すべてのブロックを一括で消去する場合に比較して、効率的にデータ消去が行なえるので、処理速度の低下を抑制できる。一方、データ領域の全体プロテクト設定を解除するためには、すべてのブロックに対する全体プロテクト設定を解除しなければならない。よって、全体プロテクト設定を解除するためには、すべてのブロックに格納されているデータを消去する必要があり、高いデータ機密保護機能を実現できる。また、部分プロテクトが設定されているブロックに対してのアクセスは許可されず、かつ、部分プロテクト設定を解除する場合には、当該ブロックに格納されているデータは必ず消去される。例外的に、CPUがデータ領域に格納されているライブラリソフトウェアなどの処理コードを読出して処理する場合に限り、部分保護フラグにかかわらずアクセスが許可される。よって、命令コード自体の漏洩を防止し、かつ、CPUによるサブルーチンコールを制限なく実行させることができる。  According to the third embodiment of the present invention, when the entire protection setting of the data area is canceled, the data erasure and the entire protection flag value are changed in units of blocks. Therefore, data can be erased more efficiently than when all the blocks are erased at once, so that a reduction in processing speed can be suppressed. On the other hand, in order to cancel the overall protection setting of the data area, it is necessary to cancel the overall protection setting for all blocks. Therefore, in order to cancel the overall protection setting, it is necessary to erase data stored in all blocks, and a high data security protection function can be realized. Also, access to a block for which partial protection is set is not permitted, and when the partial protection setting is canceled, the data stored in the block is always erased. Exceptionally, access is permitted regardless of the partial protection flag only when the CPU reads and processes a processing code such as library software stored in the data area. Therefore, leakage of the instruction code itself can be prevented, and subroutine calls by the CPU can be executed without restriction.

また、この発明の実施の形態3によれば、同一のブロックに対して、全体プロテクトおよび部分プロテクトが設定されている場合には、部分プロテクトが優先し、全体プロテクトは無視される。そのため、既に、部分プロテクトが設定されているブロックに対して、誤って全体プロテクトを設定してしまった場合においても、当該ブロックに格納されているデータを消去することなく、全体プロテクトの設定を解除してデータの更新を行なうことができる。  Further, according to the third embodiment of the present invention, when the whole protection and the partial protection are set for the same block, the partial protection has priority and the whole protection is ignored. For this reason, even if the entire protection is set accidentally for a block that has already been partially protected, the entire protection setting is canceled without erasing the data stored in the block. The data can be updated.

[実施の形態4]
実施の形態1〜3においては、それぞれ1ビットからなる全体保護フラグまたは部分保護フラグによりプロテクトを設定する場合について説明した。
[Embodiment 4]
In the first to third embodiments, the case where the protection is set by the whole protection flag or the partial protection flag each consisting of 1 bit has been described.

一方、実施の形態4では、複数のビットからなる全体保護フラグまたは部分保護フラグを用いる場合について説明する。なお、実施の形態4においては、実施の形態3に示す半導体装置103に適用した例について説明する。  On the other hand, in the fourth embodiment, a case where an entire protection flag or a partial protection flag composed of a plurality of bits is used will be described. Note that inEmbodiment 4, an example applied to thesemiconductor device 103 described inEmbodiment 3 will be described.

図5は、実施の形態4に従う半導体装置104の概略構成図である。
図5を参照して、半導体装置104は、データバス98と、CPU92と、不揮発性メモリ4と、読出部42と、制御部40と、電源部97とからなる。
FIG. 5 is a schematic configuration diagram ofsemiconductor device 104 according to the fourth embodiment.
Referring to FIG. 5, thesemiconductor device 104 includes adata bus 98, aCPU 92, anonvolatile memory 4, areading unit 42, acontrol unit 40, and apower supply unit 97.

データバス98は、CPU92、制御部40、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 92, thecontrol unit 40, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU92については、実施の形態3と同様であるので、詳細な説明は繰返さない。
不揮発性メモリ4は、複数のブロックに分割されたデータ領域4.1とプロテクト情報領域4.2および4.3とを含む。
SinceCPU 92 is similar to that of the third embodiment, detailed description thereof will not be repeated.
Thenonvolatile memory 4 includes a data area 4.1 divided into a plurality of blocks and protect information areas 4.2 and 4.3.

データ領域4.1は、ブロック1,2,・・・,M,・・・,Nに分割されており、それぞれデータ1,2,・・・,M,・・・,Nが格納される。  The data area 4.1 is divided intoblocks 1, 2,..., M,..., N, andstores data 1, 2,. .

プロテクト情報領域4.2は、データ領域4.1におけるブロックに対応するように分割されており、データ領域のそれぞれのブロックに対する全体プロテクト設定が格納される。実施の形態4におけるプロテクト情報領域4.2には、たとえば、それぞれ2ビットからなる全体保護フラグ1a’,2a’,・・・,Ma’,・・・,Na’が格納され、このフラグ値(「00」または「11」)に応じて、データ領域4.1のそれぞれのブロックに対する全体プロテクト設定の有無が判断される。  The protect information area 4.2 is divided so as to correspond to the blocks in the data area 4.1, and the entire protect setting for each block in the data area is stored. In the protection information area 4.2 in the fourth embodiment, for example, overall protection flags 1a ′, 2a ′,..., Ma ′,. In accordance with (“00” or “11”), it is determined whether or not the overall protection is set for each block in the data area 4.1.

プロテクト情報領域4.3は、データ領域4.1に含まれるブロックのうちブロックMに対する部分プロテクト設定が格納される。実施の形態4におけるプロテクト情報領域4.3には、2ビットからなる部分保護フラグMb’が格納され、このフラグ値(「00」または「11」)に応じて、ブロックMに対する部分プロテクト設定の有無が判断される。  The protect information area 4.3 stores partial protection settings for the block M among the blocks included in the data area 4.1. In the protect information area 4.3 in the fourth embodiment, a 2-bit partial protection flag Mb ′ is stored, and the partial protection setting for the block M is set according to this flag value (“00” or “11”). Presence or absence is determined.

読出部42は、不揮発性メモリ4のプロテクト情報領域4.2および4.3に格納されている全体保護フラグ1a’,2a’,・・・,Na’および部分保護フラグMb’を読出し、制御部40へ出力する。そして、読出部42は、読出回路46と、読出レジスタ48および47とからなる。  Thereading unit 42 reads and controls the overall protection flags 1a ′, 2a ′,..., Na ′ and the partial protection flag Mb ′ stored in the protection information areas 4.2 and 4.3 of thenonvolatile memory 4. To theunit 40. Theread unit 42 includes a read circuit 46 and readregisters 48 and 47.

読出回路46は、外部からのリセット信号や電源部97からの投入信号を受けて、プロテクト情報領域4.2に格納されている全体保護フラグ1a’,2a’,・・・,Ma’,・・・,Na’を読出し、ビット単位で読出レジスタ48へ出力する。同時に、読出回路46は、プロテクト情報領域4.3に格納されている部分保護フラグMb’を読出し、ビット単位で読出レジスタ47へ出力する。  The read circuit 46 receives the reset signal from the outside and the input signal from thepower supply unit 97, and receives the entire protection flags 1a ′, 2a ′,..., Ma ′,. .., Na ′ is read and output to theread register 48 in bit units. At the same time, the read circuit 46 reads the partial protection flag Mb ′ stored in the protect information area 4.3 and outputs it to theread register 47 in bit units.

読出レジスタ48は、全体保護フラグ1a’,2a’,・・・,Ma’,・・・,Na’のそれぞれをビット単位で一旦格納し、それぞれのビットの値を制御部40へ出力する。  The read register 48 temporarily stores each of the overall protection flags 1a ', 2a', ..., Ma ', ..., Na' in bit units, and outputs the value of each bit to thecontrol unit 40.

読出レジスタ47は、部分保護フラグMb’をビット単位で一旦格納し、各ビットの値を制御部40へ出力する。  The read register 47 temporarily stores the partial protection flag Mb ′ in units of bits and outputs the value of each bit to thecontrol unit 40.

制御部40は、実施の形態3における制御部30にOR回路43.1,43.2,・・・,43.M,・・・,43.Nおよび44を追加したものと同様である。  Thecontrol unit 40 adds OR circuits 43.1, 43.2,..., 43. to thecontrol unit 30 in the third embodiment. M, ..., 43. It is the same as that to which N and 44 are added.

OR回路43.1は、読出レジスタ48に格納されている全体保護フラグ1a’の0ビット目の値1a’(0)および1ビット目の値1a’(1)を読出し、論理和(OR)演算を行なう。そして、OR回路43.1は、その論理和演算の結果をOR回路35へ出力する。すなわち、OR回路43.1は、全体保護フラグ1a’の0ビット目の値1a’(0)または1ビット目の値1a’(1)のうち、どちらかのビットがプロテクトを設定する値となっていれば、プロテクトが設定されていると判断する。  The OR circuit 43.1 reads the value 1a '(0) of the 0th bit and the value 1a' (1) of the 1st bit of the overall protection flag 1a 'stored in theread register 48, and performs a logical sum (OR). Perform the operation. Then, the OR circuit 43.1 outputs the result of the logical sum operation to theOR circuit 35. That is, the OR circuit 43.1 determines whether one of the 0th bit value 1a '(0) or the first bit value 1a' (1) of the overall protection flag 1a 'is set to protect. If so, it is determined that protection is set.

以下同様に、OR回路43.2,・・・,43.M,・・・,43.Nは、それぞれ全体保護フラグ2a’,・・・,Ma’,・・・,Na’の0ビット目の値2a’(0),・・・,Ma’(0),・・・,Na’(0)および1ビット目の値2a’(1),・・・,Ma’(1),・・・,Na’(1)を読出し、論理和(OR)演算を行なう。そして、OR回路43.2,・・・,43.M,・・・,43.Nは、それぞれ論理和演算の結果をOR回路35へ出力する。  Similarly, the OR circuits 43.2,. M, ..., 43. N is the value 2a ′ (0),..., Ma ′ (0),..., Na of the 0th bit of the overall protection flags 2a ′,. '(0) and 1st bit values 2a' (1), ..., Ma '(1), ..., Na' (1) are read out, and a logical sum (OR) operation is performed. Then, OR circuits 43.2,. M, ..., 43. N outputs the result of the OR operation to theOR circuit 35, respectively.

制御回路41は、データバスを介して、データ領域4.1のいずれかのブロックに対する全体プロテクトの設定要求を受けると、プロテクト情報領域4.2に格納されている当該ブロックに対応する全体保護フラグを構成するすべてのビットを同値に変更し、プロテクトを設定する。また、制御回路41は、データバスを介して、データ領域4.1のブロックMに対するプロテクトの設定要求を受けると、プロテクト情報領域4.3に格納されている部分保護フラグMbを構成するすべてのビットを同値に変更し、プロテクトを設定する。また、制御回路41は、プロテクトの設定解除の要求を受けると、プロテクトを設定する場合と同様に、プロテクト情報領域4.2に格納されている全体保護フラグまたはプロテクト情報領域4.3に格納されている部分保護フラグMbを構成するすべてのビットを同値に変更し、プロテクトを解除する。すなわち、制御回路41は、プロテクトの設定または解除に応じて、「00」または「11」を書込む。  When thecontrol circuit 41 receives an overall protection setting request for any block in the data area 4.1 via the data bus, the overall protection flag corresponding to the block stored in the protection information area 4.2. Change all bits that make up the same value to set protection. When thecontrol circuit 41 receives a protection setting request for the block M in the data area 4.1 via the data bus, thecontrol circuit 41 sets all the partial protection flags Mb stored in the protection information area 4.3. Change the bit to the same value and set protection. Further, when thecontrol circuit 41 receives a request to cancel the protection setting, thecontrol circuit 41 stores the entire protection flag stored in the protection information area 4.2 or the protection information area 4.3 as in the case of setting protection. All bits constituting the partial protection flag Mb are changed to the same value, and the protection is released. That is, thecontrol circuit 41 writes “00” or “11” according to the protection setting or cancellation.

なお、制御回路41の他の処理については、実施の形態3における制御回路31と同様であるので、詳細な説明は繰返さない。  Since other processes ofcontrol circuit 41 are similar to those ofcontrol circuit 31 in the third embodiment, detailed description thereof will not be repeated.

以下、優先回路34、OR回路35および38、起動モード判断部(判断部a)14ならびにアクセスモード判断部(判断部b)24については、実施の形態3と同様であるので、詳細な説明は繰返さない。  Hereinafter, thepriority circuit 34, theOR circuits 35 and 38, the activation mode determination unit (determination unit a) 14 and the access mode determination unit (determination unit b) 24 are the same as those in the third embodiment, and thus detailed description thereof will be given. Do not repeat.

電源部97については、実施の形態3と同様であるので、詳細な説明は繰返さない。
上述のように、制御回路41は、フラグを構成する複数のビットを同値に変更して、プロテクトを設定する。そのため、フラグを構成するビットが何らかの原因で揮発した場合にも、プロテクト設定を維持できる。
Sincepower supply unit 97 is similar to that of the third embodiment, detailed description thereof will not be repeated.
As described above, thecontrol circuit 41 sets the protection by changing a plurality of bits constituting the flag to the same value. Therefore, even when the bits constituting the flag are volatilized for some reason, the protection setting can be maintained.

たとえば、プロテクトの設定を示すフラグ値を「1」とした場合において、制御回路41は、ブロック1に対する全体プロテクトの設定要求を受けると、全体保護フラグ1a’の0ビット目の値1a’(0)および1ビット目の値1a’(1)をいずれも「1」に変更する。同様に、制御回路41は、ブロック1に対する全体プロテクトの設定解除の要求を受けると、ブロック1に格納されているデータを消去した後、全体保護フラグ1a’の0ビット目の値1a’(0)および1ビット目の値1a’(1)をいずれも「0」に変更する。すなわち、制御回路41は、プロテクトの設定要求を受けると、保護フラグの値を「11」に変更し、プロテクトの設定解除の要求を受けると、保護フラグの値を「00」に変更する。  For example, when the flag value indicating the protection setting is “1”, thecontrol circuit 41 receives the overall protection setting request for theblock 1, and the value 1a ′ (0 of the 0th bit of the overall protection flag 1a ′. ) And the value 1a ′ (1) of the first bit are both changed to “1”. Similarly, when thecontrol circuit 41 receives a request to cancel the setting of the overall protection for theblock 1, thecontrol circuit 41 erases the data stored in theblock 1 and then the value 1a ′ (0 of the 0th bit of the overall protection flag 1a ′. ) And the value 1a ′ (1) of the first bit are both changed to “0”. That is, thecontrol circuit 41 changes the value of the protection flag to “11” when receiving a protection setting request, and changes the value of the protection flag to “00” when receiving a request to cancel the protection setting.

さらに、ブロック1に対する全体プロテクトが設定された状態、すなわち全体保護フラグ1a’の値が「11」に変更された場合において、何らかの原因により1ビット分のデータが揮発して「10」に変化したとすると、OR回路43.1に与えられる値は、「1」,「1」から「1」,「0」に変化する。しかしながら、OR回路43.1から出力される値は「1」のまま維持されるので、全体プロテクト設定が解除されることはない。  Further, when the overall protection for theblock 1 is set, that is, when the value of the overall protection flag 1a ′ is changed to “11”, the data for 1 bit is volatilized and changed to “10” for some reason. Then, the value given to the OR circuit 43.1 changes from “1” and “1” to “1” and “0”. However, since the value output from the OR circuit 43.1 is maintained at “1”, the overall protection setting is not canceled.

よって、保護フラグを構成するビットが何らかの原因で揮発したとしても、誤ってプロテクトの設定が解除されることを回避できる。なお、上述の説明から明らかなように、保護フラグをより多くのビットで構成することで、プロテクト機能をより強化することができる。  Therefore, even if the bits constituting the protection flag are volatilized for some reason, it is possible to prevent the protection setting from being canceled by mistake. As apparent from the above description, the protection function can be further strengthened by configuring the protection flag with more bits.

なお、実施の形態4においては、実施の形態1における全体プロテクト機能および実施の形態2における部分プロテクト機能を同時に実現する実施の形態3に従う半導体装置に適応した場合について説明したが、実施の形態1に従う半導体装置および実施の形態2に従う半導体装置のいずれに対しても同様に適応できることは言うまでもない。  In the fourth embodiment, the case where the present invention is applied to the semiconductor device according to the third embodiment that simultaneously realizes the overall protection function in the first embodiment and the partial protection function in the second embodiment has been described. Needless to say, the present invention can be similarly applied to both the semiconductor device according to the first embodiment and the semiconductor device according to the second embodiment.

実施の形態4によれば、実施の形態3における効果に加えて、全体プロテクト設定または部分プロテクト設定を行なうための全体保護フラグまたは部分フラグが何らかの原因で揮発したとしても、それらを構成するすべてのビットの値が変化しなければ、その保護フラグにより設定されるプロテクトが解除されることはない。よって、1つのビットからなる保護フラグを用いる場合に比較して、プロテクト機能をより強化した半導体装置を実現できる。  According to the fourth embodiment, in addition to the effects of the third embodiment, even if the whole protection flag or the partial flag for performing the whole protection setting or the partial protection setting is volatilized for some reason, all of the components constituting them are configured. If the value of the bit does not change, the protection set by the protection flag is not released. Therefore, a semiconductor device with a further enhanced protection function can be realized as compared with the case where a protection flag composed of one bit is used.

[実施の形態5]
実施の形態2〜4においては、データ領域を構成する複数ブロックのうち1つのブロックに対して部分プロテクトを設定する場合について説明した。
[Embodiment 5]
In the second to fourth embodiments, the case where partial protection is set for one block among a plurality of blocks constituting the data area has been described.

一方、実施の形態5では、複数のブロックに対して一体的に部分プロテクトを設定する場合について説明する。なお、実施の形態5においては、実施の形態4に示す半導体装置104に適用した例について説明する。  On the other hand, in the fifth embodiment, a case where partial protection is integrally set for a plurality of blocks will be described. Note that inEmbodiment 5, an example in which the present invention is applied to thesemiconductor device 104 described inEmbodiment 4 will be described.

不揮発性メモリに格納されるライブラリソフトウェアの容量が大きく、1つのブロックに収まらない場合には、複数のブロックにまたがって格納される。このような場合において、ライブラリソフトウェアは、単一的に取り扱われることが望ましい。そこで、複数のブロックを1つのブロックとみなして一体的に部分プロテクトを設定できる機能が必要となる。  When the capacity of the library software stored in the nonvolatile memory is large and does not fit in one block, it is stored across a plurality of blocks. In such a case, it is desirable that the library software is handled as a single unit. Therefore, it is necessary to have a function capable of setting partial protection integrally by regarding a plurality of blocks as one block.

図6は、実施の形態5に従う半導体装置105の概略構成図である。
図6を参照して、半導体装置105は、データバス98と、CPU92と、不揮発性メモリ5と、読出部52と、制御部50と、電源部97とからなる。
FIG. 6 is a schematic configuration diagram ofsemiconductor device 105 according to the fifth embodiment.
Referring to FIG. 6, thesemiconductor device 105 includes adata bus 98, aCPU 92, anonvolatile memory 5, areading unit 52, acontrol unit 50, and apower supply unit 97.

データバス98は、CPU92、制御部50、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 92, thecontrol unit 50, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU92については、実施の形態4と同様であるので、詳細な説明は繰返さない。
不揮発性メモリ5は、複数のブロックに分割されたデータ領域5.1とプロテクト情報領域5.2および5.3とを含む。
SinceCPU 92 is similar to that of the fourth embodiment, detailed description thereof will not be repeated.
Nonvolatile memory 5 includes a data area 5.1 divided into a plurality of blocks and protect information areas 5.2 and 5.3.

データ領域5.1は、ブロック1,2,・・・,L,M,・・・,Nに分割されており、それぞれデータ1,2,・・・,L,M,・・・,Nが格納される。  The data area 5.1 is divided intoblocks 1, 2,..., L, M,..., N, anddata 1, 2,. Is stored.

プロテクト情報領域5.2は、データ領域5.1におけるブロックに対応するように分割されており、それぞれ全体保護フラグ1a’,2a’,・・・,La’,Ma’,・・・,Na’が格納される。  The protect information area 5.2 is divided so as to correspond to the blocks in the data area 5.1, and the overall protection flags 1a ′, 2a ′,..., La ′, Ma ′,. 'Is stored.

プロテクト情報領域5.3は、データ領域5.1を構成するブロックのうち複数のブロックに対する部分プロテクトを設定するための部分保護フラグを格納する。実施の形態5においては、たとえば、ブロックLおよびMに対して部分プロテクトを設定するための部分保護フラグLb’およびMb’が格納される。  The protect information area 5.3 stores a partial protection flag for setting partial protection for a plurality of blocks among the blocks constituting the data area 5.1. In the fifth embodiment, for example, partial protection flags Lb 'and Mb' for setting partial protection for blocks L and M are stored.

なお、実施の形態4と同様に、全体保護フラグ1a’,2a’,・・・,La’,Ma’,・・・,Na’および部分保護フラグLb’,Mb’は、それぞれ2ビットで構成される。  As in the fourth embodiment, the overall protection flags 1a ', 2a', ..., La ', Ma', ..., Na 'and the partial protection flags Lb', Mb 'are each 2 bits. Composed.

読出部52は、不揮発性メモリ5のプロテクト情報領域5.2および5.3に格納されている全体保護フラグ1a’,2a’,・・・,La’,Ma’,・・・,Na’およびに部分保護フラグLb’,Mb’を読出し、制御部50へ出力する。そして、読出部52は、読出回路56と、読出レジスタ58および57とからなる。  Thereading unit 52 reads the entire protection flags 1a ′, 2a ′,..., La ′, Ma ′,..., Na ′ stored in the protection information areas 5.2 and 5.3 of thenonvolatile memory 5. The partial protection flags Lb ′ and Mb ′ are read out and output to thecontrol unit 50. Readunit 52 includes a readcircuit 56 and readregisters 58 and 57.

読出回路56は、外部からのリセット信号や電源部97からの投入信号を受けて、全体保護フラグ1a’,2a’,・・・,La’,Ma’,・・・,Na’を読出し、読出レジスタ58へ出力する。同時に、読出回路56は、部分保護フラグLb’,Mb’を読出し、読出レジスタ57へ出力する。  Thereading circuit 56 receives the reset signal from the outside and the input signal from thepower supply unit 97, and reads the overall protection flags 1a ′, 2a ′,..., La ′, Ma ′,. The data is output to theread register 58. At the same time, theread circuit 56 reads the partial protection flags Lb ′ and Mb ′ and outputs them to theread register 57.

読出レジスタ58は、全体保護フラグ1a’,2a’,・・・,La’,Ma’,・・・,Na’のそれぞれをビット単位で一旦格納し、各ビットの値を制御部50へ出力する。  The read register 58 temporarily stores each of the overall protection flags 1a ′, 2a ′,..., La ′, Ma ′,..., Na ′ in units of bits, and outputs the value of each bit to thecontrol unit 50. To do.

読出レジスタ57は、部分保護フラグLb’,Mb’をビット単位で一旦格納し、各ビットの値を制御部50へ出力する。  The read register 57 temporarily stores the partial protection flags Lb ′ and Mb ′ in units of bits, and outputs the value of each bit to thecontrol unit 50.

制御部50は、実施の形態4における制御部40において、OR回路43.Lおよび43.MをOR回路53.LMに代え、かつ、OR回路44をOR回路54に代えたものである。  Thecontrol unit 50 is the same as the OR circuit 43. L and 43. M is ORed 53. The ORcircuit 44 is replaced with an ORcircuit 54 instead of the LM.

OR回路53.LMは、読出レジスタ58に格納されている全体保護フラグLa’の0ビット目の値La’(0)および1ビット目の値La’(1)ならびに、全体保護フラグMa’の0ビット目の値Ma’(0)および1ビット目の値Ma’(1)を読出し、論理和(OR)演算を行なう。そして、OR回路53.LMは、その論理和演算の結果を優先回路34へ出力する。  OR circuit 53. The LM includes the 0th bit value La ′ (0) and 1st bit value La ′ (1) of the overall protection flag La ′ and the 0th bit of the overall protection flag Ma ′ stored in theread register 58. The value Ma ′ (0) and the value Ma ′ (1) of the first bit are read out, and a logical sum (OR) operation is performed. Then, an OR circuit 53. The LM outputs the result of the logical sum operation to thepriority circuit 34.

同様に、OR回路54は、読出レジスタ57に格納されている部分保護フラグLb’の0ビット目の値Lb’(0)および1ビット目の値Lb’(1)ならびに、部分保護フラグMb’の0ビット目の値Mb’(0)および1ビット目の値Mb’(1)を読出し、論理和(OR)演算を行なう。そして、OR回路54は、その論理和演算の結果を優先回路34へ出力する。  Similarly, theOR circuit 54 includes the 0th bit value Lb ′ (0) and 1st bit value Lb ′ (1) of the partial protection flag Lb ′ stored in theread register 57, and the partial protection flag Mb ′. The value Mb ′ (0) of the 0th bit and the value Mb ′ (1) of the 1st bit are read out, and a logical sum (OR) operation is performed. Then, theOR circuit 54 outputs the result of the logical sum operation to thepriority circuit 34.

すなわち、OR回路53.LMおよび54は、ブロックLまたはブロックMのいずれかに全体プロテクトまたは部分プロテクトが設定されていれば、ブロックLおよびMに対して全体プロテクトまたは部分プロテクトが設定されていると判断する。  That is, the OR circuit 53. If the entire protection or partial protection is set for either the block L or the block M, the LM and 54 determine that the entire protection or partial protection is set for the blocks L and M.

以下、優先回路34、OR回路35および38、起動モード判断部(判断部a)14ならびにアクセスモード判断部(判断部b)24については、実施の形態4と同様であるので、詳細な説明は繰返さない。  Hereinafter, thepriority circuit 34, theOR circuits 35 and 38, the activation mode determination unit (determination unit a) 14, and the access mode determination unit (determination unit b) 24 are the same as those in the fourth embodiment, and thus detailed description thereof will be given. Do not repeat.

電源部97については、実施の形態4と同様であるので、詳細な説明は繰返さない。
上述のように、OR回路54は、部分保護フラグLb’またはMb’のいずれかが設定されていれば、ブロックLおよびMに対する部分プロテクトが設定されていると出力する。そのため、制御回路41は、ブロックLまたはMに対して部分プロテクトが設定されている場合には、CPU92からの命令フェッチによるアクセスを除き、ブロックLおよびブロックMに対するアクセスを禁止する。さらに、ブロックLまたはMに対する部分プロテクトを解除するためには、ブロックLおよびMに格納されているデータをすべて消去する必要がある。
Sincepower supply unit 97 is similar to that of the fourth embodiment, detailed description thereof will not be repeated.
As described above, if either of the partial protection flags Lb ′ or Mb ′ is set, theOR circuit 54 outputs that partial protection for the blocks L and M is set. Therefore, when partial protection is set for the block L or M, thecontrol circuit 41 prohibits access to the block L and block M except for access by instruction fetch from theCPU 92. Further, in order to cancel the partial protection for the block L or M, it is necessary to erase all the data stored in the blocks L and M.

よって、ブロックLおよびMに格納されるデータに対して一体的なプロテクトを行なうことができる。  Therefore, integral protection can be performed on the data stored in the blocks L and M.

なお、実施の形態5においては、データ領域に含まれる複数ブロックのうち2ブロックに対して部分プロテクトを設定する構成について説明したが、2ブロックに限定されることはなく、ブロックの数は、格納されるライブラリソフトウェアの容量などに応じて適宜設計すればよい。  In the fifth embodiment, the configuration in which partial protection is set for two blocks among a plurality of blocks included in the data area has been described. However, the configuration is not limited to two blocks, and the number of blocks is stored. What is necessary is just to design suitably according to the capacity | capacitance etc. of library software to be performed.

また、実施の形態5においては、実施の形態4に従う半導体装置に適応した場合について説明したが、部分プロテクト機能を備える実施の形態2に従う半導体装置および実施の形態3に従う半導体装置のいずれに対しても同様に適応できることは言うまでもない。  In the fifth embodiment, the case where the semiconductor device according to the fourth embodiment is applied has been described. However, for any of the semiconductor device according to the second embodiment and the semiconductor device according to the third embodiment having a partial protect function. It goes without saying that can be adapted as well.

実施の形態5によれば、実施の形態4における効果に加えて、複数のブロックに対して部分プロテクトを設定でき、かつ、それらのブロックに対する部分プロテクトの設定および解除は、一体的に行なわれる。よって、ライブラリソフトウェアの容量が増加し、複数のブロックにわたって格納される場合であっても、1つのブロックに格納される場合と同様に、処理コードの漏洩を防止することができる。  According to the fifth embodiment, in addition to the effects of the fourth embodiment, partial protection can be set for a plurality of blocks, and the setting and release of partial protection for these blocks are performed integrally. Therefore, even if the capacity of the library software is increased and stored over a plurality of blocks, leakage of the processing code can be prevented as in the case of being stored in one block.

[実施の形態6]
実施の形態5においては、複数のブロックに対して、一体的に部分プロテクトを設定する場合について説明した。
[Embodiment 6]
In the fifth embodiment, the case where partial protection is integrally set for a plurality of blocks has been described.

一方、実施の形態6では、複数の部分プロテクトを互いに独立に設定できる場合について説明する。なお、実施の形態6においては、実施の形態4に示す半導体装置104に適用した例について説明する。  On the other hand, in the sixth embodiment, a case where a plurality of partial protects can be set independently of each other will be described. Note that in Embodiment 6, an example applied to thesemiconductor device 104 described inEmbodiment 4 will be described.

複数のIPベンダによりライブラリソフトウェアが供給される場合などにおいては、複数のブロックに対して、互いに独立に部分プロテクトを設定できる機能が必要となる。  In the case where library software is supplied by a plurality of IP vendors, a function capable of setting partial protection for a plurality of blocks independently of each other is required.

図7は、実施の形態6に従う半導体装置106の概略構成図である。
図7を参照して、半導体装置106は、データバス98と、CPU92と、不揮発性メモリ5と、読出部52と、制御部60と、電源部97とからなる。
FIG. 7 is a schematic configuration diagram ofsemiconductor device 106 according to the sixth embodiment.
Referring to FIG. 7,semiconductor device 106 includes adata bus 98,CPU 92,nonvolatile memory 5, readingunit 52,control unit 60, andpower supply unit 97.

データバス98は、CPU92、制御部50、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 92, thecontrol unit 50, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU92については、実施の形態4と同様であるので、詳細な説明は繰返さない。
不揮発性メモリ5および読出部52は、実施の形態5と同様であるので、詳細な説明は繰返さない。
SinceCPU 92 is similar to that of the fourth embodiment, detailed description thereof will not be repeated.
Sincenonvolatile memory 5 andreading unit 52 are the same as in the fifth embodiment, detailed description will not be repeated.

制御部60は、実施の形態4における制御部40において、OR回路64、優先回路(優先回路L)62およびアクセスモード判断部(判断部b)65を付加し、OR回路38をOR回路68に代えたものである。  Thecontrol unit 60 adds anOR circuit 64, a priority circuit (priority circuit L) 62, and an access mode determination unit (determination unit b) 65 in thecontrol unit 40 in the fourth embodiment, and makes theOR circuit 38 an ORcircuit 68. It has been replaced.

OR回路64は、読出レジスタ57に格納されている部分保護フラグLb’の0ビット目の値Lb’(0)および1ビット目の値Lb’(1)を読出し、論理和(OR)演算を行なう。そして、OR回路64は、その論理和演算の結果を優先回路62へ出力する。  The ORcircuit 64 reads the 0th bit value Lb ′ (0) and the 1st bit value Lb ′ (1) of the partial protection flag Lb ′ stored in theread register 57, and performs a logical sum (OR) operation. Do. Then, theOR circuit 64 outputs the result of the logical sum operation to thepriority circuit 62.

優先回路62は、OR回路43.Lから受けた全体保護フラグLa’の値とOR回路64から受けた部分保護フラグLb’の値との論理演算を行ない、部分保護フラグLb’により部分プロテクトが設定されていれば、全体保護フラグLa’による全体プロテクト設定を無視して、全体プロテクトの設定解除を示す値をOR回路35へ出力する。  Thepriority circuit 62 includes an OR circuit 43. The logical operation of the value of the total protection flag La ′ received from L and the value of the partial protection flag Lb ′ received from theOR circuit 64 is performed, and if the partial protection is set by the partial protection flag Lb ′, the total protection flag The whole protection setting by La ′ is ignored, and a value indicating release of the whole protection setting is output to theOR circuit 35.

アクセスモード判断部65は、実施の形態4におけるアクセスモード判断部24と同様に、OR回路64から出力される部分保護フラグLb’の値に基づいて、ブロックLに対する部分プロテクトの設定がされている場合には、データ領域5.1のブロックLに対するアクセスを禁止させるプロテクト制御信号をOR回路68へ出力する。そして、アクセスモード判断部65は、例外的に、CPU92からモード信号を受けている場合で、かつ、CPU92からブロックLに対する命令フェッチによる命令コードの読出しである場合に限り、そのアクセスを禁止させるプロテクト制御信号をマスクする。  Similar to the accessmode determination unit 24 in the fourth embodiment, the accessmode determination unit 65 is set for partial protection for the block L based on the value of the partial protection flag Lb ′ output from theOR circuit 64. In this case, a protection control signal for prohibiting access to the block L in the data area 5.1 is output to theOR circuit 68. The accessmode determination unit 65 exceptionally protects the access only when the mode signal is received from theCPU 92 and only when the instruction code is read from theCPU 92 by the instruction fetch for the block L. Mask control signals.

OR回路68は、起動モード判断部14、アクセスモード判断部65および24から出力されるプロテクト制御信号を結合し、制御回路41へ出力する。  The ORcircuit 68 combines the protection control signals output from the activationmode determination unit 14 and the accessmode determination units 65 and 24, and outputs them to thecontrol circuit 41.

以下、優先回路34、OR回路35、起動モード判断部14ならびにアクセスモード判断部24については、実施の形態4と同様であるので、詳細な説明は繰返さない。  Sincepriority circuit 34, ORcircuit 35, activationmode determination unit 14 and accessmode determination unit 24 are the same as those of the fourth embodiment, detailed description thereof will not be repeated.

電源部97については、実施の形態4と同様であるので、詳細な説明は繰返さない。
上述のように、アクセスモード判断部65および24は、それぞれ部分保護フラグLb’およびMb’の値に応じて、ブロックLおよびMに対する部分プロテクトが設定されているか否かを判断する。また、優先回路62および34は、それぞれ部分保護フラグLb’およびMb’の値に応じて、全体保護フラグLa’およびMa’の設定が有効であるか否かを判断する。
Sincepower supply unit 97 is similar to that of the fourth embodiment, detailed description thereof will not be repeated.
As described above, the accessmode determination units 65 and 24 determine whether or not partial protection for the blocks L and M is set according to the values of the partial protection flags Lb ′ and Mb ′, respectively. Thepriority circuits 62 and 34 determine whether or not the setting of the overall protection flags La ′ and Ma ′ is valid according to the values of the partial protection flags Lb ′ and Mb ′, respectively.

よって、ブロックLおよびMに格納されているデータに対して、互いに独立に全体プロテクトまたは部分プロテクトが設定される。  Therefore, overall protection or partial protection is set independently of each other for the data stored in the blocks L and M.

なお、実施の形態6においては、データ領域に含まれる複数ブロックのうち2ブロックに対して互いに独立に部分プロテクトを設定する構成について説明したが、2ブロックに限定されることはなく、ブロックの数は、IPベンダの数などに応じて適宜設計すればよい。  In the sixth embodiment, the configuration in which partial protection is set independently for two blocks among a plurality of blocks included in the data area has been described. However, the number of blocks is not limited to two blocks. May be appropriately designed according to the number of IP vendors.

また、実施の形態6においては、実施の形態4に従う半導体装置に適応した場合について説明したが、部分プロテクト機能を備える実施の形態2に従う半導体装置および実施の形態3に従う半導体装置のいずれに対しても同様に適応できることは言うまでもない。  In the sixth embodiment, the case where the semiconductor device according to the fourth embodiment is applied has been described. However, for any of the semiconductor device according to the second embodiment and the semiconductor device according to the third embodiment having a partial protect function. It goes without saying that can be adapted as well.

実施の形態6によれば、実施の形態4における効果に加えて、複数のブロックに対してそれぞれ独立に部分プロテクトを設定できる。そのため、複数のIPベンダなどがライブラリソフトウェアを提供する場合などには、それぞれ独立して部分プロテクトを設定でき、かつ、その部分プロテクトを設定したデータは、他のIPベンダを含めたいずれの者に対しても有効である。よって、同一の半導体装置に対して、複数のIPベンダがライブラリソフトウェアを提供する場合においても、その処理コードの漏洩を防止することができる。  According to the sixth embodiment, in addition to the effects in the fourth embodiment, partial protection can be set independently for a plurality of blocks. Therefore, when multiple IP vendors etc. provide library software, partial protection can be set independently, and the data for which partial protection has been set can be sent to any person including other IP vendors. Also effective. Therefore, even when a plurality of IP vendors provide library software for the same semiconductor device, leakage of the processing code can be prevented.

[実施の形態7]
実施の形態1においては、不揮発性メモリを構成するすべてのブロックに対して、全体プロテクトを設定する場合について説明した。
[Embodiment 7]
In the first embodiment, the case where the entire protection is set for all the blocks constituting the nonvolatile memory has been described.

一方、実施の形態7では、不揮発性メモリを構成するブロックのうち限られたブロックに対してのみ全体プロテクトを設定できる場合について説明する。なお、実施の形態7においては、実施の形態1に示す半導体装置101に適用した例について説明する。  On the other hand, in the seventh embodiment, a case will be described in which the entire protection can be set only for a limited block among the blocks constituting the nonvolatile memory. Note that inEmbodiment 7, an example in which the present invention is applied to thesemiconductor device 101 described inEmbodiment 1 is described.

不揮発性メモリのデータ領域に対して、格納されるプログラムが小さい場合などには、プログラムに加えてユーザデータなどを格納することも考えられる。その際、不揮発性メモリを構成するすべてのブロックを全体プロテクトの対象とすると、エンドユーザは、ユーザデータに対してアクセスできない。そこで、不揮発性メモリを構成するブロックのうち、プログラムが格納されるブロックに対してのみ、全体プロテクトを設定できる構成とする。  When the stored program is small relative to the data area of the non-volatile memory, it may be possible to store user data in addition to the program. At this time, if all blocks constituting the nonvolatile memory are subject to overall protection, the end user cannot access the user data. Therefore, the entire protection can be set only for the block in which the program is stored among the blocks constituting the nonvolatile memory.

図8は、実施の形態7に従う半導体装置107の概略構成図である。
図8を参照して、半導体装置107は、データバス98と、CPU90と、不揮発性メモリ7と、読出部72と、制御部10と、電源部97とからなる。
FIG. 8 is a schematic configuration diagram ofsemiconductor device 107 according to the seventh embodiment.
Referring to FIG. 8,semiconductor device 107 includesdata bus 98,CPU 90,nonvolatile memory 7, readingunit 72,control unit 10, andpower supply unit 97.

データバス98は、CPU90、制御部10、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 90, thecontrol unit 10, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU90については、実施の形態1と同様であるので、詳細な説明は繰返さない。
不揮発性メモリ7は、複数のブロックに分割されたデータ領域7.1とプロテクト情報領域7.2とを含む。
SinceCPU 90 is similar to that of the first embodiment, detailed description thereof will not be repeated.
Thenonvolatile memory 7 includes a data area 7.1 and a protect information area 7.2 divided into a plurality of blocks.

データ領域7.1は、ブロック1,2,・・・,L,M,・・・,Nに分割されており、それぞれデータ1,2,・・・,L,M,・・・,Nが格納される。  The data area 7.1 is divided intoblocks 1, 2,..., L, M,..., N, anddata 1, 2,. Is stored.

プロテクト情報領域7.2は、データ領域7.1に含まれるブロックのうち所定のブロックに対応するように配置されており、その所定のブロックに対する全体プロテクト設定が格納される。実施の形態7におけるプロテクト情報領域7.2には、データ領域7.1に含まれるブロックLおよびMに対する全体保護フラグLaおよびMaが格納される。  The protect information area 7.2 is arranged so as to correspond to a predetermined block among the blocks included in the data area 7.1, and stores the entire protection setting for the predetermined block. In the protect information area 7.2 in the seventh embodiment, the overall protection flags La and Ma for the blocks L and M included in the data area 7.1 are stored.

読出部72は、不揮発性メモリ7のプロテクト情報領域7.2に格納されている全体保護フラグLaおよびMaを読出し、制御部10へ出力する。そして、読出部72は、読出回路76と、読出レジスタ78とからなる。  Thereading unit 72 reads the overall protection flags La and Ma stored in the protection information area 7.2 of thenonvolatile memory 7 and outputs them to thecontrol unit 10. Thereading unit 72 includes areading circuit 76 and areading register 78.

読出回路76は、外部からのリセット信号や電源部97からの投入信号を受けて、プロテクト情報領域7.2に格納されている全体保護フラグLaおよびMaを読出し、読出レジスタ78へ出力する。  Theread circuit 76 receives the reset signal from the outside and the input signal from thepower supply unit 97, reads the overall protection flags La and Ma stored in the protection information area 7.2, and outputs them to theread register 78.

読出レジスタ78は、全体保護フラグLaおよびMaを一旦格納し、その値を制御部10へ出力する。  Readregister 78 temporarily stores overall protection flags La and Ma and outputs the values to controlunit 10.

制御部10および電源部97については、実施の形態1と同様であるので、詳細な説明は繰返さない。  Sincecontrol unit 10 andpower supply unit 97 are the same as those in the first embodiment, detailed description will not be repeated.

上述のように、制御部10は、全体プロテクトフラグLaおよびMaの値に応じて、ブロックLおよびMに対して全体プロテクトが設定されているか否かを判断する。また、制御部10は、ブロックLおよびMのいずれに対しても全体プロテクトが設定されていなければ、ブロックLおよびMに対するアクセスを許可する。  As described above, thecontrol unit 10 determines whether or not the overall protection is set for the blocks L and M according to the values of the overall protection flags La and Ma. Further, thecontrol unit 10 permits access to the blocks L and M if the overall protection is not set for any of the blocks L and M.

すなわち、不揮発性メモリ7に含まれるブロックLおよびM以外のブロックに対しては、全体プロテクトの設定を行なうことができない。そのため、ブロックLおよびMにプロテクト対象のプログラムなどを格納し、その他のブロックに対しては、エンドユーザへ開放するような使用形態が可能となる。  That is, it is not possible to set the overall protection for blocks other than the blocks L and M included in thenonvolatile memory 7. For this reason, it is possible to store the programs to be protected in the blocks L and M and to open the other blocks to the end user.

なお、実施の形態7においては、データ領域に含まれる複数ブロックのうち2ブロックに対して全体プロテクトを設定する構成について説明したが、2ブロックに限定されることはなく、全体プロテクトを設定可能なブロックの数は、プログラムの容量などに応じて適宜設計すればよい。  In the seventh embodiment, the configuration in which the overall protection is set for two blocks among the plurality of blocks included in the data area has been described. However, the configuration is not limited to two blocks, and the overall protection can be set. The number of blocks may be appropriately designed according to the capacity of the program.

また、実施の形態7においては、実施の形態1に従う半導体装置に適応した場合について説明したが、全体プロテクト機能を備える実施の形態3〜6に従う半導体装置のいずれに対しても同様に適応できることは言うまでもない。  In the seventh embodiment, the case where the present invention is applied to the semiconductor device according to the first embodiment has been described. However, the present invention can be similarly applied to any of the semiconductor devices according to the third to sixth embodiments having the overall protection function. Needless to say.

実施の形態7によれば、実施の形態1における効果に加えて、不揮発性メモリを構成するブロックのうち、一部のブロックに対してのみ全体プロテクトの対象とする。そのため、全体プロテクトの対象となるプログラムの容量が、不揮発性メモリの容量より十分小さい場合などにおいて、プログラムが格納されるブロック以外のブロックをエンドユーザに開放し、不揮発性メモリをより有効に使用することができる。よって、不揮発性メモリを複数の用途に用いることができるので、半導体装置に内蔵される不揮発性メモリの容量などを合理的に決定できる。  According to the seventh embodiment, in addition to the effects of the first embodiment, only a part of the blocks constituting the nonvolatile memory is subject to overall protection. Therefore, when the capacity of the program that is subject to overall protection is sufficiently smaller than the capacity of the nonvolatile memory, the blocks other than the block storing the program are opened to the end user, and the nonvolatile memory is used more effectively. be able to. Therefore, since the nonvolatile memory can be used for a plurality of purposes, the capacity of the nonvolatile memory incorporated in the semiconductor device can be rationally determined.

[実施の形態8]
実施の形態1〜7においては、不揮発性メモリ内にデータ領域とプロテクト情報領域とを配置する場合について説明した。
[Embodiment 8]
In the first to seventh embodiments, the case where the data area and the protect information area are arranged in the nonvolatile memory has been described.

一方、実施の形態8では、不揮発性メモリ内にデータ領域のみを配置し、そのデータ領域にデータとプロテクト情報フラグとを格納する構成について説明する。なお、実施の形態8においては、実施の形態3に示す半導体装置103に適用した例について説明する。  On the other hand, in the eighth embodiment, a configuration will be described in which only a data area is arranged in a nonvolatile memory and data and a protection information flag are stored in the data area. Note that in Embodiment 8, an example applied to thesemiconductor device 103 described inEmbodiment 3 will be described.

図9は、実施の形態8に従う半導体装置108の概略構成図である。
図9を参照して、半導体装置108は、データバス98と、CPU92と、不揮発性メモリ8と、読出部82と、制御部80と、電源部97とからなる。
FIG. 9 is a schematic configuration diagram ofsemiconductor device 108 according to the eighth embodiment.
Referring to FIG. 9,semiconductor device 108 includes adata bus 98,CPU 92, nonvolatile memory 8, readingunit 82,control unit 80, andpower supply unit 97.

データバス98は、CPU92、制御部80、外部メモリ(図示しない)および外部装置(図示しない)などを互いに接続し、データの授受を仲介する。  Thedata bus 98 connects theCPU 92, thecontrol unit 80, an external memory (not shown), an external device (not shown), and the like to mediate data exchange.

CPU92については、実施の形態3と同様であるので、詳細な説明は繰返さない。
不揮発性メモリ8は、複数のブロックに分割されたデータ領域からなる。そして、不揮発性メモリ8は、ブロック1,2,・・・,M,・・・,Nに分割されており、それぞれデータ1,2,・・・,M,・・・,Nおよび各ブロックに対する全体保護フラグ1a,2a,・・・,Ma,・・・,Naが格納される。さらに、ブロックMには、ブロックMに対する部分保護フラグMbが格納される。
SinceCPU 92 is similar to that of the third embodiment, detailed description thereof will not be repeated.
The nonvolatile memory 8 is composed of a data area divided into a plurality of blocks. The non-volatile memory 8 is divided intoblocks 1, 2,..., M,..., N, anddata 1, 2,. , Ma,..., Na are stored. Further, the partial protection flag Mb for the block M is stored in the block M.

読出部82は、不揮発性メモリ8に格納されているデータの中から、全体保護フラグ1a,2a,・・・,Ma,・・・,Naおよび部分保護フラグMbを抽出し、制御部80へ出力する。そして、読出部82は、読出回路86と、読出レジスタ18および37とからなる。  Thereading unit 82 extracts the overall protection flags 1a, 2a,..., Ma,..., Na and the partial protection flag Mb from the data stored in the nonvolatile memory 8, and sends them to thecontrol unit 80. Output. Readunit 82 includes a readcircuit 86 and readregisters 18 and 37.

読出回路86は、外部からのリセット信号や電源部97からの投入信号を受けて、不揮発性メモリ8のそれぞれのブロックに格納されているデータを読出し、その読出したデータに含まれる全体保護フラグ1a,2a,・・・,Ma,・・・,Naおよび部分保護フラグMbを抽出し、読出レジスタ18および37へ出力する。  In response to an external reset signal or a power-on signal from thepower supply unit 97, theread circuit 86 reads data stored in each block of the nonvolatile memory 8, and the entire protection flag 1a included in the read data. , 2a,..., Ma,..., Na and the partial protection flag Mb are extracted and output to the read registers 18 and 37.

読出レジスタ18および37は、実施の形態3と同様であるので、詳細な説明は繰返さない。  Since read registers 18 and 37 are the same as in the third embodiment, detailed description will not be repeated.

制御部80は、実施の形態3における制御部30において、制御回路31を制御回路81に代えたものである。  Thecontrol unit 80 is obtained by replacing thecontrol circuit 31 with thecontrol circuit 81 in thecontrol unit 30 in the third embodiment.

制御回路81は、データバスを介して、いずれかのブロックに対するプロテクトの設定解除の要求を受けると、当該ブロックに格納されているデータを消去するとともに、全体保護フラグまたは部分保護フラグの値を変更し、プロテクトの設定を解除する。また、制御回路81は、データバスを介して、いずれかのブロックに対するプロテクトの設定要求を受けると、当該ブロックに格納されている全体保護フラグまたは部分保護フラグの値を変更し、プロテクトを設定する。制御回路81の他の処理については、実施の形態3における制御回路31と同様であるので、詳細な説明は繰返さない。  When thecontrol circuit 81 receives a request to cancel the protection setting for any block via the data bus, thecontrol circuit 81 erases the data stored in the block and changes the value of the entire protection flag or the partial protection flag. Cancel the protection setting. When thecontrol circuit 81 receives a protection setting request for any block via the data bus, thecontrol circuit 81 changes the value of the overall protection flag or the partial protection flag stored in the block and sets the protection. . Since other processes ofcontrol circuit 81 are the same as those ofcontrol circuit 31 in the third embodiment, detailed description thereof will not be repeated.

以下、優先回路34、OR回路35および38、起動モード判断部14ならびにアクセスモード判断部24については、実施の形態3と同様であるので、詳細な説明は繰返さない。  Sincepriority circuit 34, ORcircuits 35 and 38, activationmode determination unit 14 and accessmode determination unit 24 are the same as those in the third embodiment, detailed description thereof will not be repeated.

電源部97については、実施の形態3と同様であるので、詳細な説明は繰返さない。
上述のように、不揮発性メモリ8のそれぞれのブロックには、通常のデータに加えて、各ブロックのプロテクトを設定するための全体保護フラグおよび部分保護フラグが格納される。そのため、全体プロテクトおよび部分プロテクトを設定する対象のブロックを比較的自由に設定することができる。
Sincepower supply unit 97 is similar to that of the third embodiment, detailed description thereof will not be repeated.
As described above, each block of the nonvolatile memory 8 stores a general protection flag and a partial protection flag for setting protection for each block in addition to normal data. For this reason, it is possible to relatively freely set a target block for which the overall protection and the partial protection are set.

なお、実施の形態8においては、全体保護フラグおよび部分保護フラグの両方をデータと共に格納する場合について説明したが、全体保護フラグまたは部分保護フラグのいずれか一方をデータと共に格納し、他方のフラグは、実施の形態1〜7と同様にプロテクト情報領域に格納する構成としてもよい。  In the eighth embodiment, the case where both the entire protection flag and the partial protection flag are stored together with the data has been described. However, either the entire protection flag or the partial protection flag is stored together with the data, and the other flag is As in the first to seventh embodiments, the protection information area may be stored.

また、実施の形態8においては、実施の形態3に従う半導体装置に適応した場合について説明したが、実施の形態1、2および4〜7に従う半導体装置のいずれに対しても同様に適応できることは言うまでもない。  In the eighth embodiment, the case where the semiconductor device according to the third embodiment is applied has been described. Needless to say, the present invention can be similarly applied to any of the semiconductor devices according to the first, second, and fourth to seventh embodiments. Yes.

実施の形態8によれば、実施の形態3における効果に加えて、全体プロテクトおよび部分プロテクトを格納するためのプロテクト情報領域を必要としないので、プロテクトの対象となるブロックに応じて、プロテクト情報領域を配置する必要がない。そのため、全体プロテクトおよび部分プロテクトの対象となるブロックを自由に選択することができ、かつ、変更も容易である。よって、不揮発性メモリに格納されるプログラムやサブルーチンプログラムに応じて、プロテクトの対象となるブロック数を自由に変更できる半導体装置を実現できる。  According to the eighth embodiment, in addition to the effects in the third embodiment, the protection information area for storing the whole protection and the partial protection is not required. Therefore, the protection information area is selected according to the block to be protected. There is no need to place. For this reason, it is possible to freely select blocks that are subject to overall protection and partial protection, and it is easy to change them. Therefore, it is possible to realize a semiconductor device that can freely change the number of blocks to be protected in accordance with a program or subroutine program stored in the nonvolatile memory.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。  The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

実施の形態1に従う半導体装置の概略構成図である。1 is a schematic configuration diagram of a semiconductor device according to a first embodiment.半導体装置の動作モードを説明するための図である。It is a figure for demonstrating the operation mode of a semiconductor device.実施の形態2に従う半導体装置の概略構成図である。FIG. 7 is a schematic configuration diagram of a semiconductor device according to a second embodiment.実施の形態3に従う半導体装置の概略構成図である。FIG. 10 is a schematic configuration diagram of a semiconductor device according to a third embodiment.実施の形態4に従う半導体装置の概略構成図である。FIG. 10 is a schematic configuration diagram of a semiconductor device according to a fourth embodiment.実施の形態5に従う半導体装置の概略構成図である。FIG. 10 is a schematic configuration diagram of a semiconductor device according to a fifth embodiment.実施の形態6に従う半導体装置の概略構成図である。FIG. 10 is a schematic configuration diagram of a semiconductor device according to a sixth embodiment.実施の形態7に従う半導体装置の概略構成図である。FIG. 10 is a schematic configuration diagram of a semiconductor device according to a seventh embodiment.実施の形態8に従う半導体装置の概略構成図である。FIG. 10 is a schematic configuration diagram of a semiconductor device according to an eighth embodiment.

符号の説明Explanation of symbols

1,2,3,4,5,7,8 不揮発性メモリ、1.1,2.1,3.1,4.1,5.1,7.1 データ領域、1.2,2.2,3.2,3.3,4.2,4.3,5.2,5.3,7.2 プロテクト情報領域、1a,2a,・・・,La,Ma,・・・,Na,1a’,2a’,・・・,La’,Ma’,・・・,Na’ 全体保護フラグ、Mb,Lb’,Mb’ 部分保護フラグ、10,20,30,40,50,60,80 制御部、11,21,31,41,81 制御回路、12,22,32,42,52,72,82 読出部、14 起動モード判断部(判断部a)、15,35,38,43.1,43.2,・・・,43.M,・・・,43.N,46,53.LM,44,53.LM,54,64,68 OR回路、16,26,36,54,56,76,86 読出回路、18,28,47,48,57,58,78 読出レジスタ、24,65 アクセスモード判断部(判断部b)、34 優先回路(優先回路M)、62 優先回路(優先回路L)、90,92 演算部(CPU)、95 プログラムカウンタ(PC)、97 電源部、98 データバス、101,102,103,104,105,106,107,108 半導体装置、200 外部メモリ、202 外部装置。  1, 2, 3, 4, 5, 7, 8 Non-volatile memory, 1.1, 2.1, 3.1, 4.1, 5.1, 7.1 Data area, 1.2, 2.2 , 3.2, 3.3, 4.2, 4.3, 5.2, 5.3, 7.2 Protection information area, 1a, 2a,..., La, Ma,. 1a ′, 2a ′,..., La ′, Ma ′,..., Na ′ total protection flag, Mb, Lb ′, Mb ′ partial protection flag, 10, 20, 30, 40, 50, 60, 80Control unit 11, 21, 31, 41, 81Control circuit 12, 22, 32, 42, 52, 72, 82 Reading unit, 14 Startup mode determination unit (determination unit a), 15, 35, 38, 43. 1, 43.2,. M, ..., 43. N, 46, 53. LM, 44, 53. LM, 54, 64, 68 OR circuit, 16, 26, 36, 54, 56, 76, 86 Read circuit, 18, 28, 47, 48, 57, 58, 78 Read register, 24, 65 Access mode determination unit ( Judgment part b), 34 priority circuit (priority circuit M), 62 priority circuit (priority circuit L), 90, 92 operation part (CPU), 95 program counter (PC), 97 power supply part, 98 data bus, 101, 102 , 103, 104, 105, 106, 107, 108 Semiconductor device, 200 External memory, 202 External device.

Claims (19)

Translated fromJapanese
複数のブロックに分割されたデータ領域と、ブロック毎にアクセスを禁止するための保護情報が格納される保護情報領域とを含む不揮発性記憶部と、
前記保護情報領域に格納された前記保護情報を読出す読出部と、
いずれかのブロックに対するアクセスの禁止を解除する前に、当該ブロックに格納されているデータを消去する制御部とを備え、
前記制御部は、前記読出部から前記保護情報を受け、前記保護情報によりアクセスを禁止され得るいずれかのブロックにおいてアクセスが禁止されていれば、前記保護情報によりアクセスを禁止され得るすべてのブロックへのアクセスを禁止する、半導体装置。
A nonvolatile storage unit including a data area divided into a plurality of blocks, and a protection information area for storing protection information for prohibiting access for each block;
A reading unit for reading the protection information stored in the protection information area;
A controller that erases data stored in the block before canceling the prohibition of access to any of the blocks;
The control unit receives the protection information from the reading unit, and if access is prohibited in any block that can be prohibited by the protection information, all the blocks that can be prohibited from access by the protection information A semiconductor device that prohibits access.
演算部をさらに備え、
前記制御部は、起動時における前記演算部からのアクセスであれば、前記保護情報にかかわらず、アクセスを許可する、請求項1に記載の半導体装置。
It further includes an arithmetic unit,
The semiconductor device according to claim 1, wherein the control unit permits access regardless of the protection information if the access is from the arithmetic unit at the time of startup.
前記保護情報は、ブロック毎にそれぞれ複数のフラグを含み、
前記複数のフラグに含まれる各々のフラグは、ブロックに対するアクセスを禁止するため互いに同値に設定され、
前記制御部は、いずれかのブロックに対する前記保護情報を前記読出部から受け、前記保護情報に含まれる前記複数のフラグのうちいずれか1つでもアクセスを禁止する値に設定されていれば、前記保護情報により当該ブロックに対するアクセスが禁止されていると判断する、請求項1または2に記載の半導体装置。
The protection information includes a plurality of flags for each block,
Each flag included in the plurality of flags is set to the same value to prohibit access to the block,
The control unit receives the protection information for any block from the reading unit, and if any one of the plurality of flags included in the protection information is set to a value that prohibits access, The semiconductor device according to claim 1, wherein access to the block is determined to be prohibited by the protection information.
前記保護情報は、前記データ領域に含まれる複数のブロックのうち、少なくとも1以上のブロックに対してアクセスを禁止する、請求項1〜3のいずれか1項に記載の半導体装置。  The semiconductor device according to claim 1, wherein the protection information prohibits access to at least one block among a plurality of blocks included in the data area. 前記データ領域は、前記保護情報領域を含む、請求項1〜4のいずれか1項に記載の半導体装置。  The semiconductor device according to claim 1, wherein the data area includes the protection information area. 複数のブロックに分割されたデータ領域と、ブロック毎にアクセスを禁止するための保護情報が格納される保護情報領域とを含む不揮発性記憶部と、
前記保護情報領域に格納された前記保護情報を読出す読出部と、
いずれかのブロックに対するアクセスの禁止を解除する前に、当該ブロックに格納されているデータを消去する制御部と、
前記データ領域に格納された命令コードを読出して処理を実行する演算部とを備え、
前記制御部は、
前記読出部から受けた前記保護情報に基づいて、前記保護情報によりアクセスを禁止され得るブロックへのアクセスを許可するか否かを決定し、かつ、
前記演算部から前記命令コードの読出しを行なうためのアクセス要求を受けると、前記保護情報にかかわらず当該アクセスを許可する、半導体装置。
A nonvolatile storage unit including a data area divided into a plurality of blocks, and a protection information area for storing protection information for prohibiting access for each block;
A reading unit for reading the protection information stored in the protection information area;
Before canceling the prohibition of access to any block, a control unit for erasing data stored in the block;
An operation unit that reads the instruction code stored in the data area and executes processing;
The controller is
Based on the protection information received from the reading unit, determine whether to permit access to a block that can be prohibited access by the protection information, and
A semiconductor device that, when receiving an access request for reading the instruction code from the arithmetic unit, permits the access regardless of the protection information.
前記保護情報は、ブロック毎にそれぞれ複数のフラグを含み、
前記複数のフラグに含まれる各々のフラグは、ブロックに対するアクセスを禁止するため互いに同値に設定され、
前記制御部は、いずれかのブロックに対する前記保護情報を前記読出部から受け、前記保護情報に含まれる前記複数のフラグのうちいずれか1つでもアクセスを禁止する値に設定されていれば、前記保護情報により当該ブロックに対するアクセスが禁止されていると判断する、請求項6に記載の半導体装置。
The protection information includes a plurality of flags for each block,
Each flag included in the plurality of flags is set to the same value to prohibit access to the block,
The control unit receives the protection information for any block from the reading unit, and if any one of the plurality of flags included in the protection information is set to a value that prohibits access, The semiconductor device according to claim 6, wherein it is determined that access to the block is prohibited by the protection information.
前記制御部は、さらに、前記読出部から前記保護情報を受け、前記保護情報によりアクセスを禁止され得るいずれかのブロックにおいてアクセスが禁止されていれば、前記保護情報によりアクセスを禁止され得るすべてのブロックに対するアクセスが禁止されていると判断する、請求項6または7に記載の半導体装置。  The control unit further receives the protection information from the reading unit, and if access is prohibited in any block that can be prohibited by the protection information, all the access that can be prohibited by the protection information The semiconductor device according to claim 6, wherein access to the block is determined to be prohibited. 前記保護情報は、少なくとも2以上のブロックに対するアクセスを禁止し、
前記制御部は、前記保護情報がアクセスを禁止し得るブロックのそれぞれに対して、互いに独立にアクセスを許可するか否かを決定する、請求項6または7に記載の半導体装置。
The protection information prohibits access to at least two or more blocks,
The semiconductor device according to claim 6, wherein the control unit determines whether to permit access to each of the blocks for which the protection information may prohibit access, independently of each other.
前記データ領域は、前記保護情報領域を含む、請求項6〜9のいずれか1項に記載の半導体装置。  The semiconductor device according to claim 6, wherein the data area includes the protection information area. 複数のブロックに分割されたデータ領域と、ブロック毎にそれぞれアクセスを禁止するための第1および第2の保護情報が格納される保護情報領域とを含む不揮発性記憶部と、
前記保護情報領域に格納された前記第1および第2の保護情報を読出す読出部と、
いずれかのブロックに対するアクセスの禁止を解除する前に、当該ブロックに格納されているデータを消去する制御部と、
前記データ領域に格納された命令コードを読出して処理を実行する演算部とを備え、
前記制御部は、
前記読出部から前記第1の保護情報を受け、前記第1の保護情報によりアクセスを禁止され得るいずれかのブロックにおいてアクセスが禁止されていれば、前記第1の保護情報によりアクセスを禁止され得るすべてのブロックへのアクセスを禁止し、かつ、
前記読出部から受けた前記第2の保護情報に基づいて、前記第2の保護情報によりアクセスを禁止され得るブロックへのアクセスを許可するか否かを決定し、かつ、
前記演算部から前記命令コードの読出しを行なうためのアクセス要求を受けると、前記第2の保護情報にかかわらず当該アクセスを許可する、半導体装置。
A non-volatile storage unit including a data area divided into a plurality of blocks, and a protection information area in which first and second protection information for prohibiting access for each block is stored;
A reading unit for reading the first and second protection information stored in the protection information area;
Before canceling the prohibition of access to any block, a control unit for erasing data stored in the block;
An operation unit that reads the instruction code stored in the data area and executes processing;
The controller is
If the first protection information is received from the reading unit and access is prohibited in any block where access can be prohibited by the first protection information, access can be prohibited by the first protection information Prohibit access to all blocks, and
Based on the second protection information received from the reading unit, determining whether to permit access to a block whose access may be prohibited by the second protection information; and
When receiving an access request for reading the instruction code from the arithmetic unit, the semiconductor device permits the access regardless of the second protection information.
前記制御部は、起動時における前記演算部からのアクセスであれば、前記第1の保護情報にかかわらず、アクセスを許可する、請求項11に記載の半導体装置。  The semiconductor device according to claim 11, wherein the control unit permits access regardless of the first protection information if the access is from the arithmetic unit at startup. 前記第1の保護情報は、ブロック毎にそれぞれ複数のフラグを含み、
前記複数のフラグに含まれる各々のフラグは、ブロックに対するアクセスを禁止するため互いに同値に設定され、
前記制御部は、いずれかのブロックに対する前記第1の保護情報を前記読出部から受け、前記第1の保護情報に含まれる前記複数のフラグのうちいずれか1つでもアクセスを禁止する値に設定されていれば、前記第1の保護情報により当該ブロックに対するアクセスが禁止されていると判断する、請求項11または12に記載の半導体装置。
The first protection information includes a plurality of flags for each block,
Each flag included in the plurality of flags is set to the same value to prohibit access to the block,
The control unit receives the first protection information for any block from the reading unit, and sets the value to prohibit any one of the plurality of flags included in the first protection information The semiconductor device according to claim 11, wherein if it is determined, access to the block is prohibited by the first protection information.
前記第2の保護情報は、ブロック毎にそれぞれ複数のフラグを含み、
前記複数のフラグに含まれる各々のフラグは、ブロックに対するアクセスを禁止するため互いに同値に設定され、
前記制御部は、いずれかのブロックに対する前記第2の保護情報を前記読出部から受け、前記第2の保護情報に含まれる前記複数のフラグのうちいずれか1つでもアクセスを禁止する値に設定されていれば、前記第2の保護情報により当該ブロックに対するアクセスが禁止されていると判断する、請求項11〜13のいずれか1項に記載の半導体装置。
The second protection information includes a plurality of flags for each block,
Each flag included in the plurality of flags is set to the same value to prohibit access to the block,
The control unit receives the second protection information for any block from the reading unit, and sets the value to prohibit any one of the plurality of flags included in the second protection information The semiconductor device according to claim 11, wherein if it is determined, access to the block is prohibited by the second protection information.
前記制御部は、前記第1および第2の保護情報により同一のブロックに対するアクセスが禁止されている場合には、前記第1の保護情報を無視する、請求項11〜14のいずれか1項に記載の半導体装置。  The control unit according to any one of claims 11 to 14, wherein when the access to the same block is prohibited by the first and second protection information, the control unit ignores the first protection information. The semiconductor device described. 前記制御部は、さらに、前記読出部から前記第2の保護情報を受け、前記第2の保護情報によりアクセスを禁止され得るいずれかのブロックにおいてアクセスが禁止されていれば、前記第2の保護情報によりアクセスを禁止され得るすべてのブロックに対するアクセスが禁止されていると判断する、請求項11〜15のいずれか1項に記載の半導体装置。  The control unit further receives the second protection information from the reading unit, and if the access is prohibited in any of the blocks that can be prohibited by the second protection information, the second protection information The semiconductor device according to claim 11, wherein access to all blocks whose access can be prohibited by information is determined to be prohibited. 前記第2の保護情報は、少なくとも2以上のブロックに対するアクセスを禁止し、
前記制御部は、前記第2の保護情報がアクセスを禁止し得るブロックのそれぞれに対して、互いに独立にアクセスを許可するか否かを決定する、請求項11〜15のいずれか1項に記載の半導体装置。
The second protection information prohibits access to at least two or more blocks,
The control unit according to any one of claims 11 to 15, wherein the control unit determines whether to permit access to each of the blocks that can be prohibited from access by the second protection information, independently of each other. Semiconductor device.
前記第1の保護情報は、前記データ領域に含まれる複数のブロックのうち、少なくとも1以上のブロックに対してアクセスを禁止する、請求項11〜17のいずれか1項に記載の半導体装置。  The semiconductor device according to claim 11, wherein the first protection information prohibits access to at least one block among a plurality of blocks included in the data area. 前記データ領域は、前記保護情報領域を含む、請求項11〜18のいずれか1項に記載の半導体装置。  The semiconductor device according to claim 11, wherein the data area includes the protection information area.
JP2005178829A2005-06-202005-06-20 Semiconductor deviceExpired - LifetimeJP4584044B2 (en)

Priority Applications (5)

Application NumberPriority DateFiling DateTitle
JP2005178829AJP4584044B2 (en)2005-06-202005-06-20 Semiconductor device
US11/454,797US7421534B2 (en)2005-06-202006-06-19Data protection for non-volatile semiconductor memory using block protection flags
US12/180,666US7822914B2 (en)2005-06-202008-07-28Data protection for non-volatile semiconductor memory using block protection flags
US12/884,862US7979630B2 (en)2005-06-202010-09-17Data protection for non-volatile semiconductor memory block using block protection flags
US13/116,433US8156280B2 (en)2005-06-202011-05-26Data protection for non-volatile semiconductor memory using block protection

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
JP2005178829AJP4584044B2 (en)2005-06-202005-06-20 Semiconductor device

Related Child Applications (1)

Application NumberTitlePriority DateFiling Date
JP2010151059ADivisionJP4865064B2 (en)2010-07-012010-07-01 Semiconductor device

Publications (3)

Publication NumberPublication Date
JP2006350885Atrue JP2006350885A (en)2006-12-28
JP2006350885A5 JP2006350885A5 (en)2008-05-29
JP4584044B2 JP4584044B2 (en)2010-11-17

Family

ID=37573204

Family Applications (1)

Application NumberTitlePriority DateFiling Date
JP2005178829AExpired - LifetimeJP4584044B2 (en)2005-06-202005-06-20 Semiconductor device

Country Status (2)

CountryLink
US (4)US7421534B2 (en)
JP (1)JP4584044B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007188383A (en)*2006-01-162007-07-26Oki Electric Ind Co LtdMicrocomputer
JP2009294893A (en)*2008-06-052009-12-17Rohm Co LtdStorage device and data writing device
WO2012132218A1 (en)*2011-03-312012-10-04ルネサスエレクトロニクス株式会社Processor system and control method therefor
JPWO2015063845A1 (en)*2013-10-282017-03-09富士通株式会社 Data storage device, data storage method, and data storage program

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
TWI343531B (en)*2003-12-192011-06-11Oce Tech BvErasing a stored information pattern on a storage medium
KR100866951B1 (en)*2005-10-282008-11-05삼성전자주식회사 Programmable Processors and Methods to Protect Data Stored in Memory
US9627081B2 (en)*2007-10-052017-04-18Kinglite Holdings Inc.Manufacturing mode for secure firmware using lock byte
US8924672B2 (en)*2011-02-082014-12-30Infineon Technologies AgDevice with processing unit and information storage
JP5876364B2 (en)*2012-04-132016-03-02ラピスセミコンダクタ株式会社 Semiconductor memory and data reading method
GB2513727B (en)*2012-06-272015-06-24Nordic Semiconductor AsaMemory protection
CN103530242B (en)*2012-07-062016-02-17河南思维自动化设备股份有限公司Nand Flash memorizer write operation process power down means of defence
JP6241373B2 (en)*2014-06-192017-12-06株式会社デンソー Storage device, flash memory control device, and program
CN104598402B (en)*2014-12-302017-11-10北京兆易创新科技股份有限公司A kind of control method of flash controller and flash controller
CN111968693B (en)*2020-08-212022-08-05广芯微电子(广州)股份有限公司MCU and MCU debugging interface control method
US12013791B2 (en)2021-06-012024-06-18International Business Machines CorporationReset dynamic address translation protection instruction
US11593275B2 (en)2021-06-012023-02-28International Business Machines CorporationOperating system deactivation of storage block write protection absent quiescing of processors
US20230177173A1 (en)*2021-12-052023-06-08PUFsecurity CorporationElectronic device and method for performing permission management of storage device

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JPS62194565A (en)*1986-02-211987-08-27Hitachi Micro Comput Eng LtdLsi incorporating non-volatile memory
JPH07244611A (en)*1994-03-041995-09-19Toshiba Corp Microcomputer with built-in memory
JPH08292915A (en)*1995-04-201996-11-05Matsushita Electric Ind Co Ltd Integrated circuit device with non-volatile memory
JPH09114743A (en)*1995-10-161997-05-02Nec CorpSingle chip microcomputer
JPH10301855A (en)*1997-02-271998-11-13Seiko Epson Corp Semiconductor devices and electronic equipment
JPH11120781A (en)*1997-10-171999-04-30Mitsubishi Electric Corp Semiconductor storage device
JP2001014871A (en)*1999-06-292001-01-19Toshiba Corp Nonvolatile semiconductor memory device
JP2003203012A (en)*2001-10-302003-07-18Matsushita Electric Ind Co Ltd Microcomputer device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JPH04205043A (en)*1990-11-291992-07-27Mitsubishi Electric Corp semiconductor storage device
US5363334A (en)*1993-04-101994-11-08Microchip Technology IncorporatedWrite protection security for memory device
US5592641A (en)*1993-06-301997-01-07Intel CorporationMethod and device for selectively locking write access to blocks in a memory array using write protect inputs and block enabled status
US5353256A (en)*1993-06-301994-10-04Intel CorporationBlock specific status information in a memory device
US5442704A (en)*1994-01-141995-08-15Bull Nh Information Systems Inc.Secure memory card with programmed controlled security access control
US5890191A (en)*1996-05-101999-03-30Motorola, Inc.Method and apparatus for providing erasing and programming protection for electrically erasable programmable read only memory
US6154819A (en)*1998-05-112000-11-28Intel CorporationApparatus and method using volatile lock and lock-down registers and for protecting memory blocks
US6615329B2 (en)*2001-07-112003-09-02Intel CorporationMemory access control system, apparatus, and method
KR100543442B1 (en)*2002-09-062006-01-23삼성전자주식회사 A device for setting the write protection area of the memory blocks of the nonvolatile semiconductor memory device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JPS62194565A (en)*1986-02-211987-08-27Hitachi Micro Comput Eng LtdLsi incorporating non-volatile memory
JPH07244611A (en)*1994-03-041995-09-19Toshiba Corp Microcomputer with built-in memory
JPH08292915A (en)*1995-04-201996-11-05Matsushita Electric Ind Co Ltd Integrated circuit device with non-volatile memory
JPH09114743A (en)*1995-10-161997-05-02Nec CorpSingle chip microcomputer
JPH10301855A (en)*1997-02-271998-11-13Seiko Epson Corp Semiconductor devices and electronic equipment
JPH11120781A (en)*1997-10-171999-04-30Mitsubishi Electric Corp Semiconductor storage device
JP2001014871A (en)*1999-06-292001-01-19Toshiba Corp Nonvolatile semiconductor memory device
JP2003203012A (en)*2001-10-302003-07-18Matsushita Electric Ind Co Ltd Microcomputer device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007188383A (en)*2006-01-162007-07-26Oki Electric Ind Co LtdMicrocomputer
JP2009294893A (en)*2008-06-052009-12-17Rohm Co LtdStorage device and data writing device
WO2012132218A1 (en)*2011-03-312012-10-04ルネサスエレクトロニクス株式会社Processor system and control method therefor
JP5576557B2 (en)*2011-03-312014-08-20ルネサスエレクトロニクス株式会社 Processor system and control method thereof
US9092322B2 (en)2011-03-312015-07-28Renesas Electronics CorporationProcessor system and control method thereof
US9304943B2 (en)2011-03-312016-04-05Renesas Electronics CorporationProcessor system and control method thereof
JPWO2015063845A1 (en)*2013-10-282017-03-09富士通株式会社 Data storage device, data storage method, and data storage program

Also Published As

Publication numberPublication date
US7979630B2 (en)2011-07-12
JP4584044B2 (en)2010-11-17
US7421534B2 (en)2008-09-02
US7822914B2 (en)2010-10-26
US20080288735A1 (en)2008-11-20
US20110010492A1 (en)2011-01-13
US8156280B2 (en)2012-04-10
US20060285398A1 (en)2006-12-21
US20110231632A1 (en)2011-09-22

Similar Documents

PublicationPublication DateTitle
US7421534B2 (en)Data protection for non-volatile semiconductor memory using block protection flags
JP6306578B2 (en) Memory protection device and protection method
JP3710671B2 (en) One-chip microcomputer, IC card using the same, and access control method for one-chip microcomputer
US6651150B2 (en)Data-processing apparatus and method of controlling the rewriting of a nonvolatile storage device
JP4939387B2 (en) Data processing apparatus and address space protection method
TWI688861B (en)Data processing apparatus and data protection method thereof
JP2007287103A (en)Microcomputer and memory access control method
JP2017504112A (en) Updatable IC wireless device
JP4865064B2 (en) Semiconductor device
US20060112246A1 (en)Program-controlled unit
CN114817935A (en) A chip security boot method
JP2007310834A (en) Data protection method, information processing apparatus, and operating system
JP2011150457A (en)Information processing apparatus and memory access control method
JP7589584B2 (en) Circuit device and electronic device
JP3918089B2 (en) Memory protection circuit
US20060080519A1 (en)Program-controlled unit
JP2004355383A (en) Memory control circuit
JP2006040073A (en) Integrated circuit and access control method thereof
JP2001297013A (en) Rewriting memory contents

Legal Events

DateCodeTitleDescription
A521Request for written amendment filed

Free format text:JAPANESE INTERMEDIATE CODE: A523

Effective date:20080414

A621Written request for application examination

Free format text:JAPANESE INTERMEDIATE CODE: A621

Effective date:20080414

A131Notification of reasons for refusal

Free format text:JAPANESE INTERMEDIATE CODE: A131

Effective date:20100518

A711Notification of change in applicant

Free format text:JAPANESE INTERMEDIATE CODE: A712

Effective date:20100524

A521Request for written amendment filed

Free format text:JAPANESE INTERMEDIATE CODE: A523

Effective date:20100701

TRDDDecision of grant or rejection written
A01Written decision to grant a patent or to grant a registration (utility model)

Free format text:JAPANESE INTERMEDIATE CODE: A01

Effective date:20100824

A01Written decision to grant a patent or to grant a registration (utility model)

Free format text:JAPANESE INTERMEDIATE CODE: A01

A61First payment of annual fees (during grant procedure)

Free format text:JAPANESE INTERMEDIATE CODE: A61

Effective date:20100901

R150Certificate of patent or registration of utility model

Ref document number:4584044

Country of ref document:JP

Free format text:JAPANESE INTERMEDIATE CODE: R150

Free format text:JAPANESE INTERMEDIATE CODE: R150

FPAYRenewal fee payment (event date is renewal date of database)

Free format text:PAYMENT UNTIL: 20130910

Year of fee payment:3

S531Written request for registration of change of domicile

Free format text:JAPANESE INTERMEDIATE CODE: R313531

R350Written notification of registration of transfer

Free format text:JAPANESE INTERMEDIATE CODE: R350

EXPYCancellation because of completion of term

[8]ページ先頭

©2009-2025 Movatter.jp