JPH0817191A - Memory management area control method - Google Patents
Memory management area control methodInfo
- Publication number
- JPH0817191A JPH0817191A JP16866494A JP16866494A JPH0817191A JP H0817191 A JPH0817191 A JP H0817191A JP 16866494 A JP16866494 A JP 16866494A JP 16866494 A JP16866494 A JP 16866494A JP H0817191 A JPH0817191 A JP H0817191A
- Authority
- JP
- Japan
- Prior art keywords
- area
- data
- data address
- address
- written
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 238000007726 management method Methods 0.000 description 34
- 238000010586 diagram Methods 0.000 description 5
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
Landscapes
- Read Only Memory (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
(57)【要約】
【目的】 フラシュメモリのINDEXエリアのイレー
ス動作中に電源停止の障害が発生しても、最後に書き込
んだデータアドレスを確実に保全することができ、また
電源立上時に最後に書き込んだデータアドレスを正確に
取得して次に書き込みできるアドレスを得ることができ
るメモリ管理エリア制御方法を提供する。
【構成】 終了分割INDEXエリアサーチ手段11で
終了コードが付された分割INDEXエリアを検出し、
そのエリア以降の最後尾フラグを最後尾フラグサーチ手
段12で検出し、検出したフラグの直前に書き込まれた
データアドレスをフラシュメモリ40のデータエリア4
2に最終的に書き込まれたアドレスとして取得し、分割
INDEXエリアにデータアドレスを書き込んで当該エ
リアが一杯になるとそのエリアに終了コードを付加して
一つ前のエリアをイレース手段33でイレースするメモ
リ管理制御方法である。
(57) [Abstract] [Purpose] Even if a power failure occurs during the erase operation of the flash memory INDEX area, the last written data address can be surely preserved, and the last data address can be saved when the power is turned on. Provided is a memory management area control method capable of accurately acquiring a data address written in a memory and obtaining a next writable address. [Structure] The divided end INDEX area search means 11 detects a divided INDEX area with an end code,
The last flag after that area is detected by the last flag search means 12, and the data address written immediately before the detected flag is detected in the data area 4 of the flash memory 40.
A memory which is obtained as the address finally written in 2 and writes a data address in the divided INDEX area, and when the area becomes full, an end code is added to the area and the previous area is erased by the erase means 33. This is a management control method.
Description
【0001】[0001]
【産業上の利用分野】本発明は、フラシュメモリの終了
時のデータアドレスを保全するメモリ管理エリア制御方
法に係り、特にメモリ管理エリアをイレース中に電源停
止等の障害が発生しても終了時のデータアドレスを確実
に保全できるメモリ管理エリア制御方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory management area control method for preserving a data address at the end of a flash memory, and particularly at the end of a flash memory even when a failure such as a power stop occurs while erasing the memory management area. The present invention relates to a memory management area control method capable of reliably preserving the data address of the memory.
【0002】[0002]
【従来の技術】従来、書き換え可能なメモリとしてフラ
シュメモリが知られており、フラシュメモリの終了時の
データが書き込まれているデータアドレスをメモリ管理
エリアで管理するようになっていた。フラシュメモリに
おけるメモリ管理エリア制御方法について図5を使って
説明する。図5は、従来のフラシュメモリのメモリ管理
エリア(INDEXエリア)制御方法を説明するための
概略説明図である。2. Description of the Related Art Conventionally, a flash memory has been known as a rewritable memory, and a data address at which data at the end of the flash memory is written is managed in a memory management area. A memory management area control method in the flash memory will be described with reference to FIG. FIG. 5 is a schematic explanatory view for explaining a memory management area (INDEX area) control method of a conventional flash memory.
【0003】図5に示すように、従来のフラシュメモリ
は、複数のブロックに分割されており、その中で、例え
ば、ブロック1がINDEXエリアに割り当てられ、ブ
ロック2〜ブロックNがデータエリアに割り当てられて
いた。As shown in FIG. 5, the conventional flash memory is divided into a plurality of blocks, in which, for example, block 1 is assigned to the INDEX area and blocks 2 to N are assigned to the data area. It was being done.
【0004】ここで、ブロック1のINDEXエリア
は、ブロック2〜ブロックNのデータエリアにおけるデ
ータが書き込まれたアドレス(データアドレス)を格納
しておくエリアであり、特に前回終了した時にデータが
書き込まれたデータアドレスを電源立上時に参照して次
にアクセス(データを書込むことが)可能なデータアド
レスを取得するようになっている。また、ブロック2〜
ブロックNのデータエリアは、データの読み書きが行わ
れるエリアである。Here, the INDEX area of the block 1 is an area for storing an address (data address) where the data is written in the data areas of the blocks 2 to N, and in particular, the data is written at the time of the previous end. The data address is referred to when the power is turned on, and the next accessible (data can be written) data address is acquired. Also, block 2
The data area of the block N is an area where data is read and written.
【0005】次に、従来のINDEXエリアの制御方法
について図6を使って説明する。図6は、従来のIND
EXエリアの制御方法を示すフローチャート図である。
図6に示すように、制御処理が開始されると、ブロック
1のINDEXエリア内のアクセスされたデータアドレ
スをサーチし、次にアクセス可能なデータアドレスを取
得する(101)。そして、ブロック2〜ブロックNに
おけるデータエリアでのアクセス処理が実行されて(1
02)、データが書き込まれた最後のデータアドレスを
INDEXエリアに書き込みを試みる(103)。Next, a conventional INDEX area control method will be described with reference to FIG. FIG. 6 shows a conventional IND.
It is a flowchart figure which shows the control method of an EX area.
As shown in FIG. 6, when the control process is started, the accessed data address in the INDEX area of the block 1 is searched and the next accessible data address is acquired (101). Then, the access process in the data area in block 2 to block N is executed (1
02), an attempt is made to write the last data address in which data has been written to the INDEX area (103).
【0006】処理103でINDEXエリアがいっぱい
でデータアドレスを書き込むことができるかどうかの判
断が為され(104)、いっぱいでなければデータアド
レスをINDEXエリアに書き込み(105)、処理1
02に戻り、いっぱいであればINDEXエリアのイレ
ース(消去)処理を行う(106)。そして、イレース
が終了したかどうかの判断が為され(107)、イレー
スが終了していなければ処理106に戻り、イレースが
終了したならイレースされたINDEXエリアの先頭に
データアドレスを書き込み(108)、処理102に戻
る。In process 103, it is judged whether the data address can be written when the INDEX area is full (104), and if not, the data address is written in the INDEX area (105), process 1
Returning to 02, if it is full, erase processing of the INDEX area is performed (106). Then, it is judged whether or not the erase is completed (107), and if the erase is not completed, the process returns to step 106, and if the erase is completed, the data address is written at the head of the erased INDEX area (108), Return to processing 102.
【0007】ここで、イレース処理とは、INDEXエ
リアにデータアドレスを逐次書き込んでいくとINDE
Xエリアがいっぱいになってしまった時に、最後にデー
タエリアにデータが書き込まれたデータアドレスを残し
て他のデータアドレスを消去してしまう処理のことであ
る。Here, the erase process means that when data addresses are sequentially written in the INDEX area,
This is a process in which when the X area is full, the last data address in which data has been written is left in the data area and other data addresses are erased.
【0008】具体的には、最後にアクセスした(書込ん
だ)データのデータアドレスをINDEXエリアに書込
む際にINDEXエリアがいっぱいかどうかを判断し、
いっぱいであればまずINDEXエリアを消去(イレー
ス)し、次にイレースしたINDEXエリアの先頭にデ
ータアドレスを書込む処理を行うものである。Specifically, when the data address of the last accessed (written) data is written in the INDEX area, it is determined whether the INDEX area is full,
If it is full, the process of first erasing (erasing) the INDEX area and then writing the data address at the beginning of the erased INDEX area is performed.
【0009】また、従来のフラシュメモリでは、通常の
電源立上時に、INDEXエリアから最後にアクセスさ
れたデータアドレスをサーチするのにまだデータアドレ
スが書き込まれていない箇所をサーチしてその直前に書
き込まれているデータアドレスを読み取って次に書き込
むアドレスを取得するようになっている。Further, in the conventional flash memory, at the time of normal power-on, in searching the last accessed data address from the INDEX area, a portion where the data address is not yet written is searched and written immediately before that. It reads the data address that has been written and obtains the address to be written next.
【0010】具体的には、データアドレスがまだ書き込
まれていない箇所はオール1であるあるので、データア
ドレス4byte(32bit)の内、最初の2byt
e(16bit)がオール1(FFH)をINDEXエ
リアでサーチし、発見されたFFHの直前のデータアド
レスを読み取り、次にアクセス(書込み)できるアドレ
スを取得するものである。Specifically, since the location where the data address is not yet written is all 1, the first 2 bytes of the data address 4 bytes (32 bits) are set.
The e (16 bits) searches the all 1 (FFH) in the INDEX area, reads the data address immediately before the found FFH, and acquires the address that can be accessed (written) next.
【0011】[0011]
【発明が解決しようとする課題】しかしながら、上記従
来のフラシュメモリにおけるINDEXエリア(管理エ
リア)制御方法では、INDEXエリアのイレース動作
中に電源停止等の障害が発生した場合に、INDEXエ
リア内のデータアドレスが全て消去されてしまうか、ま
たは不安定状態になってしまい、その後の電源立上時に
データアドレスを失っているためにフラッメモリにアク
セスすることができず、またアクセスできたとしてもデ
ータ読み出しがおかしくなって、フラシュメモリの信頼
性を低下させるという問題点があった。However, in the above-mentioned conventional INDEX area (management area) control method in the flash memory, when data such as power interruption occurs during the erase operation of the INDEX area, data in the INDEX area is lost. All addresses are erased or become unstable, and the data address is lost when the power is turned on after that, so it is not possible to access the FLA memory, and even if it is possible, the data can be read. However, there is a problem that the reliability of the flash memory is deteriorated due to the malfunction.
【0012】また、上記従来のINDEXエリア制御方
法では、通常の電源立上時に、INDEXエリア内のF
FHをサーチするようになっているので、データアドレ
スとしてFFHを含むアドレスが本当にある場合には、
そのFFHをまだ書き込まれていない箇所であると誤っ
てしまうことになり、次に書き込むことができるアドレ
スを正常に取得できず、やはりフラシュメモリの信頼性
を低下させるという問題点があった。Further, in the above-mentioned conventional INDEX area control method, at the time of normal power-on, the F in the INDEX area is
Since it is designed to search for FH, if there is an address including FFH as a data address,
There is a problem that the FFH is mistaken for a portion that has not been written yet, the address at which writing can be performed next cannot be normally acquired, and the reliability of the flash memory is also lowered.
【0013】本発明は上記実情に鑑みて為されたもの
で、フラシュメモリのINDEXエリア(管理エリア)
のイレース動作中に電源停止の障害が発生しても、最後
に書き込んだデータアドレスを確実に保全することがで
き、また電源立上時に最後に書き込んだデータアドレス
を正確に取得して次に書込みできるアドレスを得ること
ができるメモリ管理エリア制御方法を提供することを目
的とする。The present invention has been made in view of the above circumstances, and is an INDEX area (management area) of a flash memory.
Even if a power failure occurs during the erase operation of the device, the last written data address can be surely preserved, and the last written data address can be acquired accurately at the power-on and the next writing can be performed. It is an object of the present invention to provide a memory management area control method capable of obtaining an available address.
【0014】[0014]
【課題を解決するための手段】上記従来例の問題点を解
決するための請求項1記載の発明は、複数ブロックに分
割されたメモリ管理エリアの制御方法であって、前記メ
モリ管理エリアに終了時のデータアドレスを書き込んだ
際に、前記データアドレスの直後に特定フラグを付加す
るよう試み、当該書き込んだブロック内に前記特定フラ
グを付加する余裕があれば前記特定フラグを付加し、前
記ブロック内に前記特定フラグを付加する余裕がなけれ
ば次のブロックの先頭に前記データアドレスを書き込
み、更に前記データアドレスの直後に前記特定フラグを
付加し、前記データアドレスが最初に書き込まれたブロ
ックの最後に終了コードを付加し、前記データアドレス
が最初に書き込まれたブロックの一つ前のブロックをイ
レースすることを特徴としている。The invention according to claim 1 for solving the problems of the conventional example is a method of controlling a memory management area divided into a plurality of blocks, wherein the memory management area is terminated. At the time of writing the data address at the time, an attempt is made to add a specific flag immediately after the data address, and if there is room to add the specific flag in the written block, the specific flag is added and If there is no room to add the specific flag to, the data address is written at the beginning of the next block, the specific flag is added immediately after the data address, and at the end of the block where the data address is first written. A special feature is that an end code is added to erase the block immediately before the block in which the data address is first written. It is set to.
【0015】上記従来例の問題点を解決するための請求
項2記載の発明は、請求項1記載のメモリ管理エリア制
御方法によって特定フラグが付加されたメモリ管理エリ
アの制御方法であって、電源立上時に終了コードを検索
し、更に前記終了コードから前記特定フラグを検索し、
前記特定フラグの直前に書き込まれているデータアドレ
スから次にアクセスするデータアドレスを取得すること
を特徴としている。A second aspect of the present invention for solving the above-mentioned problems of the conventional example is a method for controlling a memory management area to which a specific flag is added by the memory management area control method according to the first aspect. Search for the end code at startup, and further search for the specific flag from the end code,
The data address to be accessed next is obtained from the data address written immediately before the specific flag.
【0016】[0016]
【作用】請求項1記載の発明によれば、メモリ管理エリ
アが複数のブロックに分割されており、終了時のデータ
アドレスをメモリ管理エリアに書き込んだ後に、そのデ
ータアドレスの直後に特定フラグを付加する処理を行う
が、データアドレスを書き込んだブロックに特定フラグ
を書き込む余裕がなければ次のブロックの先頭にデータ
アドレスを書き込んで特定フラグを付加し、そしてデー
タアドレスが最初に書き込まれたブロックの最後に終了
コードを付加し、更にデータアドレスを最初に書き込ん
だブロックの一つ前のブロックをイレースするメモリ管
理エリア制御方法としているので、メモリ管理エリアの
ブロックのイレース時に電源停止等の障害が発生して
も、終了時のデータアドレスを保全することができる。According to the invention described in claim 1, the memory management area is divided into a plurality of blocks, and after the end data address is written in the memory management area, a specific flag is added immediately after the data address. However, if there is no room to write the specific flag to the block where the data address was written, write the data address at the beginning of the next block to add the specific flag, and the end of the block where the data address was written first. Because the memory management area control method is to erase the block immediately before the block in which the data address was first written, an error such as power stop occurs when erasing the block in the memory management area. However, the data address at the end can be preserved.
【0017】請求項2記載の発明によれば、請求項1記
載のメモリ管理エリア制御方法で処理されたメモリ管理
エリアを有するメモリについて、電源立上時には、まず
終了コードを検索し、更に終了コードから特定フラグを
検索し、特定フラグの直前に書き込まれたデータアドレ
スから次にアクセスするデータアドレスを取得するメモ
リ管理エリア制御方法としているので、電源立上時に保
全されたデータアドレスから次にアクセスするデータア
ドレスを容易に取得することができる。According to the second aspect of the present invention, regarding the memory having the memory management area processed by the memory management area control method according to the first aspect, when the power is turned on, first the end code is searched, and the end code is further searched. The memory management area control method is to retrieve the specific flag from the specified address and obtain the data address to be accessed next from the data address written immediately before the specific flag. The data address can be easily obtained.
【0018】[0018]
【実施例】本発明の一実施例について図面を参照しなが
ら説明する。図1は、本発明の一実施例に係るフラッシ
ュメモリのメモリ管理エリア(INDEXエリア)制御
方法を説明するための概略説明図である。図1に示すよ
うに、本実施例のフラッシュメモリは、従来と同様に複
数のブロックに分割されている。そして、本実施例の特
徴部分として、INDEXエリアを複数のエリアに分割
し、分割されたINDEXエリア(以降、分割INDE
Xエリアと呼ぶ)を各ブロック(ブロック1〜ブロック
N)の先頭部分に設けている。DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a schematic explanatory diagram for explaining a memory management area (INDEX area) control method of a flash memory according to an embodiment of the present invention. As shown in FIG. 1, the flash memory of this embodiment is divided into a plurality of blocks as in the conventional case. Then, as a characteristic part of this embodiment, the INDEX area is divided into a plurality of areas, and the divided INDEX areas (hereinafter, the divided INDEX areas are divided.
An X area) is provided at the beginning of each block (block 1 to block N).
【0019】ここで、INDEXエリアは、従来と同様
にフラッシュメモリ内のデータエリアにおいてデータの
書き込みが終了した時点のアドレス(データアドレス)
を格納しておくエリアであり、特に前回データ書き込み
終了時のデータアドレスを電源立上時に参照して、次に
アクセス(データを書込むことが)可能なデータアドレ
スを取得するようになっている。尚、各ブロックの先頭
部分に設けられた分割INDEXエリアをINDEXエ
リア1〜INDEXエリアNと呼ぶことにする。また、
INDEXエリアは初期状態においてオール”1”に初
期化されている。Here, the INDEX area is an address (data address) at the time when data writing is completed in the data area in the flash memory, as in the conventional case.
Is an area for storing data, and in particular, it refers to the data address at the end of the previous data writing at power-on and acquires the next accessible (data can be written) data address. . The divided INDEX areas provided at the beginning of each block will be referred to as INDEX area 1 to INDEX area N. Also,
The INDEX area is initialized to all "1" in the initial state.
【0020】そして、本実施例のINDEXエリアの制
御方法において、データエリアへのデータ書き込み処理
終了後の制御方法は、データ書き込み終了時のデータア
ドレスをINDEXエリアに格納し、続いて本実施例の
特徴部分である最後尾フラグをデータアドレスの直後に
付加する。そして、次にデータエリアへのデータの書き
込みが終了すると、前回INDEXエリアに最後尾フラ
グを書き込んだ位置に次のデータアドレスを上書きし、
続いて最後尾フラグを付加するようになっている。Then, in the control method of the INDEX area of the present embodiment, the control method after the data writing process to the data area is to store the data address at the end of the data writing in the INDEX area, and then to the control method of the present embodiment. The last flag, which is a characteristic part, is added immediately after the data address. Then, when the writing of the data to the data area is finished next, the next data address is overwritten at the position where the last flag is written in the INDEX area last time,
Then, the last flag is added.
【0021】ここで、最後尾フラグは、INDEXエリ
アに順次データアドレスを書き込んで行った最後尾を示
すフラグで、予め決められた1〜8bitの任意の長さ
を持つ全ビット”1”を除く任意のビット列である。全
ビット”1”を除く理由は、INDEXエリアの初期状
態及びイレース完了状態が全ビット”1”であり、後の
処理で最後尾フラグを検出できなくなるのを防ぐためで
ある。Here, the tail flag is a flag indicating the tail of data addresses sequentially written in the INDEX area, except for all bits "1" having a predetermined arbitrary length of 1 to 8 bits. It is an arbitrary bit string. The reason for excluding all bits “1” is to prevent that the initial state and erase completion state of the INDEX area are all bits “1” and the last flag cannot be detected in the subsequent processing.
【0022】そして上記の処理を繰り返し、あるIND
EXエリア(i) がいっぱいになると、本実施例の特徴的
な処理として、次のブロックのINDEXエリア(i+1)
に書き込み位置を移動してデータアドレス及び最後尾フ
ラグを書き込んでから、INDEXエリア(i) の最後に
終了コードを書き込み、1つ前のブロックのINDEX
エリア(i-1) をイレースするようになっている。Then, the above process is repeated to obtain a certain IND.
When the EX area (i) becomes full, the INDEX area (i + 1) of the next block is a characteristic process of this embodiment.
Move the write position to and write the data address and the last flag, then write the end code at the end of the INDEX area (i) and the INDEX of the previous block.
Area (i-1) is erased.
【0023】ここで、終了コードは、INDEXエリア
内にデータアドレスが書き込まれていっぱいになり、書
き込みが終了したことを示すコードで、予め決められた
1byteの長さを持つ全ビット”1”を除く任意のビ
ット列である。全ビット”1”を除く理由は、INDE
Xエリアの初期状態及びイレース完了状態が全ビット”
1”であり、後の処理で終了コードを検出できなくなる
のを防ぐためである。Here, the end code is a code indicating that the data address has been written in the INDEX area to be full, and the writing has ended, and all bits "1" having a predetermined length of 1 byte are set. Except for any bit string. The reason for excluding all bits "1" is INDE
All bits in the initial state and erased state of the X area "
This is to prevent the end code from becoming undetectable in the subsequent processing.
【0024】また、通常の電源立上時には、前回データ
エリアで最後にデータが書き込まれたアドレス位置の次
から今回のデータを書き始めるために、まずデータエリ
アで最後にデータが書き込まれたデータアドレスを分割
INDEXエリアからサーチして、次のデータ書き込み
アドレスを特定してから、データエリアへのデータの書
き込み処理を行い、それに続いて上述したデータエリア
へのデータ書き込み処理終了後の制御方法として、デー
タアドレスをINDEXエリアに書き込み、続いて最後
尾フラグを付加するようになっている。Further, at the time of normal power-on, in order to start writing the present data from the address position where the data was last written in the previous data area, first, the data address where the last data was written in the data area was started. Is searched from the divided INDEX area, the next data write address is specified, the data write processing to the data area is performed, and subsequently, as a control method after the data write processing to the data area is finished, The data address is written in the INDEX area, and then the last flag is added.
【0025】ここで、最後にデータが書き込まれたデー
タアドレスのサーチは、具体的には、終了コードが格納
されている分割INDEXエリアをサーチし、更にサー
チした分割INDEXエリアから順に最後尾フラグをサ
ーチし、最後尾フラグの直前に格納されているデータア
ドレスを読み込むと、これがデータエリアにおいて最後
にデータが書き込まれたデータアドレスである。Here, in the search of the data address in which the last data is written, specifically, the divided INDEX area in which the end code is stored is searched, and the tail flag is sequentially set from the searched divided INDEX area. When a search is performed and the data address stored immediately before the last flag is read, this is the data address at which the last data was written in the data area.
【0026】一方、INDEXエリアのイレース処理中
に不正に装置の電源をOFFし、イレース処理が正常に
終了しない状態から電源の再立上を行った場合は、上記
の通常の電源再立上の処理中で最後尾フラグがサーチで
きない可能性があり、その場合には、メモリが不定状態
になっていると判断して、イレース処理が完了していな
い分割INDEXエリアをすべてイレースしてメモリ全
体を初期状態にしてから、データエリアへのデータの書
き込み、及びINDEXエリアへのデータアドレスの書
き込みを行うようになっている。On the other hand, when the power of the apparatus is turned off illegally during the erase processing of the INDEX area and the power is restarted from a state where the erase processing is not normally completed, the above normal power restart is performed. There is a possibility that the last flag cannot be searched during processing. In that case, it is determined that the memory is in an undefined state, and erase is performed on all the divided INDEX areas for which erase processing has not been completed, and the entire memory is erased. After the initial state, the writing of data to the data area and the writing of the data address to the INDEX area are performed.
【0027】次に、本実施例のメモリ管理方法を実現す
る手段について、図2を用いて説明する。図2は、本実
施例のメモリ管理方法を実現する手段の機能構成ブロッ
ク図である。本実施例のメモリ管理方法を実現する手段
は、図2に示すように、データエリアにおける最後のデ
ータアドレスをサーチする最終データアドレスサーチ手
段10と、データエリアにデータの書き込みを行うデー
タエリア書き込み手段20と、データエリアにおいて最
後に書き込まれたデータアドレスをINDEXエリアに
書き込む制御を行うデータアドレス書き込み制御手段3
0と、フラッシュメモリ40と、データエリアにおける
データ書き込みアドレスを記憶するデータアドレスエリ
ア51と、INDEXエリアにおけるデータアドレス書
き込みアドレス(INDEXアドレス)を記憶するIN
DEXアドレスエリア52とから構成されている。Next, means for realizing the memory management method of this embodiment will be described with reference to FIG. FIG. 2 is a functional configuration block diagram of means for implementing the memory management method of this embodiment. As shown in FIG. 2, the means for realizing the memory management method of this embodiment is, as shown in FIG. 2, a final data address search means 10 for searching the last data address in the data area and a data area writing means for writing data in the data area. 20 and a data address writing control means 3 for controlling writing of the last written data address in the data area to the INDEX area.
0, a flash memory 40, a data address area 51 for storing a data write address in the data area, and an IN for storing a data address write address (INDEX address) in the INDEX area.
It is composed of a DEX address area 52.
【0028】そして、最終データアドレスサーチ手段1
0の内部は、書き込みが終了した分割INDEXエリア
をサーチする終了分割INDEXエリアサーチ手段11
と、最後尾フラグをサーチする最後尾フラグサーチ手段
12と、分割INDEXエリアをイレースするイレース
手段13と、書き込みが終了した分割INDEXエリア
の番号をストックする終了分割INDEXエリア番号ス
トックエリア14とから構成されている。The final data address search means 1
The inside of 0 is an end divided INDEX area search means 11 for searching a divided INDEX area for which writing has been completed.
A last flag search means 12 for searching the last flag, an erase means 13 for erasing the divided INDEX area, and an end divided INDEX area number stock area 14 for stocking the number of the divided INDEX area for which writing has been completed. Has been done.
【0029】また、データアドレス書き込み制御手段3
0の内部は、INDEXエリアに実際にデータアドレス
を書き込むデータアドレス書き込み手段31と、ある分
割INDEXエリアがいっぱいになり次の分割INDE
Xエリアに切り換える分割INDEXエリア切換手段3
2と、不要になった1つ前の分割INDEXエリアをイ
レースするイレース手段33とから構成されている。Further, the data address write control means 3
In the inside of 0, the data address writing means 31 for actually writing a data address in the INDEX area and a certain divided INDEX area becomes full, and the next divided INDEX is formed.
Divided INDEX area switching means 3 for switching to the X area
2 and an erasing means 33 for erasing an unnecessary divided INDEX area immediately before.
【0030】次に、各部の構成について具体的に説明す
る。フラッシュメモリ40は、複数のブロック(ブロッ
ク1〜ブロックN)に分割されており、各ブロックがデ
ータエリア42と、データエリア42におけるデータが
書き込まれたアドレス(データアドレス)を格納してお
くINDEXエリア41とに分かれている。Next, the configuration of each part will be specifically described. The flash memory 40 is divided into a plurality of blocks (block 1 to block N), and each block stores a data area 42 and an INDEX area for storing an address (data address) in which data in the data area 42 is written. It is divided into 41.
【0031】データアドレスエリア51は、フラッシュ
メモリ40のデータエリア42においてデータを書き込
むアドレスを記憶するエリアである。また、INDEX
アドレスエリア52は、フラッシュメモリ40のIND
EXエリア41においてデータアドレスを書き込むアド
レス(INDEXアドレス)を記憶するエリアである。The data address area 51 is an area for storing an address to write data in the data area 42 of the flash memory 40. Also, INDEX
The address area 52 is the IND of the flash memory 40.
This is an area for storing an address (INDEX address) for writing a data address in the EX area 41.
【0032】終了分割INDEXエリア番号ストックエ
リア14は、書き込みが終了した分割INDEXエリア
の番号をストックするエリアで、具体的には、終了分割
INDEXエリアサーチ手段11が分割INDEXエリ
アの最後に終了コードを保持する分割INDEXエリア
番号をサーチして格納するようになっている。The end divided INDEX area number stock area 14 is an area for stocking the numbers of the divided INDEX areas for which writing has been completed. Specifically, the end divided INDEX area search means 11 puts an end code at the end of the divided INDEX area. The divided INDEX area number to be held is searched and stored.
【0033】終了分割INDEXエリアサーチ手段11
は、データアドレスが書き込まれていっぱいになり書き
込みが終了した分割INDEXエリアをサーチし、更に
フラッシュメモリ40が初期状態であるかを判断する手
段である。End division INDEX area search means 11
Is a means for searching the divided INDEX area in which the data address has been written and is full and the writing has been completed, and further determines whether the flash memory 40 is in the initial state.
【0034】具体的には、まず分割INDEXエリア1
から順に最後の分割INDEXエリアまで、分割IND
EXエリアの最後に終了コードを保持しているかを調
べ、終了コードを保持している分割INDEXエリアの
番号を終了分割INDEXエリア番号ストックエリア1
4にストックするようになっている。ここで、終了分割
INDEXエリアサーチ手段11は、書き込みが終了し
た(終了コードを保持する)分割INDEXエリアをサ
ーチするためにカウンタを備えており、図3で後述する
ように変数iを用いるものである。Specifically, first, the divided INDEX area 1
From the last divided INDEX area to the divided IND
It is checked whether the end code is held at the end of the EX area, and the number of the divided INDEX area holding the end code is set to the end divided INDEX area number stock area 1
It will be stocked in 4. Here, the end divided INDEX area search means 11 is provided with a counter for searching a divided INDEX area for which writing has been completed (holding an end code), and uses a variable i as described later in FIG. is there.
【0035】そして、次に行うフラッシュメモリ40が
初期状態であるかの判断は、終了分割INDEXエリア
番号ストックエリア14に、番号が1つも格納されず、
かつ1番目の分割INDEXエリアの最初のアドレスデ
ータが初期状態、つまりオール”1”であった場合にフ
ラッシュメモリ40が初期状態であると判断して、次の
データエリア書き込み手段20の処理に移るようになっ
ている。Then, the next judgment as to whether the flash memory 40 is in the initial state is made. If no number is stored in the end divided INDEX area number stock area 14,
When the first address data of the first divided INDEX area is in the initial state, that is, all "1", it is determined that the flash memory 40 is in the initial state, and the process of the next data area writing means 20 is performed. It is like this.
【0036】最後尾フラグサーチ手段12は、最後尾フ
ラグをサーチする手段で、具体的には、終了コードを保
持する分割INDEXエリア、つまりは終了分割IND
EXエリア番号ストックエリア14にストックされた番
号の分割INDEXエリアから順に、最後尾フラグをサ
ーチし、最後尾フラグを検出したなら、最後尾フラグの
直前に格納されているデータアドレスを読み込んでデー
タアドレスエリア51に格納するものである。The tail flag search means 12 is means for searching the tail flag, and specifically, a divided INDEX area for holding an end code, that is, an end divided IND.
EX area number stock area The number of stocks stored in the area 14 is searched sequentially from the divided INDEX area, and if the tail flag is detected, the data address stored immediately before the tail flag is read to read the data address. It is stored in the area 51.
【0037】ここで、最後尾フラグサーチ手段12は、
終了コードを保持する分割INDEXエリアから順に、
最後尾フラグをサーチするためにカウンタを備えてお
り、図3で後述するように変数jを用いるものである。Here, the last flag search means 12 is
In order from the divided INDEX area that holds the end code,
A counter is provided for searching the tail flag, and the variable j is used as described later with reference to FIG.
【0038】また、最後尾フラグのサーチとは、分割I
NDEXエリアの先頭から順にデータアドレス4byt
e(32bit)の内、最初の1〜8bitが予め決め
られた最後尾フラグのビット列と一致するかを判定して
いく処理である。尚、INDEXエリア41におけるア
クセスアドレスをINDEXアドレスエリア52に順次
設定しながら最後尾フラグをサーチすることにより、最
後尾フラグ検出時のINDEXアドレスエリア52の値
が、INDEXエリア41における次のアドレスデータ
書き込みアドレスとなる。The search for the last flag means division I
Data address 4 bytes in order from the beginning of the NDEX area
This is a process for determining whether the first 1 to 8 bits of e (32 bits) match the predetermined bit string of the last flag. By sequentially setting the access address in the INDEX area 41 to the INDEX address area 52 and searching the tail flag, the value of the INDEX address area 52 at the time of detecting the tail flag is changed to the next address data writing in the INDEX area 41. It becomes an address.
【0039】一方、終了コードを保持する分割INDE
Xエリアから順に最後尾フラグをサーチし、最終的にい
ずれの分割INDEXエリアにおいても最後尾フラグが
検出できなかった場合は、イレース手段13で終了分割
INDEXエリア番号ストックエリア14にストックさ
れた番号の分割INDEXエリアをイレースする。つま
り、終了コードを保持する分割INDEXエリアが存在
するにもかかわらず、最後尾フラグが検出できなかった
ということは、何等かのトラブルでフラッシュメモリ4
0が不定状態になっていると考えられるので、終了コー
ドを保持する分割INDEXエリアをイレースしてフラ
ッシュメモリ全体を初期化してから次のデータエリア書
き込み手段20の処理に移るものである。On the other hand, a divided INDE holding an end code
The tail flag is searched in order from the X area, and when the tail flag is not detected in any of the divided INDEX areas, the erase means 13 determines the number of stocks stored in the end divided INDEX area number stock area 14. Erase the divided INDEX area. In other words, the fact that the tail flag could not be detected despite the existence of the divided INDEX area holding the end code means that the flash memory 4 has some trouble.
Since 0 is considered to be in an indefinite state, the divided INDEX area holding the end code is erased to initialize the entire flash memory, and then the processing of the next data area writing means 20 is started.
【0040】そして、イレース手段13は、最後尾フラ
グサーチ手段12で、フラッシュメモリ40が不定状態
になったとされた場合に、終了分割INDEXエリア番
号ストックエリア14にストックされた番号の分割IN
DEXエリアに対してイレース処理を施す手段である。
ここで、イレース処理とは、対象となる分割INDEX
エリア内の全ビットに”1”を格納し、初期状態にする
処理のことである。When the flash memory 40 is determined to be in an indeterminate state by the tail flag search means 12, the erase means 13 ends the division IN of the number divided in the INDEX area number stock area 14.
This is a means for performing erase processing on the DEX area.
Here, the erase process is the target divided INDEX.
This is a process of storing "1" in all bits in the area and setting it to the initial state.
【0041】そして、データエリア書き込み手段20
は、データエリアにデータを書き込む手段であり、具体
的には、データアドレスエリア51の値にメモリのアク
セス単位として、例えば4(byte)を加算し、デー
タエリア42において加算した値のアドレスからデータ
を書き込むようにしている。The data area writing means 20
Is a means for writing data in the data area. Specifically, for example, 4 (byte) is added to the value of the data address area 51 as a memory access unit, and data is added from the address of the added value in the data area 42. I am trying to write.
【0042】また、データアドレス書き込み手段31
は、データエリア42へのデータ書き込みが終了した時
点で、最後にデータアドレスエリア51に書き込まれた
アドレスをデータアドレスとしてINDEXエリア41
に書き込み、また最後尾フラグをINDEXエリア41
に書き込む手段である。具体的には、データアドレスエ
リア51からデータアドレスを読み込み、その値をIN
DEXアドレスエリア52に記憶されているアドレス位
置から書き込み、続いて最後尾フラグの書き込みを試
み、書き込み中の分割INDEXエリアがいっぱいで最
後尾フラグが書き込めない場合に、分割INDEXエリ
ア切換手段32を起動するようになっている。Further, the data address writing means 31
When the data writing to the data area 42 is completed, the INDEX area 41 uses the address last written in the data address area 51 as a data address.
In the INDEX area 41.
Is a means to write. Specifically, the data address is read from the data address area 51 and the value is IN
When writing from the address position stored in the DEX address area 52 and then trying to write the last flag, and the last INDEX area being written is full and the last flag cannot be written, the divided INDEX area switching means 32 is activated. It is supposed to do.
【0043】尚、データアドレス書き込み手段31にお
いてINDEXエリア41にデータアドレスを書き込ん
だなら、INDEXアドレスエリア52の値にメモリの
アクセス単位として、例えば4(byte)を加算し、
INDEXアドレスエリア52が次にアドレスデータを
書き込むアドレスを示すようにしている。If a data address is written in the INDEX area 41 by the data address writing means 31, 4 (byte) is added to the value of the INDEX address area 52 as a memory access unit,
The INDEX address area 52 indicates the address where the address data is written next.
【0044】そして、分割INDEXエリア切換手段3
2は、データアドレス書き込み手段31において、書き
込み中の分割INDEXエリアがいっぱいで最後尾フラ
グが書き込めない場合に起動され、次の分割INDEX
エリアに切り換える手段で、具体的には、INDEXア
ドレスエリア52の値を次の分割INDEXエリアのア
ドレスに切り換え、データアドレスエリア51からデー
タアドレスを読み込み、その値をINDEXアドレスエ
リア52に記憶されているアドレス位置から書き込み、
続いて最後尾フラグの書き込み、いっぱいになった分割
INDEXエリアの最後に終了コードを書き込むように
なっている。The divided INDEX area switching means 3
2 is activated in the data address writing means 31 when the divided INDEX area being written is full and the last flag cannot be written, and the next divided INDEX is started.
Specifically, the value of the INDEX address area 52 is switched to the address of the next divided INDEX area, the data address is read from the data address area 51, and the value is stored in the INDEX address area 52. Write from address location,
Subsequently, the last flag is written, and the end code is written at the end of the full divided INDEX area.
【0045】そして、イレース手段33は、データアド
レス書き込み手段31でいっぱいになったことが判明し
た分割INDEXエリアの1つ前の分割INDEXエリ
アに対してイレース処理を施す手段である。The erase means 33 is means for performing erase processing on the divided INDEX area immediately before the divided INDEX area which is found to be full by the data address writing means 31.
【0046】次に、本実施例のINDEXエリアの制御
方法について図3、図4を使って説明する。図3は、本
実施例のINDEXエリアの制御方法の前半部分を示す
フローチャート図であり、図4は、本実施例のINDE
Xエリアの制御方法の後半部分を示すフローチャート図
であり、図3の(A)と図4の(A)とが続いているも
のである。尚、図3において、変数iは終了コードをサ
ーチする分割INDEX番号を示す変数であり、変数j
は最後尾フラグをサーチする分割INDEX番号を示す
変数である。Next, a method of controlling the INDEX area of this embodiment will be described with reference to FIGS. FIG. 3 is a flow chart showing the first half of the INDEX area control method of this embodiment, and FIG. 4 is the INDEX of this embodiment.
It is a flowchart figure which shows the latter half part of the control method of X area, (A) of FIG. 3 and (A) of FIG. 4 continue. In FIG. 3, the variable i is a variable indicating the divided INDEX number for searching the end code, and the variable j
Is a variable indicating the divided INDEX number for searching the tail flag.
【0047】図3に示すように、制御処理が開始される
と、終了分割INDEXエリアサーチ手段11の動作と
して、まず変数iに0を代入し(200)、次に変数i
に1を加算して(202)、変数iの値がNより大きい
か、つまり最後の分割INDEXエリアまでサーチした
か判断し(204)、iの値がNより大きくない場合
は、i番の分割INDEXエリアの最後が終了コードで
あるか判断し(206)、終了コードでない場合は、処
理202に戻って、次の分割INDEXエリアのサーチ
を行う。As shown in FIG. 3, when the control processing is started, 0 is substituted into the variable i as the operation of the end division INDEX area search means 11 (200), and then the variable i.
Is incremented by 1 (202), it is determined whether the value of the variable i is larger than N, that is, whether the search has been performed up to the last divided INDEX area (204). If the value of i is not larger than N, the i-th It is determined whether the end of the divided INDEX area is the end code (206). If the end code is not the end code, the process returns to step 202 to search for the next divided INDEX area.
【0048】一方、処理206においてi番目の分割I
NDEXエリアの最後が終了コードの場合は、分割IN
DEXエリア番号を終了分割INDEXエリア番号スト
ックエリア14にストックして(208)、処理202
に戻り、次の分割INDEXエリアにおける終了コード
のサーチを行う。ここで、処理208の分割INDEX
エリア番号のストックとは、変数iの値を終了分割IN
DEX番号ストックエリア14に格納することである。On the other hand, in process 206, the i-th division I
If the end of the NDEX area is the end code, split IN
Stock the DEX area number in the end division INDEX area number stock area 14 (208), and process 202
Then, the search for the end code in the next divided INDEX area is performed. Here, the division INDEX of the process 208
Area number stock is the end division IN of the value of variable i
It is to be stored in the DEX number stock area 14.
【0049】また、処理204においてiの値がNより
大きい場合は、全分割INDEXエリアにおける終了コ
ードのサーチが終了したので、処理210に飛び、フラ
ッシュメモリ40が初期状態であるかを判断し(21
0)、初期状態であった場合は、(A)に飛んで図4の
処理に移る。ここで、フラッシュメモリ40が初期状態
であるかは、終了分割INDEXエリアサーチ手段11
で判断が為されるもので、具体的には、終了分割IND
EXエリア番号ストックエリア14に番号が1つも格納
されず、かつ1番目の分割INDEXエリアの最初のア
ドレスデータが初期状態、つまりオール”1”であった
場合にフラッシュメモリ40が初期状態と判断するもの
である。If the value of i is larger than N in the process 204, the search for the end code in all the divided INDEX areas is completed, so that the process jumps to the process 210 to judge whether the flash memory 40 is in the initial state ( 21
0), in the case of the initial state, jump to (A) and move to the processing of FIG. Here, it is determined whether the flash memory 40 is in the initial state by the end division INDEX area search means 11
The decision is made in step 1. Specifically, the end division IND
If no number is stored in the EX area number stock area 14 and the first address data of the first divided INDEX area is in the initial state, that is, all "1", the flash memory 40 determines the initial state. It is a thing.
【0050】処理210において、フラッシュメモリ4
0が初期状態でなかった場合に、終了分割INDEXエ
リア番号ストックエリア14に番号が格納されたか判断
し(212)、番号が格納されてない場合は、1番目の
分割INDEXエリアで最後尾フラグをサーチし(21
4)、最後尾フラグがあったか判断し(216)、最後
尾フラグがなかった場合は、フラッシュメモリが不定状
態にあるとして1番目の分割INDEXエリアをイレー
ス処理して(218)、(A)に飛んで図4の処理に移
る。In process 210, the flash memory 4
If 0 is not in the initial state, it is judged whether or not a number is stored in the end divided INDEX area number stock area 14 (212), and if the number is not stored, the tail flag is set in the first divided INDEX area. Search (21
4), it is determined whether there is a tail flag (216), and if there is no tail flag, it is determined that the flash memory is in an indeterminate state, the first divided INDEX area is erased (218), and (A) is set. The process jumps to the process shown in FIG.
【0051】一方、処理216において、最後尾フラグ
があった場合は、最後尾フラグ直前のデータアドレスを
データアドレスエリア51に格納して(228)、
(A)に飛んで図4の処理に移る。On the other hand, in the processing 216, if there is a tail flag, the data address immediately before the tail flag is stored in the data address area 51 (228).
It jumps to (A) and moves to the process of FIG.
【0052】また、処理212において、終了分割IN
DEXエリア番号ストックエリア14に番号が格納され
た場合は、変数jに終了分割INDEXエリア番号スト
ックエリア14に格納された最初の番号を代入し(22
0)、j番の分割INDEXエリアで最後尾フラグをサ
ーチし(222)、最後尾フラグがあったか判断し(2
24)、最後尾フラグがあった場合は、処理228に飛
ぶ。Further, in the process 212, the end division IN
When the number is stored in the DEX area number stock area 14, the first number stored in the end divided INDEX area number stock area 14 is substituted into the variable j (22
0), the tail flag is searched in the jth divided INDEX area (222), and it is judged whether there is the tail flag (2).
24) If there is a tail flag, the process jumps to processing 228.
【0053】一方、処理224において最後尾フラグが
なかった場合は、全ての分割INDEXエリアに対する
最後尾フラグのサーチを終了したか判断し(230)、
最後尾フラグのサーチが終了していないなら変数jを次
の分割INDEXエリア番号に設定して(232)、処
理222に戻る。ここで、処理232の変数jを次の分
割INDEXエリア番号に設定する処理は、変数jに1
を加算し、その結果変数jの値が分割INDEXエリア
番号の最大値Nより大きくなった場合は、1を設定する
ものである。また、処理230における、全ての分割I
NDEXエリアに対する最後尾フラグのサーチを終了し
たかの判断は、変数jの値が最後尾フラグのサーチを開
始した分割INDEXエリア番号から1を除算した値に
なった場合を終了とするようになっている。On the other hand, if there is no tail flag in the process 224, it is judged whether or not the tail flag search for all the divided INDEX areas is completed (230).
If the search for the tail flag has not been completed, the variable j is set to the next divided INDEX area number (232), and the process 222 is returned to. Here, the process of setting the variable j of the process 232 to the next divided INDEX area number is 1 for the variable j.
Is added and, as a result, the value of the variable j becomes larger than the maximum value N of the divided INDEX area numbers, 1 is set. In addition, all the divisions I in process 230
The determination as to whether the end flag search for the NDEX area has ended is made when the value of the variable j reaches a value obtained by dividing 1 from the divided INDEX area number that started the end flag search. ing.
【0054】また、処理230において全ての分割IN
DEXエリアで最後尾フラグのサーチが終了したなら、
フラッシュメモリ40が不定状態にあるとして終了分割
INDEXエリア番号ストックエリア14に格納された
番号の分割INDEXエリアをイレース処理して(23
4)、(A)に飛んで図4の処理に移る。Further, in processing 230, all division IN
If you have finished searching the last flag in the DEX area,
It is assumed that the flash memory 40 is in an indefinite state, and the divided INDEX area having the number stored in the end divided INDEX area number stock area 14 is erased (23
4), jump to (A) and move to the process of FIG.
【0055】つぎに、図4に示すように、図3の(A)
から続いて、データエリア書き込み手段20の動作とし
て、データエリア42へのデータの書き込み処理を行い
(240)、次に、データアドレス書き込み手段31の
動作として、INDEXエリア41へデータアドレスを
書き込み(250)、続いてINDEXエリア41へ最
後尾フラグの書き込みを試み(252)、書き込もうと
した分割INDEXエリアがいっぱいで最後尾フラグが
書き込めなかったかどうか判断し(254)、いっぱい
でない場合は、処理240に戻る。Next, as shown in FIG. 4, (A) of FIG.
Then, as the operation of the data area writing means 20, the data writing processing to the data area 42 is performed (240), and then the data address writing means 31 writes the data address to the INDEX area 41 (250). ), And then it tries to write the last flag to the INDEX area 41 (252), and judges whether the last INDEX area could not be written because the divided INDEX area to be written was full (254). Return.
【0056】一方、処理254において、書き込もうと
した分割INDEXエリアがいっぱいの場合は、分割I
NDEXエリア切換手段32の動作として、INDEX
アドレスエリア52に次の分割INDEXエリアの先頭
アドレスを設定して、データアドレスを次の分割IND
EXエリア書き込み(260)、続いて最後尾フラグを
書き込み(262)、いっぱいになった分割INDEX
エリアの最後に終了コードを書き込み(264)、イレ
ース手段33の動作として、いっぱいになった分割IN
DEXエリアの1つ前の分割INDEXエリアをイレー
ス処理し(270)、処理240に戻る。On the other hand, in process 254, if the divided INDEX area to be written is full, the divided I
As the operation of the NDEX area switching means 32, INDEX
The start address of the next divided INDEX area is set in the address area 52, and the data address is set to the next divided IND.
EX area writing (260), followed by writing the last flag (262), full divided INDEX
An end code is written at the end of the area (264), and as the operation of the erase means 33, the full division IN
The divided INDEX area immediately before the DEX area is erased (270) and the process 240 is returned to.
【0057】なお、本実施例のメモリ管理エリア制御方
法では、終了コードが保持されている分割INDEXエ
リアから順に最後尾フラグをサーチするようにしている
が、終了コードが保持されている分割INDEXエリア
の次の分割INDEXエリアから最後尾フラグのサーチ
を始めるようにすることも考えられる。この場合、終了
コードを保持する分割INDEXエリアの次の分割IN
DEXエリアに最後尾フラグが存在する確立が高いた
め、最後尾フラグを効率的にサーチできるものである。In the memory management area control method of this embodiment, the tail flag is searched in order from the divided INDEX area holding the end code, but the divided INDEX area holding the end code is searched. It is also conceivable to start the search of the tail flag from the next divided INDEX area of. In this case, the next division IN of the division INDEX area holding the end code
Since the probability that the tail flag exists in the DEX area is high, the tail flag can be searched efficiently.
【0058】本実施例のINDEXエリア制御方法によ
れば、INDEXエリア41が複数の分割INDEXエ
リアに分割されており、INDEXエリア41にデータ
エリア42におけるデータ書き込み終了時のデータアド
レスを書き込んだ後に、最後尾フラグを付加する処理を
行うが、データアドレスを書き込んだ分割INDEXエ
リアに最後尾フラグを書き込む余裕がなければ次の分割
INDEXエリアの先頭にデータアドレスを書き込んで
最後尾フラグを付加し、そしてデータアドレスが最初に
書き込まれた分割INDEXエリアの最後に終了コード
を付加し、更にデータアドレスを最初に書き込んだ分割
INDEXエリアの一つ前の分割INDEXエリアをイ
レースするので、INDEXエリア41の分割INDE
Xエリアのイレース時に電源停止等の障害が発生して
も、終了時のデータアドレスを保全することができる効
果がある。According to the INDEX area control method of this embodiment, the INDEX area 41 is divided into a plurality of divided INDEX areas, and after writing the data address at the end of data writing in the data area 42 to the INDEX area 41, The process of adding the tail flag is performed, but if there is no room to write the tail flag in the divided INDEX area in which the data address has been written, the data address is written at the beginning of the next divided INDEX area, the tail flag is added, and Since the end code is added to the end of the divided INDEX area in which the data address is written first, and the divided INDEX area immediately before the divided INDEX area in which the data address is written first is erased, the divided INDEX area 41 is divided.
Even if a failure such as a power supply stop occurs at the time of erasing the X area, the data address at the end can be preserved.
【0059】また、本実施例のINDEXエリア制御方
法によれば、電源立上時には、まず終了コードを検索し
て終了コードを保持する分割INDEXエリアを特定
し、更に特定された分割INDEXエリアから順に最後
尾フラグを検索し、最後尾フラグの直前に書き込まれた
データアドレスからデータエリア42において次にアク
セスするデータアドレスを取得するようにしているの
で、電源立上時に保全されたデータアドレスから次にア
クセスするデータアドレスを容易に取得することができ
る効果がある。Further, according to the INDEX area control method of the present embodiment, when the power is turned on, first, the end code is searched, the divided INDEX areas holding the end code are specified, and the specified divided INDEX areas are sequentially searched. Since the tail end flag is searched and the data address to be accessed next in the data area 42 is acquired from the data address written immediately before the tail end flag, the data address that was preserved at power-on The data address to be accessed can be easily obtained.
【0060】[0060]
【発明の効果】請求項1記載の発明によれば、メモリ管
理エリアが複数のブロックに分割されており、終了時の
データアドレスをメモリ管理エリアに書き込んだ後に、
そのデータアドレスの直後に特定フラグを付加する処理
を行うが、データアドレスを書き込んだブロックに特定
フラグを書き込む余裕がなければ次のブロックの先頭に
データアドレスを書き込んで特定フラグを付加し、そし
てデータアドレスが最初に書き込まれたブロックの最後
に終了コードを付加し、更にデータアドレスを最初に書
き込んだブロックの一つ前のブロックをイレースするメ
モリ管理エリア制御方法としているので、メモリ管理エ
リアのブロックのイレース時に電源停止等の障害が発生
しても、終了時のデータアドレスを保全することができ
る。According to the invention of claim 1, the memory management area is divided into a plurality of blocks, and after writing the data address at the end to the memory management area,
The specific flag is added immediately after the data address, but if there is no room to write the specific flag in the block in which the data address was written, write the data address at the beginning of the next block to add the specific flag, and An end code is added to the end of the block in which the address is written first, and the memory management area control method that erases the block immediately before the block in which the data address is first written is used. Even if a failure such as a power stop occurs during erase, the data address at the end can be preserved.
【0061】請求項2記載の発明によれば、請求項1記
載のメモリ管理エリア制御方法で処理されたメモリ管理
エリアを有するメモリについて、電源立上時には、まず
終了コードを検索し、更に終了コードから特定フラグを
検索し、特定フラグの直前に書き込まれたデータアドレ
スから次にアクセスするデータアドレスを取得するメモ
リ管理エリア制御方法としているので、電源立上時に保
全されたデータアドレスから次にアクセスするデータア
ドレスを容易に取得することができる。According to the second aspect of the present invention, regarding the memory having the memory management area processed by the memory management area control method according to the first aspect, when the power is turned on, the end code is searched first, and the end code is further searched. The memory management area control method is to retrieve the specific flag from the specified address and obtain the data address to be accessed next from the data address written immediately before the specific flag. The data address can be easily obtained.
【図1】本発明の一実施例に係るフラッシュメモリのメ
モリ管理エリア(INDEXエリア)制御方法を説明す
るための概略説明図である。FIG. 1 is a schematic explanatory diagram for explaining a memory management area (INDEX area) control method of a flash memory according to an embodiment of the present invention.
【図2】本実施例のメモリ管理方法を実現する手段の機
能構成ブロック図である。FIG. 2 is a functional configuration block diagram of means for implementing the memory management method of the present embodiment.
【図3】本実施例のINDEXエリアの制御方法の前半
部分を示すフローチャート図である。FIG. 3 is a flow chart showing the first half of the control method of the INDEX area of the present embodiment.
【図4】本実施例のINDEXエリアの制御方法の後半
部分を示すフローチャート図である。FIG. 4 is a flowchart showing the latter half of the method of controlling the INDEX area according to the present embodiment.
【図5】従来のフラシュメモリのメモリ管理エリア(I
NDEXエリア)制御方法を説明するための概略説明図
である。FIG. 5 is a memory management area (I
FIG. 6 is a schematic explanatory diagram for explaining an NDEX area) control method.
【図6】従来のINDEXエリアの制御方法を示すフロ
ーチャート図である。FIG. 6 is a flowchart showing a conventional method of controlling an INDEX area.
10…最終データアドレスサーチ手段、 11…終了分
割INDEXエリアサーチ手段、 12…最後尾フラグ
サーチ手段、 13…イレース手段、 14…終了分割
INDEXエリア番号ストックエリア、 20…データ
エリア書き込み手段、 30…データアドレス書き込み
制御手段、 31…データアドレス書き込み手段、 3
2…分割INDEXエリア切換手段、 33…イレース
手段、40…FLASHメモリ、 41…INDEXエ
リア、 42…データエリア、51…データアドレスエ
リア、 52…INDEXアドレスエリア10 ... Final data address search means, 11 ... End division INDEX area search means, 12 ... End flag search means, 13 ... Erase means, 14 ... End division INDEX area number stock area, 20 ... Data area writing means, 30 ... Data Address writing control means, 31 ... Data address writing means, 3
2 ... Divided INDEX area switching means, 33 ... Erase means, 40 ... FLASH memory, 41 ... INDEX area, 42 ... Data area, 51 ... Data address area, 52 ... INDEX address area
Claims (2)
リアの制御方法であって、前記メモリ管理エリアに終了
時のデータアドレスを書き込んだ際に、前記データアド
レスの直後に特定フラグを付加するよう試み、当該書き
込んだブロック内に前記特定フラグを付加する余裕があ
れば前記特定フラグを付加し、前記ブロック内に前記特
定フラグを付加する余裕がなければ次のブロックの先頭
に前記データアドレスを書き込み、更に前記データアド
レスの直後に前記特定フラグを付加し、前記データアド
レスが最初に書き込まれたブロックの最後に終了コード
を付加し、前記データアドレスが最初に書き込まれたブ
ロックの一つ前のブロックをイレースすることを特徴と
するメモリ管理エリア制御方法。1. A method of controlling a memory management area divided into a plurality of blocks, wherein an attempt is made to add a specific flag immediately after the data address when the end data address is written in the memory management area. If there is room to add the specific flag in the written block, the specific flag is added, and if there is no room to add the specific flag in the block, the data address is written at the beginning of the next block, Further, the specific flag is added immediately after the data address, an end code is added at the end of the block in which the data address is first written, and the block immediately before the block in which the data address is first written is added. A memory management area control method characterized by erasing.
法によって特定フラグが付加されたメモリ管理エリアの
制御方法であって、電源立上時に終了コードを検索し、
更に前記終了コードから前記特定フラグを検索し、前記
特定フラグの直前に書き込まれているデータアドレスか
ら次にアクセスするデータアドレスを取得することを特
徴とするメモリ管理エリア制御方法。2. A method of controlling a memory management area to which a specific flag is added by the method of controlling a memory management area according to claim 1, wherein an end code is searched at power-on,
Furthermore, the memory management area control method is characterized in that the specific flag is searched from the end code, and the data address to be accessed next is acquired from the data address written immediately before the specific flag.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16866494A JPH0817191A (en) | 1994-06-29 | 1994-06-29 | Memory management area control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16866494A JPH0817191A (en) | 1994-06-29 | 1994-06-29 | Memory management area control method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0817191A true JPH0817191A (en) | 1996-01-19 |
Family
ID=15872216
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP16866494A Pending JPH0817191A (en) | 1994-06-29 | 1994-06-29 | Memory management area control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0817191A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000293440A (en) * | 1999-03-17 | 2000-10-20 | Robert Bosch Gmbh | Method of protecting memory function of control device and control device |
-
1994
- 1994-06-29 JP JP16866494A patent/JPH0817191A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000293440A (en) * | 1999-03-17 | 2000-10-20 | Robert Bosch Gmbh | Method of protecting memory function of control device and control device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102890656B (en) | The method improving FLASH service life | |
| US20170139839A1 (en) | Data storage device and data maintenance method thereof | |
| US6839798B1 (en) | Flash memory capable of storing frequently rewritten data | |
| US7725646B2 (en) | Method of using a flash memory for a circular buffer | |
| KR20010109336A (en) | Method and apparatus to permit adjustable code/data boundary in a nonvolatile memory | |
| CN112397128B (en) | A method and device for controlling a Flash memory | |
| JP3212960B2 (en) | Data management method using flash memory | |
| CN112347002A (en) | flash data storage method and system, computer equipment and storage medium | |
| CN114089915B (en) | File additional writing operation method and device based on FLASH memory | |
| KR20010037155A (en) | Flash file system | |
| CN111324549B (en) | Memory and control method and device thereof | |
| KR101826778B1 (en) | EEPROM Emulation Method Considering implementation of Flash Life Cycle and Performance Improvement | |
| KR100704618B1 (en) | Device and method for data recovery of flash memory | |
| JP2008033801A (en) | Memory data management device | |
| JPH0817191A (en) | Memory management area control method | |
| JP2003036209A (en) | Nonvolatile memory and data rewriting method for nonvolatile memory | |
| CN117746951A (en) | Circuit design method for simulating EEPROM | |
| CN112908390B (en) | Data storage method, device, electronic equipment and storage medium | |
| CN110427161B (en) | Data storage method for serial flash memory | |
| CN113793634A (en) | Wear leveling method suitable for Nor Flash data storage and storage device | |
| JP2008084184A (en) | Memory controller | |
| JP3978720B2 (en) | Data storage method | |
| KR100521155B1 (en) | Apparatus and method for writing data in flash memory | |
| JP2003203007A (en) | Non-volatile area management method for mobile phone memory | |
| JP3863479B2 (en) | IC card |