JPH08138391A - Flash memory control system - Google Patents

Flash memory control system

Info

Publication number
JPH08138391A
JPH08138391A JP27471594A JP27471594A JPH08138391A JP H08138391 A JPH08138391 A JP H08138391A JP 27471594 A JP27471594 A JP 27471594A JP 27471594 A JP27471594 A JP 27471594A JP H08138391 A JPH08138391 A JP H08138391A
Authority
JP
Japan
Prior art keywords
flash memory
block
data
memory
mpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP27471594A
Other languages
Japanese (ja)
Inventor
Shigeru Shibukawa
滋 渋川
Nobuyuki Echigo
信幸 越後
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.)
Hitachi Instruments Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Instruments Engineering Co Ltd
Hitachi Ltd
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 Hitachi Instruments Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Instruments Engineering Co Ltd
Priority to JP27471594A priority Critical patent/JPH08138391A/en
Publication of JPH08138391A publication Critical patent/JPH08138391A/en
Pending legal-status Critical Current

Links

Landscapes

  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PURPOSE: To obtain a flash memory control system in which abnormality can be analyzed effectively while enhancing the maintainability. CONSTITUTION: The flash memory control system comprises a block erasure flag 5 being set at the time of block erasure of a flash memory, and a flag set circuit 6 for controlling the flag wherein the content can be confirmed by means of a MPU 1 through a status register 7. Since the MPU 1 can decides whether the block of a flash memory for which an error is detected is already written in, a decision can be made whether a detected error represents an abnormality in the memory itself.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、フラッシュメモリを記
憶装置とするコンピュータシステムにおいて、エラーチ
ェックビット記憶用の領域を持つフラッシュメモリ制御
方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a flash memory control system having an area for storing error check bits in a computer system having a flash memory as a storage device.

【0002】[0002]

【従来の技術】フラッシュメモリは、その内容の書き込
み/消去に専用の治具を必要とせず、プリント基板に実
装した状態で内容の書き込み/消去が電気的に行える読
み出し専用メモリ(Read Only Memory:ROM)であ
る。従来のEEPROM(ElectricallyErasable and Program
mable Read Only Memory)に比べ、メモリセルの構造が
単純であるため、高集積化/大容量化が可能である。こ
のことから、小型のコンピュータシステムにおいて、フ
ロッピーディスクやハードディスの代用等として広く使
用されるようになってきている。
2. Description of the Related Art A flash memory does not require a dedicated jig for writing / erasing its contents, and is a read-only memory (Write Only Memory) capable of electrically writing / erasing contents while mounted on a printed circuit board. ROM). Conventional EEPROM (Electrically Erasable and Program
Since the structure of the memory cell is simpler than that of a mable read only memory), higher integration / capacity can be achieved. For this reason, it has been widely used as a substitute for a floppy disk or a hard disk in a small computer system.

【0003】フラッシュメモリ3を記憶装置として用い
たコンピュータシステムの例を図2に示す。この図に示
す装置は、フラッシュメモリからプログラム又はデータ
を読み出し処理を実行すると共に、フラシュメモリに対
する書き込みを行うマイクロプロセッサユニット(以下
MPU)1,フラッシュメモリからデータを読みだす
際、チェックビットと照合しそのデータが適正であるか
を検出するエラーチェック回路2、及びMPUのフラシ
ュメモリへのデータ書き込み時に、書き込みタイミング
を作り出すメモリ書き込み制御回路12、及びアドレス
デコーダにより構成される。現在、市販されているフラ
ッシュメモリの多くは、メモリを複数のブロックに分割
し、各ブロック単位で内容の一括消去を行い、その後、
消去したブロックに対してデータの書き込みを行う方式
であり、データ(又はチェックビット)の消去/書き込
みは、MPUのプログラムによりメモリに対し、コマン
ドを入力することで実行される。フラッシュメモリに対
し、ブロック消去/書き込みを行う場合、MPUはアド
レスバス上にメモリがマッピングされている空間のアド
レスを出力すると共にデータ書き込みコマンドの第一番
目のパラメータを出力する。アドレスデコーダ4は、ア
ドレスバス上の信号により、フラッシュメモリが選択さ
れたことを認識すると、メモリ書き込み制御回路に対し
てアクセス信号8を出力し、アクセス開始を知らせる。
アクセス信号を受けたメモリ書き込み制御回路は、MP
UからのMPU書き込み信号9を確認し、フラッシュメ
モリへの書き込みであると認識したならば、メモリ書き
込み信号10を出力する。そして、書き込み実行後、メ
モリ書き込み制御回路はメモリ書き込み信号の出力を停
止すると共に、バス応答信号11により、1回のアクセ
スが終了したことをMPUに報告する。これらの動作を
繰り返し、フラッシュメモリに対して必要なコマンドの
書き込み動作を行う事により、ブロックの消去/書き込
みは終了する。
An example of a computer system using the flash memory 3 as a storage device is shown in FIG. The device shown in this figure executes a process of reading a program or data from a flash memory, and at the same time a microprocessor unit (hereinafter referred to as MPU) 1 for writing to the flash memory, checks the check bit when reading the data from the flash memory. It is composed of an error check circuit 2 for detecting whether the data is proper, a memory write control circuit 12 for creating a write timing when writing data to the flash memory of the MPU, and an address decoder. Currently, most of the flash memories on the market are divided into a plurality of blocks, and the contents of each block are erased collectively.
This is a method of writing data to an erased block, and erasing / writing of data (or check bit) is executed by inputting a command to the memory by the program of the MPU. When performing block erasing / writing on the flash memory, the MPU outputs the address of the space where the memory is mapped on the address bus and the first parameter of the data write command. When the address decoder 4 recognizes that the flash memory is selected by the signal on the address bus, it outputs the access signal 8 to the memory write control circuit to notify the start of access.
Upon receiving the access signal, the memory write control circuit
If the MPU write signal 9 from U is confirmed and it is recognized that the writing is to the flash memory, the memory write signal 10 is output. Then, after the writing is executed, the memory writing control circuit stops the output of the memory writing signal, and notifies the MPU of the completion of one access by the bus response signal 11. By repeating these operations and performing a necessary command write operation to the flash memory, the block erase / write operation is completed.

【0004】MPUからのコマンド入力により書き込ま
れたデータ、及びチェックビットはメモリからデータを
読みだす際に両方一緒に読み出され、エラーチェック回
路にて照合されることとなる。
The data written by the command input from the MPU and the check bit are read together when the data is read from the memory and collated by the error check circuit.

【0005】[0005]

【発明が解決しようとする課題】フラッシュメモリは、
製造プロセスの微細化/高密度大容量化にともない、外
部の放射線,磁界,電界等各種外乱の影響を受けやすく
なっており、ソフトエラー発生の頻度が多くなることが
予想される。そのため、ソフトエラーによるシステムダ
ウンを最小限におさえ、信頼性の高いコンピュータシス
テムを構築するためには、パリティチェックやECC
(Error Check and Correct )等のメモリチェック機構
の付加が必要不可欠なものとなってくる。これらのメモ
リチェック機構では、チェック用のビットをデータ格納
用の領域とは別に設け、データバス上のデータの内容に
よってチェックビットを自動生成し、データと一緒に書
き込む。そして、メモリの読み出し時にデータ部とチェ
ックビット部を照合し、もしその内容が不適合であれば
データエラーとしてMPUに報告する。
The flash memory is
As the manufacturing process becomes finer / higher density and larger in capacity, it is likely to be affected by various external disturbances such as external radiation, magnetic field, and electric field, and it is expected that the frequency of soft errors will increase. Therefore, in order to minimize the system down due to soft error and build a highly reliable computer system, parity check and ECC are required.
The addition of a memory check mechanism such as (Error Check and Correct) will become indispensable. In these memory check mechanisms, a check bit is provided separately from a data storage area, a check bit is automatically generated according to the content of data on the data bus, and the check bit is written together with the data. Then, when reading the memory, the data part and the check bit part are collated, and if the contents are incompatible, it is reported to the MPU as a data error.

【0006】フラッシュメモリの消去は、数十バイトか
ら数百バイトのブロック単位で実行されるものが多数を
占めており、データを書き込む際には、一旦、一つのブ
ロックを消去した後、そのブロック全域に対しデータの
書き込みを行わなければならない。そのため、フラッシ
ュメモリをチェックビット付きの構成とした場合、もし
誤ってデータ消去後、書き込みが行われていないブロッ
クに対しデータ読み出しを行った場合、データ部とチェ
ックビットとの不適合が発生し、データエラーと判定さ
れることとなる。そのような場合、そのデータエラーが
メモリアクセスを誤ったために発生したものか、本当に
メモリエラーが発生した物であるかを判断するのが非常
に困難となる。
Most of the erasing of the flash memory is executed in block units of several tens to several hundred bytes. When writing data, once erasing one block, the block is erased. Data must be written to the entire area. Therefore, if the flash memory is configured with a check bit, if data is mistakenly erased and then data is read from a block that has not been written, a mismatch between the data section and the check bit will occur It will be judged as an error. In such a case, it is very difficult to judge whether the data error is caused by an erroneous memory access or the memory error is actually caused.

【0007】[0007]

【課題を解決するための手段】以上の問題点を解決する
ため本発明はフラッシュメモリからのデータ読み出し時
のエラー検出時に、そのエラー発生要因の識別を容易に
行えるようにすることで、メモリの信頼性/保守性の向
上を図る。
In order to solve the above problems, the present invention makes it possible to easily identify the cause of an error when an error is detected when reading data from a flash memory. Improve reliability / maintenance.

【0008】本発明におけるフラッシュメモリ管理方式
を図1に示す。本発明は、フラッシュメモリ3に対する
データの読み出し/書き込みは、MPU1によって実行
される。フラッシュメモリからデータを読み出し制御部
は、フラッシュメモリアクセスの検知を行うアドレスデ
コーダ4,データ記憶部31から読み出された内容と、
チェックコード記憶部32から読み出された内容とを照
合し、データ異常の有無をチェックするエラーチェック
回路2により構成される。一方、フラッシュメモリの消
去/未書き込みといった状態の管理は、ブロック消去フ
ラグ5,フラグセット回路6、及びステータスレジスタ
7により行われる。
FIG. 1 shows a flash memory management system according to the present invention. According to the present invention, reading / writing of data with respect to the flash memory 3 is executed by the MPU 1. The control unit for reading data from the flash memory reads the contents read from the address decoder 4, which detects the flash memory access, and the data storage unit 31,
The error check circuit 2 is configured to check the presence or absence of data abnormality by collating with the contents read from the check code storage unit 32. On the other hand, management of the erased / unwritten state of the flash memory is performed by the block erase flag 5, the flag set circuit 6, and the status register 7.

【0009】フラッシュメモリのブロック消去を行う場
合、MPUはフラッシュメモリに対してブロック消去の
コマンド、及び消去するブロックを指定するパラメータ
を書き込むことにより実行する。メモリアクセスを検出
したアドレスデコーダは、アクセス信号8によって、フ
ラッシュメモリに対するメモリアクセスを指定する。こ
のメモリアクセス信号と、MPUからのMPU書き込み
信号9により、メモリ書き込み制御回路12が書き込み
アクセスであると判断すると、メモリ書き込み制御回路
はメモリ書き込み信号10を出力し、書き込みを実行す
る。そして、1回のメモリアクセスサイクル終了時に、
MPUに対してバス応答信号11で応答する。この際、
フラグセット回路はアクセス信号とMPUからのMPU
書き込み信号、及び書き込まれるデータの内容により、
このメモリアクセスがブロック消去であると認識する
と、ブロック消去フラグセットの待機状態に移行する。
そして、続いて消去するブロックが指定されると、各ブ
ロック毎に付加されているブロック消去フラグ中、消去
を指定したブロックのセットを行う。ブロック消去フラ
グの内容は、ステータスレジスタを通してMPUが認識
することが可能であり、それによってどのブロックの消
去が現在行われているのかを知ることができる。MPU
は、メモリの消去後、そのブロックに対しデータを書き
込み、1ブロック全域に対し書き込みが完了した時点
で、ステータスレジスタを通じてフラグのクリアを実行
する。
When erasing a block of the flash memory, the MPU executes it by writing a block erasing command and a parameter designating a block to be erased in the flash memory. The address decoder that has detected the memory access specifies the memory access to the flash memory by the access signal 8. When the memory write control circuit 12 determines that the write access is made by the memory access signal and the MPU write signal 9 from the MPU, the memory write control circuit outputs the memory write signal 10 to execute the write. Then, at the end of one memory access cycle,
It responds to the MPU with a bus response signal 11. On this occasion,
The flag set circuit is an access signal and an MPU from the MPU.
Depending on the content of the write signal and the data to be written,
When it is recognized that this memory access is block erasure, the state shifts to the block erase flag set standby state.
Then, when the block to be erased is designated subsequently, the block designated to be erased is set in the block erase flag added to each block. The contents of the block erasing flag can be recognized by the MPU through the status register, so that which block is currently being erased can be known. MPU
After erasing the memory, after writing the data to the block, when the writing is completed for the entire one block, the flag is cleared through the status register.

【0010】この機構を設けることにより、一ブロック
に対し、データの書き込みが完了していない状態で、そ
のブロックに対しデータの読み出しアクセスを誤って実
行し、メモリエラーが発生したとしても、MPUのエラ
ー処理の中でそのエラーがMPUの処理の不具合に起因
するものか、あるいは本当に発生したメモリエラーであ
るのかを識別が可能となるため、エラー解析の際、有効
でありこれによってメモリの保守性の向上が図れる。
By providing this mechanism, even if a data read access to a block is erroneously executed and a memory error occurs while the data write to the block is not completed, the MPU In error processing, it is possible to identify whether the error is caused by a processing error of the MPU or a memory error that has actually occurred, so it is effective during error analysis, and this makes memory maintenance easier. Can be improved.

【0011】[0011]

【作用】本発明において、フラッシュメモリ3に対する
データの読み出し,書き込み、及びブロック消去といっ
た制御は、MPU1によって実行される。データをフラ
ッシュメモリから読み出す場合、MPUはフラッシュメ
モリ中の指定アドレスを出力しアクセスを開始する。M
PUからの指定アドレスを受けたアドレスデコーダ4
は、アドレス指定がフラッシュメモリであると判断する
と、データ記憶部31とチェックコード記憶部32から
データを読み出し、これをエラーチェック回路2で照合
し、データ異常の有無のチェックを行う。その結果、デ
ータとチェックコードとの間に不適合があった場合、デ
ータ異常としてMPUに報告する。データの読み出しを
行った場合、そのブロックのフラッシュメモリの内容が
有効であるか否かの状態管理は、ブロック消去フラグ
5,フラグセット回路6、及びステータスレジスタ7に
より行われる。
In the present invention, the MPU 1 executes control such as data read / write and block erase with respect to the flash memory 3. When reading data from the flash memory, the MPU outputs the specified address in the flash memory and starts access. M
Address decoder 4 which receives the specified address from PU
When it is determined that the addressing is the flash memory, the data is read from the data storage unit 31 and the check code storage unit 32, the error check circuit 2 collates the data, and the presence or absence of data abnormality is checked. As a result, if there is a mismatch between the data and the check code, it is reported to the MPU as a data abnormality. When data is read, the block erase flag 5, the flag set circuit 6, and the status register 7 manage the state of whether or not the contents of the flash memory of the block are valid.

【0012】フラッシュメモリのブロック消去は、MP
Uはフラッシュメモリに対してブロック消去のコマン
ド、及び消去するブロックを指定するパラメータをフラ
ッシュメモリに対して書き込むといったプロトコルを行
うことにより実行される。メモリアクセスを検出したア
ドレスデコーダは、アクセス信号8によって、フラッシ
ュメモリに対するメモリアクセスを指定する。このメモ
リアクセス信号と、MPUからのMPU書き込み信号9に
より、メモリ書き込み制御回路12が書き込みアクセス
であると判断すると、メモリ書き込み制御回路はメモリ
書き込み信号10を出力し書き込みを実行する。そし
て、1回のメモリアクセスサイクル終了時に、バス応答
信号11をMPUに対して応答する。この際、フラグセ
ット回路はアクセス信号とMPUからのMPU書き込み
信号、及び書き込まれるデータの内容により、この書き
込みメモリアクセスがブロック消去であると認識する
と、ブロック消去フラグセットの待機状態に移行し、フ
ラグセットを行う準備状態となる。この待機状態となっ
た後に、続いて消去するブロックを指定する情報が指定
されると、この情報に従って各ブロック毎に付加されて
いるブロック消去フラグ中、消去を行うブロックに該当
するフラグのセットを行う。ブロック消去フラグの内容
は、ステータスレジスタを通してMPUが認識すること
が可能であり、それによってどのブロックの消去が現
在、行われているのかを知ることができる。MPUは、
メモリのブロック消去後、そのブロックに対しフラッシ
ュメモリの書き込みプロトコルに従いデータ、及びチェ
ックコードの書き込みを行い、消去を行ったブロック全
域に対し書き込みが完了した時点で、ステータスレジス
タを通じてブロック消去フラグのクリアを実行し、その
ブロック内のデータ有効(書き込み済)の状態とする。
Block erase of flash memory is performed by MP
U is executed by executing a protocol such as a block erasing command for the flash memory and a parameter for designating a block to be erased in the flash memory. The address decoder that has detected the memory access specifies the memory access to the flash memory by the access signal 8. When the memory write control circuit 12 determines that the memory access signal is the write access by the memory access signal and the MPU write signal 9 from the MPU, the memory write control circuit outputs the memory write signal 10 to execute the write. Then, at the end of one memory access cycle, the bus response signal 11 is returned to the MPU. At this time, if the flag set circuit recognizes that the write memory access is block erase based on the access signal, the MPU write signal from the MPU, and the content of the data to be written, it shifts to the block erase flag set standby state and the flag is set. It is ready to set. After this standby state, when the information designating the block to be erased is subsequently designated, among the block erase flags added for each block according to this information, the flag set corresponding to the block to be erased is set. To do. The contents of the block erasing flag can be recognized by the MPU through the status register, and thereby, which block is currently being erased can be known. MPU is
After erasing a block of memory, write the data and check code to that block according to the write protocol of the flash memory, and when the writing is completed for the entire erased block, clear the block erase flag through the status register. Execute and make the data in that block valid (written).

【0013】もし、消去後、まだ書き込みが完了してい
ないブロックに対してMPUが読み出しアクセスを行っ
た場合、データとチェックコードとの間で、内容の不適
合が発生するためデータエラーが発生する。しかし、こ
の機構を設けることにより、データエラー検出時にその
発生要因が1ブロックに対し、データの書き込みが完了
していない状態で、そのブロックに対しデータの読み出
しアクセスを誤って実行した結果によるものか(MPU
ソフトウエアの異常)、本当のメモリエラー(ハードウ
エア異常)によるものであるかをMPUのメモリエラー
処理の中で識別が可能となるため、エラー解析の際、有
効である。これによってメモリの保守性の向上が図れ
る。
If the MPU performs a read access to a block which has not been written yet after the erasure, a data error occurs because a mismatch of the contents occurs between the data and the check code. However, by providing this mechanism, the cause of the data error detection at the time of data error detection may be the result of erroneously executing the data read access to the block while the data write to the block is not completed. (MPU
This is effective at the time of error analysis because it is possible to identify in the MPU memory error processing whether it is due to a software error) or a true memory error (hardware error). As a result, the maintainability of the memory can be improved.

【0014】[0014]

【実施例】本発明によるフラッシュメモリ書き込み方式
の一実施例を図3のブロック図により説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a flash memory writing system according to the present invention will be described with reference to the block diagram of FIG.

【0015】本実施例において、MPU1はフラッシュ
メモリ3に格納されているプログラム、又はデータを読
み込み、その内容を使用して処理を行う。フラッシュメ
モリの内容消去/書き込みは、プログラムバージョンア
ップ時にMPUによって実行される。書き込みに当たっ
ては、フラッシュメモリのデータ記憶部31とチェック
コード記憶部32とは独立して行われる。メモリアクセ
スを検出したアドレスデコーダは、アクセス信号8によ
って、フラッシュメモリに対するメモリアクセスを指定
する。このメモリアクセス信号と、MPUからのMPU
書き込み信号9により、メモリ書き込み制御回路12が
書き込みアクセスであると判断すると、メモリ書き込み
制御回路はメモリ書き込み信号を出力し書き込みを実行
する。データ記憶部への書き込みを行う場合、書き込み
制御レジスタ13によりデータ記憶部書き込みモードを
指定することにより、フラッシュメモリの書き込み信号
がデータ記憶部に対してのみ書き込み信号15出力され
る状態となるため、この状態で書き込みコマンドの書き
込みなどのプロトコルを実行し、書き込みが実行され
る。又、同様にチェックコード記憶部に対して書き込み
を行う場合には、書き込み制御レジスタによりチェック
コード記憶部書き込みモードを指定した後、MPUで計
算を行ったチェックコードを書き込むことで、チェック
コード記憶部に対してのみ書き込み信号16が出力され
る。尚、1回のメモリアクセスサイクルに対し、バス応
答信号11が応答される。
In this embodiment, the MPU 1 reads a program or data stored in the flash memory 3 and uses the contents to perform processing. The erasing / writing of the contents of the flash memory is executed by the MPU when the program version is updated. In writing, the data storage unit 31 and the check code storage unit 32 of the flash memory are performed independently. The address decoder that has detected the memory access specifies the memory access to the flash memory by the access signal 8. This memory access signal and MPU from MPU
When the memory write control circuit 12 determines from the write signal 9 that it is a write access, the memory write control circuit outputs a memory write signal and executes writing. When writing to the data storage unit, by designating the data storage unit write mode by the write control register 13, the write signal of the flash memory is output to the write signal 15 only to the data storage unit. In this state, a protocol such as writing a write command is executed, and the writing is executed. Similarly, when writing to the check code storage unit, the check code storage unit write mode is specified by the write control register, and then the check code calculated by the MPU is written, so that the check code storage unit is written. The write signal 16 is output only to. The bus response signal 11 is responded to for one memory access cycle.

【0016】データをフラッシュメモリから読み出す場
合、MPUはフラッシュメモリ中の指定アドレスを出力
しアクセスを開始する。MPUからの指定アドレスを受
けたアドレスデコーダ4は、アドレス指定がフラッシュ
メモリであると判断すると、データ記憶部とチェックコ
ード記憶部から、上記の手順で書き込みが行われた内容
を同時に読み出し、これをエラーチェック回路2で照合
し、データ異常の有無のチェックを行う。その結果、デ
ータとチェックコードとの間に不適合があった場合、バ
ス応答信号と共にデータエラー信号14が応答され、デ
ータ異常としてMPUに報告される。
When reading data from the flash memory, the MPU outputs the specified address in the flash memory and starts access. When the address decoder 4 receives the designated address from the MPU and determines that the address designation is the flash memory, it simultaneously reads the contents written in the above procedure from the data storage unit and the check code storage unit, and reads the contents. The error check circuit 2 collates and checks whether there is a data abnormality. As a result, when there is a mismatch between the data and the check code, the data error signal 14 is responded together with the bus response signal, and is reported to the MPU as a data abnormality.

【0017】フラッシュメモリのブロック消去は、MP
Uはフラッシュメモリに対してブロック消去のコマン
ド、及び消去するブロックを指定するパラメータをフラ
ッシュメモリに対して書き込むといったプロトコルを行
うことにより実行される。書き込み動作に関しては、デ
ータの書き込み時と同様であるが、書き込み制御レジス
タによりブロック消去モードを指定することによって、
データ記憶部とチェックコード記憶部の両方に対してメ
モリ書き込み信号が出力されるようになるため、デー
タ,チェックコードの両方が同時に消去できる。フラグ
セット回路6は書き込み制御レジスタによりブロック消
去であると認識すると、ブロック消去フラグセットの待
機状態に移行し、メモリ書き込み信号の出力回数をカウ
ント待ちの状態となる。この待機状態となった後に、メ
モリ書き込み信号の回数が消去ブロック指定のパラメー
タの書き込みを示す状態となった場合、この情報に従っ
て各ブロック毎に付加されているブロック消去フラグ5
中、消去を行うブロックに該当するフラグのセットを行
う。ブロック消去フラグがセットされた場合、その内容
は、ステータスレジスタ7を通してMPUが読み出すこ
とが可能であり(消去されたブロックのビットは、1を
示す)、それによってどのブロックの消去が現在、行わ
れているのかを知ることができる。MPUは、メモリの
ブロック消去後、そのブロックに対しフラッシュメモリ
の書き込みプロトコルに従いデータ、及びチェックコー
ドの書き込みを行い、ブロックに対し書き込みが完了し
た時点で、ステータスレジスタ中の該当ビットに1を書
き込む。それによってブロック消去フラグの内容はクリ
アされ、その時点でブロック内のデータは有効(書き込
み済)となる。
Block erasing of flash memory is performed by MP
U is executed by executing a protocol such as a block erasing command for the flash memory and a parameter for designating a block to be erased in the flash memory. The write operation is the same as when writing data, but by specifying the block erase mode with the write control register,
Since the memory write signal is output to both the data storage unit and the check code storage unit, both the data and the check code can be erased at the same time. When the flag set circuit 6 recognizes the block erase by the write control register, it shifts to the block erase flag set standby state and waits for the number of output of the memory write signal. After the standby state, when the number of times of the memory write signal indicates the state of writing the parameter for designating the erase block, the block erase flag 5 added to each block according to this information.
The flag corresponding to the block to be erased is set. If the block erase flag is set, its contents can be read by the MPU through the status register 7 (the erased block bit indicates 1), which block is currently being erased. You can know what is going on. After erasing the block of the memory, the MPU writes the data and the check code to the block according to the write protocol of the flash memory, and when the writing is completed to the block, writes 1 to the corresponding bit in the status register. As a result, the contents of the block erase flag are cleared, and the data in the block is valid (written) at that point.

【0018】もし、消去後、まだ書き込みが完了してい
ないブロックに対してMPUが読み出しアクセスを行っ
た場合、データとチェックコードとの間で、内容の不適
合が発生するためデータエラー信号が出力され、データ
エラー検出となる。しかし、MPUのエラー処理の中に
おいて、ステータスレジスタの内容と、エラーを検出し
たフラッシュメモリのアドレスを照合することにより、
データの書き込みが完了していない状態で、そのブロッ
クに対しデータの読み出しアクセスを誤って実行した結
果によるものか(MPUソフトウエアの異常)、本当の
メモリエラー(ハードウエア異常)によるものであるか
をMPUのメモリエラー処理の中で識別が可能となる。
If, after erasing, the MPU performs a read access to a block in which writing has not been completed, a data error signal is output because a content mismatch occurs between the data and the check code. , Data error is detected. However, in the error processing of the MPU, by collating the contents of the status register with the address of the flash memory where the error is detected,
Whether it is the result of erroneously executing a data read access to the block when data writing is not completed (MPU software error) or a true memory error (hardware error) Can be identified in the memory error processing of the MPU.

【0019】[0019]

【発明の効果】本発明により、アクセスしたフラッシュ
メモリのブロックが既に書き込み済であるかをMPUか
ら認識できるようになるため、検出したエラーがメモリ
自身の異常であるか否かを判断できるようになるため、
異常解析に有効であり、保守性の向上が図れる。
According to the present invention, the MPU can recognize whether the accessed flash memory block has already been written. Therefore, it is possible to determine whether the detected error is an abnormality of the memory itself. Because,
This is effective for abnormality analysis and can improve maintainability.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明によるフラッシュメモリを用いたコンピ
ュータシステムのブロック図。
FIG. 1 is a block diagram of a computer system using a flash memory according to the present invention.

【図2】従来技術によるフラッシュメモリを用いたコン
ピュータシステムのブロック図。
FIG. 2 is a block diagram of a computer system using a flash memory according to the related art.

【図3】実施例におけるフラッシュメモリを用いたコン
ピュータシステムのブロック図。
FIG. 3 is a block diagram of a computer system using a flash memory according to an embodiment.

【符号の説明】[Explanation of symbols]

1…MPU、2…エラーチェック回路、3…フラッシュ
メモリ、4…アドレスデコーダ、5…ブロック消去フラ
グ、6…フラグセット回路、7…ステータスレジスタ、
8…アクセス信号、9…MPU書き込み信号、10…メ
モリ書き込み信号、11…バス応答信号、12…メモリ
書き込み制御回路。
1 ... MPU, 2 ... Error check circuit, 3 ... Flash memory, 4 ... Address decoder, 5 ... Block erasing flag, 6 ... Flag setting circuit, 7 ... Status register,
8 ... Access signal, 9 ... MPU write signal, 10 ... Memory write signal, 11 ... Bus response signal, 12 ... Memory write control circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】電気的書き込み/電気的消去が可能な読み
出し専用メモリであり、メモリの内容が複数個のブロッ
クに分割され、各ブロック単位で消去/書き込み可能な
フラッシュメモリと、前記フラッシュメモリに対してデ
ータの読み出し,書き込みを行うマイクロプロセッサユ
ニット、及び前記マイクロプロセッサユニットが前記フ
ラッシュメモリに対して書き込み/読み出しを行った場
合、前記マイクロプロセッサユニットからのフラシュメ
モリアクセスの検知を行うアドレスデコーダにより構成
されるマイクロコンピュータシステムにおいて、前記フ
ラッシュメモリの構成をプログラム又はデータを記憶し
ておくためのデータ領域と、前記データ領域に記憶され
ている内容に従って決定されるチェックコードを記憶す
るためのチェックコード領域の二つによる構成とすると
ともに、フラッシュメモリのブロック消去を行った場
合、ブロック消去済であり、前記フラッシュメモリに格
納されているデータが無効であることを示すブロック消
去フラグをブロック毎に設け、その内容を前記マイクロ
プロセッサユニットが認識できるブロック消去レジスタ
機構を設けることで、前記フラッシュメモリの状態を管
理できるようにすると共に、前記チェックコードによる
エラーチェック機能を有効に活用できるようにしたこと
を特徴とするフラッシュメモリ制御方式。
1. A flash memory that is an electrically writable / electrically erasable read-only memory, in which the contents of the memory are divided into a plurality of blocks, and each block can be erased / written to A microprocessor unit for reading and writing data from and to the flash memory, and an address decoder for detecting flash memory access from the microprocessor unit when the microprocessor unit writes / reads to / from the flash memory. In the microcomputer system described above, a check for storing a data area for storing a program or data in the configuration of the flash memory, and a check code determined according to the contents stored in the data area Each block has a block erase flag indicating that the block has been erased and the data stored in the flash memory is invalid when the block is erased from the flash memory. By providing a block erasing register mechanism whose contents can be recognized by the microprocessor unit, the state of the flash memory can be managed and the error check function by the check code can be effectively used. A flash memory control method characterized by the above.
JP27471594A 1994-11-09 1994-11-09 Flash memory control system Pending JPH08138391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27471594A JPH08138391A (en) 1994-11-09 1994-11-09 Flash memory control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27471594A JPH08138391A (en) 1994-11-09 1994-11-09 Flash memory control system

Publications (1)

Publication Number Publication Date
JPH08138391A true JPH08138391A (en) 1996-05-31

Family

ID=17545567

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27471594A Pending JPH08138391A (en) 1994-11-09 1994-11-09 Flash memory control system

Country Status (1)

Country Link
JP (1) JPH08138391A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120085A (en) * 1997-10-15 1999-04-30 Matsushita Electric Works Ltd Control system
US6883060B1 (en) 1998-09-28 2005-04-19 Nec Electronics Corporation Microcomputer provided with flash memory and method of storing program into flash memory
US7665009B2 (en) 2005-05-17 2010-02-16 Nec Corporation Device, data sector, method of processing data, and signal-bearing medium embodying program of device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120085A (en) * 1997-10-15 1999-04-30 Matsushita Electric Works Ltd Control system
US6883060B1 (en) 1998-09-28 2005-04-19 Nec Electronics Corporation Microcomputer provided with flash memory and method of storing program into flash memory
US7665009B2 (en) 2005-05-17 2010-02-16 Nec Corporation Device, data sector, method of processing data, and signal-bearing medium embodying program of device

Similar Documents

Publication Publication Date Title
US6601132B2 (en) Nonvolatile memory and method of writing data thereto
US6405332B1 (en) Storage device and alternate processing method for defective sectors of the same
US5875477A (en) Method and apparatus for error management in a solid state disk drive using primary and secondary logical sector numbers
US5159671A (en) Data transfer unit for small computer system with simultaneous transfer to two memories and error detection and rewrite to substitute address
KR100316981B1 (en) Microcomputer provided with flash memory and method of storing program into flash memory
JPH06214892A (en) Solid-state peripheral storage device
CN102043725B (en) Data writing method for flash memory as well as controller and storage system thereof
JPH08235028A (en) Data management method for flash memory and data processor using the data management method
CN116880782B (en) Embedded memory and testing method thereof
JPH09198884A (en) Management method of flash memory
JP2003248631A (en) Memory control circuit and memory control method
JPH08138391A (en) Flash memory control system
JPH0714392A (en) Nonvolatile semiconductor memory and semiconductor disk device using the same
US6535442B2 (en) Semiconductor memory capable of debugging an incorrect write to or an incorrect erase from the same
KR100692982B1 (en) NAND type flash memory for recording bad block information
JPH0729392A (en) Nonvolatile semiconductor memory and semiconductor disk device using the same
JP2000357216A (en) Ic card
JP2003150458A (en) Fault detector, fault detecting method, program and program recording medium
JPH07122087A (en) Eeprom error check system
JP4131147B2 (en) Determination method of flash memory in printer, program for causing computer to execute this method, recording medium recording this program, and printer including flash memory
JP3019346B2 (en) Data processing device
JPH10241377A (en) Non-volatile semiconductor memory
JP2003099333A (en) Management system for flash memory
JPS6346461B2 (en)
KR830002883B1 (en) Micro programmable controller