JP2008065646A - Flash memory control system and control method thereof - Google Patents

Flash memory control system and control method thereof Download PDF

Info

Publication number
JP2008065646A
JP2008065646A JP2006243588A JP2006243588A JP2008065646A JP 2008065646 A JP2008065646 A JP 2008065646A JP 2006243588 A JP2006243588 A JP 2006243588A JP 2006243588 A JP2006243588 A JP 2006243588A JP 2008065646 A JP2008065646 A JP 2008065646A
Authority
JP
Japan
Prior art keywords
data
address
address management
life extension
countermeasure
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
JP2006243588A
Other languages
Japanese (ja)
Other versions
JP5060088B2 (en
Inventor
Kazuyo Kuroda
和代 黒田
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2006243588A priority Critical patent/JP5060088B2/en
Publication of JP2008065646A publication Critical patent/JP2008065646A/en
Application granted granted Critical
Publication of JP5060088B2 publication Critical patent/JP5060088B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a flash memory control system capable of simply extending the life of a product and a method for controlling the flash memory control system by solving a problem that a conventional flash memory requires a logical/physical conversion table and requires the management of logical addresses and physical addresses and complicated management in writing frequency, erasing frequency, or the like. <P>SOLUTION: In the flash memory control system and its control method, the flash memory includes an address management table for managing data start addresses, data lengths and data sorts, and when a writing request specifying a data sort is generated, the table is referred to, an unused address is specified as the start address of the data sort, the address management table is updated, and updated data are written in a different address in each time to extend the flash memory. It is also characterized that variable length data are successively written, and then these data are collectively rewritten in the newest data start address in each fixed erasing block. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、フラッシュメモリにおける書き換え回数等の記録動作を延命するフラッシュメモリ制御システムとその制御方法に関する。   The present invention relates to a flash memory control system that extends the life of recording operations such as the number of rewrites in a flash memory, and a control method therefor.

一般的に、フラッシュメモリは、記憶のための電気的な保持動作(保持電源供給)が不要な不揮発性メモリであり、定めた消去ブロック単位で電気的にデータを一括消去できる特徴を有している。   Generally, a flash memory is a non-volatile memory that does not require an electrical holding operation (holding power supply) for storage, and has a feature that data can be collectively erased in units of predetermined erase blocks. Yes.

このフラッシュメモリには、構造的にデータの書き換え回数に上限があり、この回数を越えると、フラッシュメモリの製品寿命となる。つまり、情報処理装置等に搭載されたフラッシュメモリであれば、新たなものに交換する必要がある。従って、データ記憶領域において、特定の領域のみにデータの書き込み及び消去を行うのでなく、平均的に記憶消去動作を行わせて、フラッシュメモリの製品寿命を少しでも長引かせる種々の方法が提案されている。   This flash memory structurally has an upper limit on the number of times data can be rewritten. If this number is exceeded, the product life of the flash memory is reached. That is, if it is a flash memory mounted on an information processing apparatus or the like, it must be replaced with a new one. Therefore, in the data storage area, various methods have been proposed to extend the product life of the flash memory as much as possible by performing an average storage / erasure operation instead of writing and erasing data only in a specific area. Yes.

例えば、特許文献1には、消去単位のセクタをページに分割し、ページ単位の有効/無効フラグ及び、使用/未使用マップでデータを管理して、小規模にデータを書き換える場合にはデータを順次格納する、フラッシュメモリの管理方法が提案されている。また、特許文献2においては、半導体記憶システムに搭載され、書き込み回数とそれに対応する書込み領域の開始アドレスと終了アドレスを格納する管理領域を持ち、書き込み動作毎に順次、終了アドレスをインクリメントして、メモリ領域全域に亘って使用するフラッシュメモリの管理方法が提案されている。さらに、特許文献3には、書き込み用とガベージコレクション用のフラッシュメモリを順番に使用して書込み、その書込み回数を平均化させて消去回数計算を簡略化するフラッシュメモリを複数使用した外部記憶装置のデータ記憶制御方法が提案されている。
特開2004−62554号公報 特開平4−30399号公報 特開平11−126488号公報
For example, Patent Document 1 discloses that an erase unit sector is divided into pages, data is managed with a page unit valid / invalid flag and a used / unused map, and data is rewritten when data is rewritten on a small scale. A flash memory management method has been proposed that stores data sequentially. Further, in Patent Document 2, it is mounted on a semiconductor storage system and has a management area for storing the number of times of writing and the start address and end address of the write area corresponding thereto, and sequentially incrementing the end address for each write operation, A flash memory management method used over the entire memory area has been proposed. Further, Patent Document 3 describes an external storage device that uses a plurality of flash memories that use a flash memory for writing and a garbage collection in order, write the data, and average the number of times of writing to simplify the number of times of erasure. Data storage control methods have been proposed.
JP 2004-62554 A Japanese Patent Laid-Open No. 4-30399 JP-A-11-126488

前述した各特許文献1乃至3に開示された管理技術は、論物変換テーブルを必要とし、いずれも論理アドレスと物理アドレスの管理、書き込み回数管理など非常に複雑な処理が必要であった。つまり、入力されるデータ長やデータ種が異なるデータに対して、消去ブロック単位で区分された全領域に対して、どの程度の書き込み回数や消去回数が行われたかを把握して管理しなければならなかった。   The management techniques disclosed in each of the above-mentioned patent documents 1 to 3 require a logical-physical conversion table, and all of them require very complicated processing such as management of logical addresses and physical addresses, and management of the number of times of writing. In other words, for data with different data lengths and data types, it is necessary to understand and manage how many times the number of writes and erasures have been performed for all areas divided in units of erase blocks. did not become.

そこで本発明は、簡易に製品寿命を延命するフラッシュメモリ制御システムとその制御方法を提供することを目的とする。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a flash memory control system and its control method that can easily extend the product life.

上記目的を達成するために、一定のデータ長を有する複数のデータ領域に分割された延命対策データ領域、及び、データ書き込みを行うデータ領域に対して少なくともデータ領域の使用有無とデータ開始アドレスとデータ長とを管理するためのアドレス管理テーブルが設けられた延命対策アドレス管理領域、を有するフラッシュメモリと、フラッシュメモリヘ可変長データ書込む際に、前記延命対策アドレス管理領域の前記アドレス管理テーブルを参照し、書込みデータ開始アドレスを確定後、確定した書込みデータ開始アドレスにデータを書き込み、アドレス管理テーブルを更新し、新たなデータ書込み毎に異なるアドレスへ書き込む制御を行う制御部と、を具備するフラッシュメモリ制御システムを提供する。   In order to achieve the above object, at least the presence / absence of use of the data area, the data start address, and the data for the data area for life extension divided into a plurality of data areas having a constant data length, and the data area to which data is written A flash memory having a life extension address management area provided with an address management table for managing the length, and when writing variable length data to the flash memory, refer to the address management table in the life extension address management area A flash memory comprising: a controller that performs control to write data to the determined write data start address after updating the write data start address, update the address management table, and write to a different address for each new data write Provide a control system.

また、フラッシュメモリに対して、データ開始アドレスと長さでデータ種を管理するアドレス管理テーブルを有し、データの書き込みの際にデータ種を指定した書込み要求時に前記アドレス管理テーブルを参照して、未使用状態のアドレスをそのデータ種の開始アドレスとして指定し、前記データを記憶した後に前記アドレス管理テーブルを更新することにより、書き込み毎に異なるアドレスに可変長データを順次書き込むフラッシュメモリ制御方法を提供する。更に、データ開始アドレスが予め定めたアドレスと合致する際に、順次異なるアドレスに分散して書き込まれている複数の延命対策データを、データ開始アドレスから連続して書き込むフラッシュメモリ制御方法も提供する。   In addition, the flash memory has an address management table that manages the data type by the data start address and length, and refers to the address management table at the time of a write request that specifies the data type at the time of data writing, Provide a flash memory control method that sequentially writes variable length data to different addresses for each write by specifying an unused address as the start address of the data type and updating the address management table after storing the data To do. Furthermore, there is also provided a flash memory control method for sequentially writing a plurality of life extension countermeasure data written in a distributed manner to different addresses when the data start address matches a predetermined address.

本発明によれば、簡易に製品寿命を延命するフラッシュメモリ制御システムとその制御方法を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the flash memory control system and its control method which can prolong product life easily can be provided.

以下、図面を参照して本発明の実施形態について詳細に説明する。
図1は、本発明のフラッシュメモリ制御システムにおける一実施形態に係るシステム全体構成を示すブロック図である。尚、図示する構成においては、本実施形態の要旨に係わる構成部位のみを示しており、例えば入力装置など通常のシステムに備えられている構成部位は、その説明を省略しているが備えられているものとする。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a block diagram showing an overall system configuration according to an embodiment of a flash memory control system of the present invention. In the configuration shown in the figure, only the components related to the gist of the present embodiment are shown. For example, the components included in a normal system such as an input device are omitted from the description. It shall be.

この制御システムは、後述するデータの書き込み、延命対策処理及びその他の処理を制御するフラッシュ制御装置1と、データや操作に必要な情報を表示する表示装置2と、プログラムやデータを格納する記憶装置3と、システム全体を制御する制御装置4と、各構成部位に電源を供給する電源5とから構成される。   This control system includes a flash control device 1 that controls data writing, life extension processing, and other processing, which will be described later, a display device 2 that displays data and information necessary for operations, and a storage device that stores programs and data. 3, a control device 4 that controls the entire system, and a power source 5 that supplies power to each component.

フラッシュ制御装置1は、同期を取るための発振器11と、外部との情報交換を行う入出カインタフェース12と、システムメモリやプログラムの実行制御を含めFLASH制御装置全体を制御するMPU13と、MPU13がプログラムを実行するときに使用するRAM14,例えば128KBの容量を有するフラッシュメモリ15とから構成され、それぞれが配線又はバスにより接続されている。   The flash control device 1 includes an oscillator 11 for synchronization, an input / output interface 12 for exchanging information with the outside, an MPU 13 for controlling the entire FLASH control device including system memory and program execution control, and a program for the MPU 13 to program RAM 14 used when executing the above, for example, a flash memory 15 having a capacity of 128 KB, and each is connected by a wiring or a bus.

図2は、フラッシュメモリ15の概念的な構成を示す図である。
このフラッシュメモリ15のアドレスは、一例として、0x00000から0x20000までに割り当てた例を示している。この例では、消去ブロックサイズを1KBとして、計128個の消去ブロックから構成されている。割り当ての一例として、0x00000から0x19FFFまでの104KBは通常データ領域203であり、ホスト側が指定したアドレスに読み出し又は書き込み行う領域である。次の0x1A000から0x1BFFFまでの8KBは、後述する延命対策アドレス管理領域202であり、延命対策データの書込みアドレスを管理するための領域である。さらに、0x1C000から0x1FFFFまでの16KBは延命対策データ領域201であり、書き込みアドレスを毎回変更して延命対策データを書き込む領域に割り当てている。
FIG. 2 is a diagram showing a conceptual configuration of the flash memory 15.
As an example, the addresses of the flash memory 15 are assigned from 0x00000 to 0x20000. In this example, the erase block size is 1 KB, and the block is composed of a total of 128 erase blocks. As an example of allocation, 104 KB from 0x00000 to 0x19FFF is a normal data area 203, which is an area for reading or writing to an address designated by the host side. The next 8 KB from 0x1A000 to 0x1BFFF is a life extension countermeasure address management area 202, which will be described later, and is an area for managing the write address of life extension countermeasure data. Further, 16 KB from 0x1C000 to 0x1FFFF is a life extension countermeasure data area 201, which is assigned to an area in which life extension countermeasure data is written by changing the write address each time.

図3は、延命対策アドレス管理領域202における全体構成を示している。この構成において、0x1A000から0xlAFFFまでの4KBは延命対策アドレス管理領域A302とし、0x1B000から0x1BFFFまでの4KBは延命対策アドレス管理領域B301とする。これらの延命対策アドレス管理領域A302と延命対策アドレス管理領域B301は、同じ大きさの領域に分離され、同じ延命対策アドレス管理情報を二重化して格納している。アドレス管理領域は下位アドレスから昇順に使用する。この二重化は、延命対策アドレス管理領域のバックアップとして補償に用いる。例えば、通常、先に書き込みが行われる延命対策アドレス管理領域A302と延命対策アドレス管理領域B301とが不一致であれば、後から書き込まれる延命対策アドレス管理領域B301の方がエラーの原因となる確率が高いため、延命対策アドレス管理領域A302の管理情報を延命対策アドレス管理領域B301にコピーすることなどが考えられる。   FIG. 3 shows the overall configuration in the life extension address management area 202. In this configuration, 4 KB from 0x1A000 to 0x1AFFF is the life extension address management area A302, and 4KB from 0x1B000 to 0x1BFFF is the life extension address management area B301. These life extension countermeasure address management area A302 and life extension countermeasure address management area B301 are separated into areas of the same size, and store the same life extension countermeasure address management information in duplicate. The address management area is used in ascending order from the lower address. This duplication is used for compensation as a backup of the life extension address management area. For example, normally, if the life extension countermeasure address management area A302 and the life extension countermeasure address management area B301 that are written first do not match, the probability that the life extension countermeasure address management area B301 that is written later causes an error is higher. For example, the management information of the life extension address management area A302 may be copied to the life extension address management area B301.

図4は、延命対策アドレス管理領域22における1消去ブロック(アドレス0x1A000−0x1A400)の構成について示す図である。
ここでは、アドレス0xlA000からアドレス管理情報(28Byte)を0−33まで計34群が連続して格納されている。アドレス管理情報は、0側から昇順に使用する。尚、アドレス管理情報構成の詳細は図5で後述する。続いて、アドレス0x1A3B8からアドレス管理情報の使用フラグ(2Byte)を0−33まで34群が連続して格納されている。
FIG. 4 is a diagram showing the configuration of one erase block (address 0x1A000-0x1A400) in the life extension countermeasure address management area 22.
Here, a total of 34 groups from address 0xlA000 to address management information (28 bytes) from 0 to 33 are stored continuously. Address management information is used in ascending order from the 0 side. Details of the address management information configuration will be described later with reference to FIG. Subsequently, 34 groups from address 0x1A3B8 to address management information use flag (2 bytes) from 0 to 33 are continuously stored.

これらの使用フラグ(2B)は、アドレス管理情報が使用中であるか否かを判定するために用いるフラグである。ここでは、1つの使用フラグが1つのアドレス管理情報に対応する。具体的には、使用フラグ“0”は、アドレス管理情報の使用状態を示している。例えば、使用状態のときの値は、0x1111であり、未使用状態のときの値は、0xFFFFである。使用フラグも同様に0から昇順に使用する。0x1A3FC−0x1A3FDは、予約データとして用いて、0xFFを格納している。0x1A3FE−0x1A3FFは、確認フラグ(2B)として用いて、本消去ブロックが延命対策アドレス管理領域202として初期化されているときには、固定値0x1111が格納されている。   These use flags (2B) are used for determining whether or not the address management information is being used. Here, one use flag corresponds to one address management information. Specifically, the use flag “0” indicates the use state of the address management information. For example, the value in the used state is 0x1111 and the value in the unused state is 0xFFFF. Similarly, the use flag is used in ascending order from 0. 0x1A3FC-0x1A3FD stores 0xFF as reservation data. 0x1A3FE-0x1A3FF is used as a confirmation flag (2B), and a fixed value 0x1111 is stored when this erase block is initialized as the life extension countermeasure address management area 202.

図5は、延命対策アドレス管理領域202に格納されているアドレス管理情報(28B)の構成を示す図である。
最下位アドレスから昇順にデータ1開始アドレス(4Byte)、データ1長(2Byte)、データ2開始アドレス(4B)、データ2長(2B)、データ3開始アドレス(4B)、データ3長(2B)、データ4開始アドレス(4B)、データ4長(2B)、不良ブロック番号(4Byte)の順に格納されている。データ開始アドレスは指定されたデータ番号の書き込み開始アドレスを示している。
FIG. 5 is a diagram showing the configuration of the address management information (28B) stored in the life extension countermeasure address management area 202. As shown in FIG.
Data 1 start address (4 bytes), data 1 length (2 bytes), data 2 start address (4B), data 2 length (2B), data 3 start address (4B), data 3 length (2B) in ascending order from the lowest address , Data 4 start address (4B), data 4 length (2B), and defective block number (4 bytes). The data start address indicates the write start address of the specified data number.

データ長は、指定されたデータの長さをバイト長で示す。書き込み回数等が既定値を超えた場合や実際に動作不良となったブロック(前述した消去ブロックを示唆する)に対して指定される不良ブロック番号は、最大4群の不良ブロック番号を示している。最下位アドレスから昇順に数えた消去ブロック番号を1Byteで示した情報であり、0x00000を含む消去ブロックを0(基準)とし、ここから昇順に1ずつ加算した数値で示している。正常時は0xFFで示し、不良ブロック発生時は0x00−0x7Fのいずれかの1Byteを最下位アドレスから順に格納する。   The data length indicates the length of the specified data in byte length. When the number of times of writing exceeds a predetermined value or for a block that actually has malfunctioned (indicating the above-mentioned erase block), the defective block numbers indicate a maximum of four groups of defective blocks. . This is information indicating the erase block number counted in ascending order from the lowest address in 1 byte. The erase block including 0x00000 is designated as 0 (reference), and is represented by a numerical value obtained by adding 1 in ascending order from here. When normal, it is indicated by 0xFF, and when a bad block occurs, one byte of 0x00-0x7F is stored in order from the lowest address.

図6は、延命対策アドレス管理領域202に格納されているアドレス管理情報格納例を示している。この例においては、使用フラグが使用状態である最上位アドレスのうちの使用フラグ(1−n)は、31である。即ち、アドレス管理情報31が最新アドレス管理情報となっている。よって、最新データ開始アドレス、データ長は下記のようになる。
データ1開始アドレス:0x001C400 データ1長:256Byte
データ2開始アドレス:0x001C780 データ2長:128Byte
データ3開始アドレス:0x001C9C0 データ3長: 64Byte
データ4開始アドレス:0x001CA00 データ4長:512Byte
このような例で、例えば不良ブロック番号が0xFFFFFF7Cであれば、アドレス0x1F000−0x1F3FFが不良ブロックであり、それ以外の消去ブロックは正常となる。
FIG. 6 shows an example of storing address management information stored in the life extension countermeasure address management area 202. In this example, the use flag (1-n) of the highest-order address whose use flag is in use is 31. That is, the address management information 31 is the latest address management information. Therefore, the latest data start address and data length are as follows.
Data 1 start address: 0x001C400 Data 1 length: 256 bytes
Data 2 start address: 0x001C780 Data 2 length: 128 bytes
Data 3 start address: 0x001C9C0 Data 3 length: 64 bytes
Data 4 start address: 0x001CA00 Data 4 length: 512 bytes
In such an example, if the bad block number is 0xFFFFFF7C, for example, the address 0x1F000-0x1F3FF is a bad block, and the other erase blocks are normal.

図7は、延命対策データ領域201の一部である0x1C000−0x1CFFFの構成を示している。アドレス0x1C000には、データ1、データ2、6群のデータ3及び、データ1の順で格納されている。   FIG. 7 shows the configuration of 0x1C000-0x1CFFF, which is a part of the life extension countermeasure data area 201. At address 0x1C000, data 1, data 2, data 3 of group 6, and data 1 are stored in this order.

また、現在有効である開始アドレスは、各データごとの最上位アドレスであり、データ1としては0x1C400(705)、データ2としては0x1C780(708)、データ3としては0x1C9CO(710)、データ4としては0x1CA00(711)となる。   The currently valid start address is the most significant address for each data. Data 1 is 0x1C400 (705), data 2 is 0x1C780 (708), data 3 is 0x1C9CO (710), and data 4 Becomes 0x1CA00 (711).

図8は、データ3における書込み後の延命対策データ領域201の一部である0x1C000−0x1D1000の構成例を示している。
この構成において、0x1CC00から連続してデータ1−4(812,813,814,815)が格納されている。尚、0x1CFCO−0x1CFFF(816)は未使用状態(空き)を示している。
FIG. 8 shows a configuration example of 0x1C000-0x1D1000 which is a part of the life extension countermeasure data area 201 after writing in the data 3.
In this configuration, data 1-4 (812, 813, 814, 815) is stored continuously from 0x1CC00. Note that 0x1CFCO-0x1CFFF (816) indicates an unused state (empty).

図9は、ホスト側からフラッシュメモリに15に書き込むデータの一構成例を示している。この構成例では、データ番号項目901、データ長項目402及びデータ項目903から構成される。データ番号項目901では、データ種別として1−4のいずれかの数値が指定される。データ長項目902では、データ長をバイト長で示し、データ項目903では、実データを指定する。この図9においては、データ1のデータ長が64Byteである一例を示している。   FIG. 9 shows a configuration example of data to be written to the flash memory 15 from the host side. This configuration example includes a data number item 901, a data length item 402, and a data item 903. In the data number item 901, any numerical value of 1-4 is designated as the data type. In the data length item 902, the data length is indicated by a byte length, and in the data item 903, actual data is designated. FIG. 9 shows an example in which the data length of data 1 is 64 bytes.

次に図10に示すフローチャートを参照して、本実施形態の動作について説明する。
まず、フラッシュ制御指示を入出カインタフェースから受信する(ステップS1)。その受信した指示が通常データ領域における読み書き処理の指示か否かを判定する(ステップS2)。この判定において、通常データ領域の読み書き処理であった場合には(YES)、フラッシュ通常データ領域における読み書き処理を行う(ステップS3)。具体的には、この指示が読み出し処理であった場合には、フラッシュ通常データ領域において指示されたアドレスから指示されたデータ長分を読み出す。一方、その指示が通常データ領域の書込み処理の場合には、FLASH通常データ領域の指示されたアドレスに指示されたデータを指示されたデータ長分書き込む。
Next, the operation of this embodiment will be described with reference to the flowchart shown in FIG.
First, a flash control instruction is received from the input / output interface (step S1). It is determined whether or not the received instruction is a read / write process instruction in the normal data area (step S2). In this determination, if the normal data area read / write processing is performed (YES), the flash normal data area read / write processing is performed (step S3). Specifically, if this instruction is a read process, the data length specified is read from the address specified in the normal flash data area. On the other hand, if the instruction is a normal data area write process, the specified data is written to the specified address in the FLASH normal data area for the specified data length.

前記ステップS2の判定で、通常データ領域における読み書き処理の指示ではなかった場合には(NO)、指示が延命対策データ領域の書込み指示であるか否かを判定する(ステップS4)。この判定で、指示が延命対策データ領域の書込み指示であった場合には(YES)、延命対策データ領域の書込み処理を実行する(ステップS5)。尚、延命対策データ領域の書込み処理は、図11に示すサブルーチンにより後に詳細に説明する。   If it is determined in step S2 that the instruction is not a read / write process in the normal data area (NO), it is determined whether or not the instruction is a write instruction in the life extension countermeasure data area (step S4). In this determination, if the instruction is an instruction to write the life extension data area (YES), write processing for the life extension data area is executed (step S5). The life extension countermeasure data area write processing will be described later in detail with reference to a subroutine shown in FIG.

一方、ステップS4の判定で、指示が延命対策データ領域の書込み指示でなければ(NO)、指示が延命対策データ領域の読み出し指示か否かを判定する(ステップS6)。この判定で読み出し指示であれば(YES)、延命対策データ領域23の読み出し処理を行う(ステップS7)。この延命対策データ領域23の読み出し処理は、図12に示すサブルーチンにより詳細に説明する。   On the other hand, if it is determined in step S4 that the instruction is not a write instruction for the life extension countermeasure data area (NO), it is determined whether or not the instruction is a read instruction for the life extension countermeasure data area (step S6). If it is a read instruction in this determination (YES), a read process of the life extension countermeasure data area 23 is performed (step S7). The reading process of the life extension countermeasure data area 23 will be described in detail with reference to a subroutine shown in FIG.

ここで、延命対策データ領域の読み出し指示であるときのサブルーチンを、図12を参照してフローチャートで説明する。
ホスト側は読み出しデータとして、データ番号3と読み出しバッファを指定し、延命対策データ領域読み出し指示を行う。まず、延命対策アドレス管理領域に格納されている最新のアドレス管理情報を確認し(ステップS21)、その最新の延命対策データ領域から読み出しを行う(ステップS22)。
Here, the subroutine for the instruction to read the life extension countermeasure data area will be described with reference to FIG.
The host side designates data number 3 and a read buffer as read data, and issues a life extension measure data area read instruction. First, the latest address management information stored in the life extension countermeasure address management area is confirmed (step S21), and reading is performed from the latest life extension countermeasure data area (step S22).

図11に戻り、さらに、ステップS3におけるフラッシュ通常データ領域における読み書き処理、ステップS5における延命対策データ領域の書込み処理、及びステップS7における延命対策データ領域23の読み出し処理の実行に対してエラーの発生の有無を判定する(ステップS8)。これは例えば、各サブルーチンでエラーの戻り値を返しているか、成功の戻り値を返しているかにより判定することができる。このエラー判定でエラーが発生していないと判定されたならば(NO)、正常に処理が終了したものと判断して、一連のシーケンスを終了する。   Returning to FIG. 11, further, an error occurs in the execution of the read / write process in the flash normal data area in step S3, the write process of the life extension data area in step S5, and the read process of the life extension data area 23 in step S7 The presence or absence is determined (step S8). This can be determined, for example, based on whether each subroutine returns an error return value or a success return value. If it is determined in this error determination that no error has occurred (NO), it is determined that the processing has been completed normally, and the series of sequences is terminated.

一方、ステップS8のエラー判定でエラーが発生したと判定されたならば(YES)、又はステップS6において、指示が延命対策データ領域23の読み出し指示でなかった場合には(NO)、ホスト側にエラーを返して(ステップS9)、このシーケンスを終了する。   On the other hand, if it is determined in step S8 that the error has occurred (YES), or if the instruction is not a read instruction for the life extension countermeasure data area 23 in step S6 (NO), the host side An error is returned (step S9), and this sequence is terminated.

この時、エラー報告に対して必要な処理やユーザへの告知処理を行ってもよい。 At this time, processing necessary for error reporting and notification processing to the user may be performed.

ここで、図11に示すフローチャートを参照して、ステップS5における延命対策データ領域の書込み処理について説明する。尚、ホスト側は書き込みデータとして、図9に示すデータ番号3(901)、データ長0x40(902)及びデータ本体(903)をそれぞれ指定し、延命対策データ領域23における書込み指示を行う。また、本実施形態においてフラッシュメモリ15の消去ブロックサイズは1KBとし、消去ブロック3個毎に延命対策データ領域23にデータ1−4を昇順に書き込むこととする。   Here, with reference to the flowchart shown in FIG. 11, the writing process of the life extension countermeasure data area in step S5 will be described. The host side designates data number 3 (901), data length 0x40 (902), and data body (903) shown in FIG. 9 as write data, and issues a write instruction in the life extension countermeasure data area 23. In this embodiment, the erase block size of the flash memory 15 is 1 KB, and data 1-4 is written in ascending order in the life extension countermeasure data area 23 for every three erase blocks.

まず、装置の制御部の指示によりMPU13が延命対策アドレス管理領域22に格納されているアドレス管理情報のうちの最新のものを確認する(ステップS11)。尚このS11の処理は、図13を参照しながら後に詳述する。次に、この確認において、エラーが発生したか否かを判定する(ステップS12)。この判定において、エラーが発生したならば(YES)、エラーの戻り値を返して(ステップS20)リターンし、サブルーチンを終了する。一方、ステップS12の判定でエラーが発生しなければ(NO)、延命対策データ領域23のうち未使用状態である最上位アドレスへの書き込みを行う(ステップS13)。この書き込み処理において、エラーが発生したか否かを判定する(ステップS14)。この判定において、エラーが発生したならば(YES)、エラーの戻り値を返して(ステップS20)リターンし、サブルーチンを終了する。   First, the MPU 13 confirms the latest address management information stored in the life extension address management area 22 in accordance with an instruction from the control unit of the apparatus (step S11). The process of S11 will be described in detail later with reference to FIG. Next, in this confirmation, it is determined whether or not an error has occurred (step S12). In this determination, if an error has occurred (YES), a return value of the error is returned (step S20), and the subroutine is terminated. On the other hand, if an error does not occur in the determination in step S12 (NO), writing to the highest address that is unused in the life extension measure data area 23 is performed (step S13). In this writing process, it is determined whether or not an error has occurred (step S14). In this determination, if an error has occurred (YES), a return value of the error is returned (step S20), and the subroutine is terminated.

一方、ステップS14の判定でエラーが発生しなければ(NO)、延命対策アドレス管理領域Aの更新を行う(ステップS15)。この更新において、エラーが発生したか否かを判定する(ステップS16)。この判定において、エラーが発生したならば(YES)、エラーの戻り値を返して(ステップS20)リターンし、サブルーチンを終了する。一方、このステップS16の判定でエラーが発生しなければ(NO)、引き続き、同じものを延命対策アドレス管理領域Bに更新する(ステップS17)。同様に、この更新においても、エラーが発生したか否かを判定する(ステップS18)。この判定において、エラーが発生したならば(YES)、エラーの戻り値を返して(ステップS20)リターンし、サブルーチンを終了する。一方、このステップS18の判定でエラーが発生しなければ(NO)、成功の戻り値を返して(ステップS19)リターンし、サブルーチンを終了する。   On the other hand, if no error occurs in the determination in step S14 (NO), the life extension countermeasure address management area A is updated (step S15). In this update, it is determined whether or not an error has occurred (step S16). In this determination, if an error has occurred (YES), a return value of the error is returned (step S20), and the subroutine is terminated. On the other hand, if no error occurs in the determination of step S16 (NO), the same one is updated to the life extension countermeasure address management area B (step S17). Similarly, in this update, it is determined whether an error has occurred (step S18). In this determination, if an error has occurred (YES), a return value of the error is returned (step S20), and the subroutine is terminated. On the other hand, if an error does not occur in the determination in step S18 (NO), a successful return value is returned (step S19), and the subroutine is terminated.

以下に、延命対策データ領域の書込み処理について詳細に説明する。
延命対策データ領域(201)の書込み指示であるときの処理を図11のフローチャートで説明する。その指示が延命対策データ領域の読み出しであるときの処理は図12に示すフローチャートで説明する。
Hereinafter, the writing process of the life extension countermeasure data area will be described in detail.
A process when a write instruction for the life extension measure data area (201) is given will be described with reference to the flowchart of FIG. Processing when the instruction is to read the life extension countermeasure data area will be described with reference to the flowchart shown in FIG.

また、図13に示すフローチャートを参照して、図11のステップS11におけるアドレス管理情報の確認処理について説明する。   The address management information confirmation process in step S11 of FIG. 11 will be described with reference to the flowchart shown in FIG.

まず、延命対策アドレス管理領域A(302)のアドレス管理情報31(0x1AB64−0x1AB7F)と延命対策アドレス管理領域B(301)のアドレス管理情報31(0x1BB64−0x1BB7F)とのデータ比較処理を行う(ステップS31)。尚この比較処理は、図14を参照しながら後に詳述する。この比較処理において、エラーが発生したか否かを判定する(ステップS32)。この判定において、エラーが発生したならば(YES)、エラーの戻り値を返して(ステップS34)リターンし、サブルーチンを終了する。一方、比較処理においてエラーが発生しなければ(NO)、新アドレス管理情報として確定する(ステップS33)。   First, data comparison processing is performed between the address management information 31 (0x1AB64-0x1AB7F) in the life extension address management area A (302) and the address management information 31 (0x1BB64-0x1BB7F) in the life extension countermeasure address management area B (301) (step) S31). This comparison process will be described later in detail with reference to FIG. In this comparison process, it is determined whether an error has occurred (step S32). In this determination, if an error occurs (YES), a return value of the error is returned (step S34), and the subroutine is terminated. On the other hand, if no error occurs in the comparison process (NO), the new address management information is determined (step S33).

次に、不良ブロック番号がアドレス管理情報と一致するか否かを判定する(ステップS35)。この判定で、不良ブロック番号とアドレス管理情報とが一致すれば(YES)、ステップS34に移行し、エラーの戻り値を返してリターンし、サブルーチンを終了する。一方、一致しなければ(NO)、成功の戻り値を返して(ステップS36)リターンし、サブルーチンを終了する。   Next, it is determined whether or not the bad block number matches the address management information (step S35). If it is determined that the bad block number matches the address management information (YES), the process proceeds to step S34, an error return value is returned, and the subroutine is terminated. On the other hand, if they do not match (NO), a successful return value is returned (step S36), and the subroutine is terminated.

尚、現アドレス管理情報、新アドレス管理情報、現データ開始アドレス、新データ開始アドレスのいずれかが不良ブロックに該当する場合には、ホストにエラーを通知して処理を終了する。以降の説明を行うため、不良ブロックに該当しないものとする。   If any of the current address management information, the new address management information, the current data start address, and the new data start address corresponds to a defective block, an error is notified to the host and the process is terminated. For the following explanation, it is assumed that the block does not correspond to a bad block.

次に、図14に示すフローチャートを参照して、延命対策アドレス管理領域Aと延命対策アドレス管理領域Bデータ比較処理について説明する。   Next, the life extension countermeasure address management area A and the life extension countermeasure address management area B data comparison processing will be described with reference to the flowchart shown in FIG.

延命対策アドレス管理領域A(302)のアドレス管理情報31(0x1AB64−0x1AB7F)と、延命対策アドレス管理領域B(301)のアドレス管理情報31(0x1BB64−0x1BB7F)を比較する(ステップS41)。   The address management information 31 (0x1AB64-0x1AB7F) in the life extension countermeasure address management area A (302) is compared with the address management information 31 (0x1BB64-0x1BB7F) in the life extension countermeasure address management area B (301) (step S41).

次に、この比較において、全ての使用フラグに対して一致を確認したか否かを判定する(ステップS42)、この判定で全ての使用フラグを確認した場合には(YES)、ホストにエラーの戻り値を返し、処理を終了する(ステップS46)。一方、まだ全ての使用フラグを確認していない場合には(NO)、確認フラグ(2B)が固定値か否かを判定する(ステップS43)。   Next, in this comparison, it is determined whether or not a match is confirmed for all the use flags (step S42). If all the use flags are confirmed in this determination (YES), an error is detected in the host. A return value is returned, and the process ends (step S46). On the other hand, if all the use flags have not been confirmed yet (NO), it is determined whether or not the confirmation flag (2B) is a fixed value (step S43).

このステップS43の判定で確認フラグが固定値でなければ(NO)、いずれか片方が不一致か否かを判定する(ステップS44)。この判定は、延命対策アドレス管理領域A又はBのいずれか一方の通常用いている延命対策アドレス管理領域に不具合が発生したか否かを見出すものである。このステップS44の判定で片方が不一致でなければ(NO)、即ち、両方とも不一致であれば、ステップS46に移行して、エラーの戻り値を返して(ステップS46)リターンし、サブルーチンを終了する。一方、片方が不一致であれば(YES)、有効な使用フラグがあるか否かを判別する(ステップS45)。このステップS45の判定で、有効な使用フラグが無ければ、ステップS46のエラーの戻り値を返してサブルーチンを終了する。一方、有効な使用フラグがある場合には(YES)、誤ったアドレス管理情報を更新して正しいアドレス管理情報に修正し、(ステップS50)、成功の戻り値を返して(ステップS51)、リターンする。   If the confirmation flag is not a fixed value in the determination in step S43 (NO), it is determined whether or not one of the two is inconsistent (step S44). This determination is to find out whether or not a failure has occurred in the normal life extension address management area of either one of the life extension address management areas A or B. If it is determined in step S44 that one does not match (NO), that is, if both do not match, the process proceeds to step S46, an error return value is returned (step S46), and the subroutine is terminated. . On the other hand, if one does not match (YES), it is determined whether there is a valid use flag (step S45). If it is determined in step S45 that there is no valid use flag, the error return value in step S46 is returned and the subroutine is terminated. On the other hand, if there is a valid use flag (YES), the incorrect address management information is updated and corrected to the correct address management information (step S50), a successful return value is returned (step S51), and the return To do.

また、ステップS43の判定で確認フラグ(2B)が固定値であれば(YES)、延命対策アドレス管理領域A(302)と延命対策アドレス管理領域B(301)におけるそれぞれのアドレス管理情報31の使用フラグが使用状態にあるか否かを判定する(ステップS47)。   If the confirmation flag (2B) is a fixed value in the determination in step S43 (YES), the use of the address management information 31 in the life extension address management area A (302) and the life extension address management area B (301), respectively. It is determined whether or not the flag is in use (step S47).

このステップS47の判定で、共に使用フラグが使用状態であれば(YES)、それぞれのアドレス管理情報31が一致するか否かを判定する(ステップS48)。一方、ステップS47で使用フラグが使用状態でない場合(NO)又は、ステップS48でアドレス管理情報31が一致しなければ(NO)、1つ前の使用フラグに戻り確認し(ステップS49)、ステップS42に戻る。また、ステップS48の判定でアドレス管理情報31が一致したならば(YES)、成功の戻り値を返して(ステップS51)、リターンする。   If it is determined in step S47 that both use flags are in use (YES), it is determined whether or not the respective address management information 31 matches (step S48). On the other hand, if the use flag is not in use in step S47 (NO), or if the address management information 31 does not match in step S48 (NO), the process returns to the previous use flag and confirms (step S49). Return to. If the address management information 31 matches in the determination in step S48 (YES), a successful return value is returned (step S51), and the process returns.

次に、図15に示すフローチャートを参照して、延命対策データ領域への書き込み処理(S5)について説明する。
新データ開始アドレス0x1CC00と延命対策データ領域の開始アドレス0x1C000のオフセットが消去ブロックサイズ1KBの3個分のサイズ(3KB)の整数倍であり且つ、最新の最下位アドレスへの書き込みか否かを判定する(ステップS61)。この判定で、整数倍であれば(YES)、アドレス管理情報31(図6)のデータ1−4を順に書き込む(ステップS62)。
Next, the writing process (S5) to the life extension countermeasure data area will be described with reference to the flowchart shown in FIG.
It is determined whether the offset of the new data start address 0x1CC00 and the life extension countermeasure data area start address 0x1C000 is an integral multiple of the size of three erase block sizes 1 KB (3 KB) and whether writing to the latest lowest address is performed. (Step S61). In this determination, if it is an integer multiple (YES), the data 1-4 of the address management information 31 (FIG. 6) is written in order (step S62).

まず、アドレス管理情報31(図6)のデータ1開始アドレス項目、データ1長項目を参照し、該当アドレスからデータ1を読み出し、データ1を延命対策データ領域(201)アドレス0x1CC00から0x1CD00に書き込む。以下同様に、アドレス管理情報31のデータ2開始アドレス項目、データ2長項目を参照し、該当アドレスからデータ2を読み出し、データ2を延命対策データ領域(201)アドレス0x1CD00から0x1CD80に書き込む。データ3として、ユーザから指定された図9のデータ本体を延命対策データ領域(201)アドレス0x1CD80から0x1CDCOに書き込む。アドレス管理情報31(図6)のデータ4開始アドレス項目、データ4長項目を参照し、該当アドレスからデータ4を読み出し、データ4を延命対策データ領域(201)アドレス0x1CDCOから0x1CFCOに書き込む。次に、新データ開始アドレス0x1CC00の直前の消去ブロック3個分として、延命対策データ領域(201)アドレス0x1C000から消去ブロック3個を消去する(ステップS64)。その後、後述するステップS65に移行する。   First, referring to the data 1 start address item and the data 1 length item of the address management information 31 (FIG. 6), the data 1 is read from the corresponding address, and the data 1 is written from the life extension countermeasure data area (201) address 0x1CC00 to 0x1CD00. Similarly, the data 2 start address item and the data 2 length item of the address management information 31 are referred to, the data 2 is read from the corresponding address, and the data 2 is written to the life extension countermeasure data area (201) addresses 0x1CD00 to 0x1CD80. As data 3, the data body shown in FIG. 9 designated by the user is written from the life extension data area (201) address 0x1CD80 to 0x1CDCO. With reference to the data 4 start address item and the data 4 length item of the address management information 31 (FIG. 6), the data 4 is read from the corresponding address, and the data 4 is written from the life extension countermeasure data area (201) address 0x1CDCO to 0x1CFCO. Next, three erase blocks are erased from the life extension countermeasure data area (201) address 0x1C000 as three erase blocks immediately before the new data start address 0x1CC00 (step S64). Thereafter, the process proceeds to step S65 described later.

一方、ステップS61の判定で、整数倍ではなく且つ/又は最下位アドレスへの書き込みでなかった場合には(NO)、ユーザから指定されたデータ本体を延命対策データ領域(201)アドレス0x1CFCOから0x1CFFFに書き込む(ステップS63)。   On the other hand, if it is determined in step S61 that the data body is not an integral multiple and / or not written to the lowest address (NO), the data body designated by the user is transferred from the life extension countermeasure data area (201) address 0x1CFCO to 0x1CFFF. (Step S63).

次に、書き込み処理、及び消去処理が正常終了しているか否かを判別する(ステップS65)。この判定で、書き込み処理、及び消去処理が正常終了していたならば(YES)、ホストに成功の戻り値を返して(ステップS67)リターンし、サブルーチンを終了する。一方、書き込み処理、及び消去処理が正常終了していなければ(NO)、不良ブロック番号を更新し、ホストにエラーの戻り値を返して終了する(ステップS66)。   Next, it is determined whether or not the writing process and the erasing process are normally completed (step S65). If it is determined that the writing process and the erasing process are normally completed (YES), a success return value is returned to the host (step S67), and the subroutine is terminated. On the other hand, if the writing process and the erasing process are not normally completed (NO), the defective block number is updated, and an error return value is returned to the host and the process is terminated (step S66).

次に、図16に示すフローチャートを参照して、図11のステップS13に示した延命対策アドレス管理領域A更新について説明する。尚、説明を省略するが、図11のステップS17に示す延命対策アドレス領域Bの更新処理も同様の処理を行う。
まず、消去ブロックの最下位アドレスへの書き込み時のみ、前のブロックの最上位アドレス管理情報をこの消去ブロックの最下位アドレスにコピーし(ステップS71)、そのコピーが正しく行われたかを判定する(ステップS72)。この判定で、正しく行われたならば(YES)、アドレス管理情報の書き込みを行う(ステップS73)。この書き込みは、例えば、延命対策アドレス管理領域A(302)のアドレス管理情報32(0x1AB80−0x1AB9B)のデータ1開始アドレスに0x1CC00を書き込む。データ1長に0x0100を書き込む。データ2開始アドレスに0x1CD00を書き込む。データ2長に0x0080を書き込む。データ3開始アドレスに0x1CD80を書き込む。さらに、データ3長は0x0040を、データ4開始アドレスに0x1CDCOを書き込む。データ4長に0x0200を書き込む。次に、これらの書き込みが正しく行われたかを判定する(ステップS76)。
Next, the life extension countermeasure address management area A update shown in step S13 of FIG. 11 will be described with reference to the flowchart shown in FIG. Although the description is omitted, the same process is performed for the updating process of the life extension address area B shown in step S17 of FIG.
First, only at the time of writing to the lowest address of the erase block, the highest address management information of the previous block is copied to the lowest address of this erase block (step S71), and it is determined whether the copy has been performed correctly (step S71). Step S72). If the determination is correct (YES), address management information is written (step S73). In this writing, for example, 0x1CC00 is written to the data 1 start address of the address management information 32 (0x1AB80-0x1AB9B) in the life extension countermeasure address management area A (302). Write 0x0100 to data 1 length. Write 0x1CD00 to the data 2 start address. Write 0x0080 to the data 2 length. Write 0x1CD80 to the data 3 start address. Further, 0x0040 is written for the data 3 length, and 0x1CDCO is written to the data 4 start address. Write 0x0200 to data 4 length. Next, it is determined whether or not these writings are correctly performed (step S76).

一方、ステップS72の判定において、正しくコピーされなかった場合(NO)及びステップ76の判定において、正しく書き込みが行われなかった場合(NO)、不良ブロック番号を更新し(ステップS74)、ホストにエラー値を返して(ステップS75)リターンし、サブルーチンを終了する。   On the other hand, if the copy is not correctly performed in the determination in step S72 (NO) and the write is not performed correctly in the determination in step 76 (NO), the bad block number is updated (step S74), and an error occurs in the host. The value is returned (step S75), and the subroutine is terminated.

また、ステップS76の判定において、正しく書き込みが行われたならば(YES)、使用フラグ32を使用状態に更新する(ステップS77)。次に、消去ブロックの最下位アドレスへの書き込み時のみ、前のブロックを消去し、確認フラグの書き込みを行う(ステップS78)。次に、ホストに成功の戻り値を返して(ステップS79)リターンし、サブルーチンを終了する。   If the writing is correctly performed in the determination in step S76 (YES), the use flag 32 is updated to the use state (step S77). Next, only when writing to the lowest address of the erase block, the previous block is erased and a confirmation flag is written (step S78). Next, a successful return value is returned to the host (step S79), and the subroutine is terminated.

次に前述した処理において、データ3を書き込む場合について説明する。
ホスト側は書き込みデータとして、図9に示すデータ番号3(901)とデータ長0x40(902)とデータ本体(903)を指定し、延命対策データ領域(201)書込み指示を行う(S5)。
まず、延命対策アドレス管理領域(202)に格納されているアドレス管理情報確認処理(図11のS11、図13のS31、図14のS41)を行う。延命対策アドレス管理領域A(302)の最上位アドレスの消去ブロックであるアドレス0x1AC00−0x1AFFFの確認フラグ(0x1AFFE)を確認し(図14 S43)、0x1111と一致するか否かを判定し、一致する場合は次に移行する。不一致の場合には、次の消去ブロックの確認フラグを確認する。次に使用フラグを上位アドレスから順に確認し、0x1111と一致する使用フラグ番号があるか否かを判定する。
Next, a case where data 3 is written in the above-described processing will be described.
The host side designates data number 3 (901), data length 0x40 (902) and data body (903) shown in FIG. 9 as write data, and issues a life extension countermeasure data area (201) write instruction (S5).
First, address management information confirmation processing (S11 in FIG. 11, S31 in FIG. 13, S41 in FIG. 14) stored in the life extension countermeasure address management area (202) is performed. The confirmation flag (0x1AFFE) of the address 0x1AC00-0x1AFFF which is the erase block of the highest address in the life extension address management area A (302) is confirmed (S43 in FIG. 14), and it is determined whether or not it matches 0x1111. If so, then move on. If they do not match, the confirmation flag of the next erase block is confirmed. Next, the usage flags are checked in order from the higher address, and it is determined whether there is a usage flag number that matches 0x1111.

この判定で、一致する使用フラグがないことからアドレス0x1A800−0x1AC00の使用フラグが消去ブロックである、延命対策アドレス管理領域A(302)アドレス0x1A800−0x1ABFF(図6)の確認フラグ(0x1ABFE)を確認し(図14 S43)、0x1111と一致する場合は次に移行する。一方、不一致の場合には、次の消去ブロックの確認フラグを確認する。   In this determination, since there is no matching use flag, the confirmation flag (0x1ABFE) of the life extension countermeasure address management area A (302) address 0x1A800-0x1ABFF (FIG. 6) whose address 0x1A800-0x1AC00 is the erase block is confirmed. If it matches 0x1111 (S43 in FIG. 14), the process proceeds to the next. On the other hand, if they do not match, the confirmation flag of the next erase block is confirmed.

次に、使用フラグを上位アドレスから順に確認し、0x1111と一致するか否かを判定する。この判定で一致するならば、使用フラグ番号があるか否かを確認する。データ3であるため、一致する使用フラグ番号が32であることから、アドレス管理情報32が現在有効な情報であることがわかる。そのアドレス管理情報32を参照する。   Next, the use flag is checked in order from the higher address, and it is determined whether or not it matches 0x1111. If they match in this determination, it is confirmed whether there is a use flag number. Since it is the data 3, since the matching use flag number is 32, it is understood that the address management information 32 is currently valid information. The address management information 32 is referred to.

使用フラグ32(0x1ABF8)の延命対策アドレス管理領域A(302)の最下位アドレス(0x1A000)からのオフセットは、0xBF8である。これに対応する延命対策アドレス管理領域B(301)の最下位アドレス(0x1B000)から同じオフセット0xBF8である使用フラグ32(0x1BBF8)を参照する(図14 S47)。この使用フラグが0x1111と一致する場合は次に移行する(図14 S48)。一方、不一致の場合は次の使用フラグを確認する。   The offset of the use flag 32 (0x1ABF8) from the lowest address (0x1A000) of the life extension address management area A (302) is 0xBF8. The use flag 32 (0x1BBF8) having the same offset 0xBF8 is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B (301) corresponding to this (S47 in FIG. 14). If this use flag matches 0x1111, the process proceeds to the next (S48 in FIG. 14). On the other hand, if they do not match, the next use flag is confirmed.

アドレス管理情報32(0x1AB80−0x1AB9B)の延命対策アドレス管理領域A(302)の最下位アドレス(0x1A000)からのオフセットは、0xB80である。延命対策アドレス管理領域B(301)の最下位アドレス(0x1B000)から同じオフセット0xB80であるアドレス管理情報32(0x1BB80−0x1BB9B)を参照する。   The offset of the address management information 32 (0x1AB80-0x1AB9B) from the lowest address (0x1A000) of the life extension address management area A (302) is 0xB80. The address management information 32 (0x1BB80-0x1BB9B) having the same offset 0xB80 is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B (301).

延命対策アドレス管理領域Aのアドレス管理情報32(0x1AB80−0x1AB9B)と延命対策アドレス管理領域Bのアドレス管理情報32(0x1BB80−0x1BB9B)を比較する(図14 S48)。一致したならば、次に移行する(図14 S51)。延命対策アドレス管理領域A(302)のアドレス管理情報32(0x1AB80−0x1AB9B)に“1”を加算した、アドレス管理情報33(0x1AB9C−0x1ABB7)が延命対策アドレス管理領域A(302)の新アドレス管理情報と確定する。同様に、延命対策アドレス管理領域B(301)のアドレス管理情報32(0x1BB80−0x1BB9B)に“1”加算した、アドレス管理情報33(0x1BB9C−0x1BBB7)が延命対策アドレス管理領域B(301)の新アドレス管理情報と確定する(図13 S33)。   The address management information 32 (0x1AB80-0x1AB9B) in the life extension countermeasure address management area A is compared with the address management information 32 (0x1BB80-0x1BB9B) in the life extension countermeasure address management area B (S48 in FIG. 14). If they match, the process proceeds to the next (S51 in FIG. 14). Address management information 33 (0x1AB9C-0x1ABB7) obtained by adding “1” to the address management information 32 (0x1AB80-0x1AB9B) in the life extension countermeasure address management area A (302) is the new address management in the life extension countermeasure address management area A (302). Confirm with information. Similarly, "1" is added to the address management information 32 (0x1BB80-0x1BB9B) in the life extension address management area B (301), and the address management information 33 (0x1BB9C-0x1BBB7) is new in the life extension countermeasure address management area B (301). The address management information is determined (S33 in FIG. 13).

次に、アドレス管理情報(図6)の開始アドレス項目1−4を参照して開始アドレスを比較し、最上位アドレスのデータ番号が4であり、開始アドレスは0x1CDCOであることがわかる。データ4長を参照し、開始アドレス0x1CDCOにデータ4長0x0200を加算し、新データ開始アドレスが0x1CFCOと確定する。   Next, the start address is compared with reference to the start address item 1-4 of the address management information (FIG. 6), and it is found that the data number of the highest address is 4 and the start address is 0x1CDCO. The data 4 length is referred to, the data 4 length 0x0200 is added to the start address 0x1CDCO, and the new data start address is determined to be 0x1CFCO.

アドレス管理情報(図5)の不良ブロック番号項目を参照し(図13 S35)、不良ブロック番号は0x7Cであり、アドレス0x1F000−0x1F3FFが不良ブロックであり、それ以外の消去ブロックは正常であることがわかる。現アドレス管理情報、新アドレス管理情報、現データ開始アドレス、新データ開始アドレスのいずれも不良ブロックに該当しないため次に移行する(図13 S36)。   Referring to the bad block number item of the address management information (FIG. 5) (S35 in FIG. 13), the bad block number is 0x7C, the address 0x1F000-0x1F3FF is a bad block, and the other erase blocks are normal. Recognize. Since none of the current address management information, the new address management information, the current data start address, and the new data start address corresponds to a defective block, the process proceeds to the next (S36 in FIG. 13).

次に延命対策データ領域(201)への書き込みを行う(S13)。新データ開始アドレス0x1CFCOと延命対策データ領域の開始アドレス0x1C000のオフセットが消去ブロックサイズ1KBの3個分のサイズ(3KB)の整数倍であるか否かを判定する(図15 S61)。   Next, writing to the life extension countermeasure data area (201) is performed (S13). It is determined whether or not the offset between the new data start address 0x1CFCO and the life extension countermeasure data area start address 0x1C000 is an integral multiple of the size (3KB) of three erase block sizes 1KB (S61 in FIG. 15).

この判定で整数倍でないことを確認する。そこで、データ3として、ユーザから指定されたデータ本体を延命対策データ領域(201)アドレス0x1CFCOから0x1CFFFに書き込む(S13,S63)。   This determination confirms that it is not an integer multiple. Therefore, the data body designated by the user is written as data 3 from the life extension countermeasure data area (201) address 0x1CFCO to 0x1CFFF (S13, S63).

次に、延命対策アドレス管理領域A(302)のアドレス管理情報33(0x1AB9C−0x1ABB7)のデータ1開始アドレス、データ1長、データ2開始アドレス、データ2長、データ4開始アドレス、データ4長、不良ブロック番号について、アドレス管理情報32(0x1AB80−0x1AB9B)と同じデータを書き込む(S15)。   Next, the data 1 start address, data 1 length, data 2 start address, data 2 length, data 4 start address, data 4 length of the address management information 33 (0x1AB9C-0x1ABB7) in the life extension countermeasure address management area A (302), For the bad block number, the same data as the address management information 32 (0x1AB80-0x1AB9B) is written (S15).

データ3開始アドレスは新データ開始アドレスとして、0x1CFCO、データ3長は0x0040を書き込む(S73)。使用フラグ32を使用状態に更新する(S15,S77)。   The data 3 start address is written as 0x1CFCO as the new data start address, and the data 3 length is written as 0x0040 (S73). The use flag 32 is updated to the use state (S15, S77).

そして、延命対策アドレス管理領域B(301)のアドレス管理情報33(0x1BB9C−0x1BBB7)のデータ1開始アドレス、データ1長、データ2開始アドレス、データ2長、データ3開始アドレス、データ3長、データ4開始アドレス、データ4長、不良ブロック番号も同様に更新する(S73)。そして、使用フラグ33を使用状態に更新する (S17、S77)。ユーザに書込み成功結果を通知し、処理を終了する(S19)。   The data 1 start address, data 1 length, data 2 start address, data 2 length, data 3 start address, data 3 length, data of the address management information 33 (0x1BB9C-0x1BBB7) in the life extension countermeasure address management area B (301) The 4 start address, the data 4 length, and the bad block number are similarly updated (S73). Then, the use flag 33 is updated to the use state (S17, S77). The user is notified of the result of successful writing, and the process ends (S19).

次に前述した処理の次に、再度データ3を書き込む場合について説明する。   Next, a case where the data 3 is written again after the above-described processing will be described.

ホスト側は、書き込みデータとして、図9に示すデータ番号3(901)とデータ長0x40(902)とデータ本体(903)を指定し、延命対策データ領域(201)書込み指示を行う(S5)。   The host side designates the data number 3 (901), the data length 0x40 (902), and the data body (903) shown in FIG. 9 as write data, and issues a life extension countermeasure data area (201) write instruction (S5).

まず、延命対策アドレス管理領域(202)に格納されているアドレス管理情報確認処理(図11 S11、図13)を行う。延命対策アドレス管理領域A(302)の最上位アドレスの消去ブロックである0x1AC00−0x1AFFFの確認フラグ(0x1AFFE)が、0x1111と一致するか否かを判定し(S43)、次に移行する。この不一致の場合は、次の消去ブロックの確認フラグを確認する。次に、使用フラグを上位アドレスから順に確認し、0x1111と一致する使用フラグ番号があるか否かを判定する。この判定において、一致する使用フラグがないことから、次の消去ブロックである、0x1A800−0x1ABFF(図6)の確認フラグ(0x1ABFE)を確認し、0x1111と一致するか否かを判定する。この判定で一致する場合は次に移行する。一方、不一致の場合には、次の消去ブロックの確認フラグを確認する。   First, the address management information confirmation process (FIG. 11, S11, FIG. 13) stored in the life extension countermeasure address management area (202) is performed. It is determined whether or not the confirmation flag (0x1AFFE) of 0x1AC00-0x1AFFF, which is the erase block of the highest address in the life extension countermeasure address management area A (302), matches 0x1111 (S43). In the case of this mismatch, the confirmation flag of the next erase block is confirmed. Next, the usage flags are checked in order from the higher address, and it is determined whether there is a usage flag number that matches 0x1111. In this determination, since there is no matching use flag, the confirmation flag (0x1ABFE) of 0x1A800-0x1ABFF (FIG. 6), which is the next erase block, is confirmed to determine whether or not it matches 0x1111. If they match in this determination, the process proceeds to the next. On the other hand, if they do not match, the confirmation flag of the next erase block is confirmed.

次に使用フラグを上位アドレスから順に確認し、0x1111と一致する使用フラグ番号があるか否かを判定する。この判定で、一致する使用フラグ番号が33であれば、アドレス管理情報33が現在有効な情報であることがわかる。そのアドレス管理情報33を参照する。使用フラグ33(0x1ABFA)の延命対策アドレス管理領域A(302)の最下位アドレス(0x1A000)からのオフセットは、0xBFAである。これに対応する延命対策アドレス管理領域B(301)の最下位アドレス(0x1B000)から同じオフセット0xBFAである使用フラグ33(0x1BBFA)を参照する。この使用フラグが0x1111と一致するか否かを判定する(S47)。この判定で一致する場合は、次に移行する。一方、不一致であった場合は、次の使用フラグを確認する。   Next, the usage flags are checked in order from the higher address, and it is determined whether there is a usage flag number that matches 0x1111. In this determination, if the matching use flag number is 33, it is understood that the address management information 33 is currently valid information. The address management information 33 is referred to. The offset of the use flag 33 (0x1ABFA) from the lowest address (0x1A000) of the life extension address management area A (302) is 0xBFA. The use flag 33 (0x1BBFA) having the same offset 0xBFA is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B (301) corresponding thereto. It is determined whether or not this use flag matches 0x1111 (S47). If they match in this determination, the process proceeds to the next. On the other hand, if there is a mismatch, the next use flag is confirmed.

アドレス管理情報33(0x1AB9C−0x1ABB7)の延命対策アドレス管理領域A(302)の最下位アドレス(0x1A000)からのオフセットは、0xB9Cである。延命対策アドレス管理領域Bの最下位アドレス(0x1B000)から同じオフセット0xB9Cであるアドレス管理情報33(0x1BB9C−0x1BBB7)を参照する。延命対策アドレス管理領域A(302)のアドレス管理情報33(0x1AB9C−0x1ABB7)と延命対策アドレス管理領域B(301)のアドレス管理情報33(0x1BB9C−0x1BBB7)を比較する(S48)。この比較において、一致するため次に移行する(S51)。   The offset of the address management information 33 (0x1AB9C-0x1ABB7) from the lowest address (0x1A000) of the life extension address management area A (302) is 0xB9C. The address management information 33 (0x1BB9C-0x1BBB7) having the same offset 0xB9C is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B. The address management information 33 (0x1AB9C-0x1ABB7) in the life extension countermeasure address management area A (302) is compared with the address management information 33 (0x1BB9C-0x1BBB7) in the life extension countermeasure address management area B (301) (S48). In this comparison, since they match, the process proceeds to the next (S51).

延命対策アドレス管理領域A(302)のアドレス管理情報33(0x1AB9C−0x1ABB7)に“1”加算させると、最大管理番号33を超過する。このため、次の消去ブロックの最下位アドレスを計算し、アドレス管理情報0(0x1AC00−0x1ACFF)が延命対策アドレス管理領域A(302)の新アドレス管理情報と確定する。同様に、延命対策アドレス管理領域B(301)のアドレス管理情報33(0x1BB9C−0x1BBB7)に“1”加算すると管理番号33を超過する。このため、次の消去ブロックの最下位アドレスを計算し、アドレス管理情報0(0x1BC00−0x1BCFF)が延命対策アドレス管理領域B(301)の新アドレス管理情報と確定する(S33)。   When "1" is added to the address management information 33 (0x1AB9C-0x1ABB7) in the life extension countermeasure address management area A (302), the maximum management number 33 is exceeded. Therefore, the lowest address of the next erase block is calculated, and the address management information 0 (0x1AC00-0x1ACFF) is determined as the new address management information in the life extension countermeasure address management area A (302). Similarly, when “1” is added to the address management information 33 (0x1BB9C-0x1BBB7) in the life extension countermeasure address management area B (301), the management number 33 is exceeded. Therefore, the lowest address of the next erase block is calculated, and the address management information 0 (0x1BC00-0x1BCFF) is determined as the new address management information in the life extension countermeasure address management area B (301) (S33).

新しい消去ブロックの最下位アドレスヘの書き込みなので、前のアドレス管理情報33(0x1AB9C−0x1ABB7)を参照し、この情報を延命対策アドレス管理領域A(302)のアドレス管理情報0(0x1AC00−0x1AC1B)に書き込む。(S71)
使用フラグ0を使用状態に更新する。同様に、この情報を延命対策アドレス管理領域B(301)のアドレス管理情報0(0x1BC00−0x1BC1B)に書き込む。使用フラグ0を使用状態に更新する。
Since writing to the lowest address of the new erase block, the previous address management information 33 (0x1AB9C-0x1ABB7) is referred to and this information is stored in the address management information 0 (0x1AC00-0x1AC1B) of the life extension countermeasure address management area A (302). Write. (S71)
Update use flag 0 to use state. Similarly, this information is written to address management information 0 (0x1BC00-0x1BC1B) in the life extension address management area B (301). Update use flag 0 to use state.

次にアドレス管理情報33(0x1AB9C−0x1ABB7)の開始アドレス項目1−4を参照して大きさを比較する。この比較において、最上位アドレスのデータ番号が3であれば、開始アドレスは0x1CFCOであることがわかる。データ3長を参照し、開始アドレス0x1CFCOにデータ3長0x040を加算し、新データ開始アドレスが0x1D000と確定する(S33)。   Next, the size is compared with reference to the start address item 1-4 of the address management information 33 (0x1AB9C-0x1ABB7). In this comparison, if the data number of the most significant address is 3, it can be seen that the start address is 0x1CFCO. The data 3 length is referred to, the data 3 length 0x040 is added to the start address 0x1CFCO, and the new data start address is determined to be 0x1D000 (S33).

アドレス管理情報(図5)の不良ブロック番号項目を参照する(S35)。不良ブロック番号は0x7Cであり、アドレス0x1F000−0x1F3FFが不良ブロックであり、それ以外の消去ブロックは正常であることがわかる。現アドレス管理情報、新アドレス管理情報、現データ開始アドレス、新データ開始アドレスのいずれも不良ブロックに該当しないため、次に移行する(S36)。   The bad block number item of the address management information (FIG. 5) is referred to (S35). It can be seen that the bad block number is 0x7C, the address 0x1F000-0x1F3FF is a bad block, and the other erase blocks are normal. Since none of the current address management information, the new address management information, the current data start address, and the new data start address corresponds to a defective block, the process proceeds to the next (S36).

次に、延命対策データ領域(201)への書き込みを行う(S13)。新データ開始アドレス0x1D000と延命対策データ領域(201)の開始アドレス0x1C000のオフセットが消去ブロックサイズ1KBの3個分のサイズ(3KB)の整数倍であるか否かを判定する(S61)。この判定で、整数倍でないことが確認される。そこで、データ3として、ユーザから指定されたデータ本体を0x1D000から0x1D03Fに書き込む(S63)。   Next, writing to the life extension countermeasure data area (201) is performed (S13). It is determined whether or not the offset between the new data start address 0x1D000 and the start address 0x1C000 of the life extension countermeasure data area (201) is an integral multiple of the size (3KB) of three erase block sizes 1KB (S61). This determination confirms that it is not an integer multiple. Therefore, the data body designated by the user is written from 0x1D000 to 0x1D03F as data 3 (S63).

次に延命対策アドレス管理領域A(302)のアドレス管理情報1(0x1AC1C−0x1AC37)のデータ1開始アドレス、データ1長、データ2開始アドレス、データ2長、データ4開始アドレス、データ4長、不良ブロック番号について、アドレス管理情報33(0x1AB9C−0x1ABB7)と同じデータを書き込む。データ3開始アドレスは新データ開始アドレスとして0x1D000、データ3長は0x0040を書き込む(1603)(S73)。使用フラグ1を使用状態に更新する(S77、S15)。   Next, the data 1 start address, data 1 length, data 2 start address, data 2 length, data 4 start address, data 4 length, failure of the address management information 1 (0x1AC1C-0x1AC37) in the life extension address management area A (302) The same data as the address management information 33 (0x1AB9C-0x1ABB7) is written for the block number. The data 3 start address is written as 0x1D000 as the new data start address, and the data 3 length is written as 0x0040 (1603) (S73). The use flag 1 is updated to the use state (S77, S15).

そして、延命対策アドレス管理領域B(301)のアドレス管理情報1(0x1BC1C−0x1BC37)のデータ1開始アドレス、データ1長、データ2開始アドレス、データ2長、データ3開始アドレス、データ3長、データ4開始アドレス、データ4長、不良ブロック番号も同様に更新する(S73)。そして、使用フラグ1を使用状態に更新する(S77、S17)。   The data 1 start address, data 1 length, data 2 start address, data 2 length, data 3 start address, data 3 length, data of the address management information 1 (0x1BC1C-0x1BC37) in the life extension address management area B (301) The 4 start address, the data 4 length, and the bad block number are similarly updated (S73). Then, the use flag 1 is updated to the use state (S77, S17).

次に延命対策アドレス管理領域A(302)の古いアドレス管理情報を含む消去ブロック1個(0x1A800−0x1ABFF)を消去し、確認フラグ(0x1ABFE)を書き込む。続いて延命対策アドレス管理領域B(301)の古いアドレス管理情報を含む消去ブロック1個(0x1B800−0x1BBFF)を消去し、確認フラグ(0x1BBFE)を書き込む(S78)。ユーザに書込み成功結果を通知し、処理を終了する(S79)。   Next, one erase block (0x1A800-0x1ABFF) including old address management information in the life extension countermeasure address management area A (302) is erased, and a confirmation flag (0x1ABFE) is written. Subsequently, one erase block (0x1B800-0x1BBFF) including old address management information in the life extension countermeasure address management area B (301) is erased, and a confirmation flag (0x1BBFE) is written (S78). The user is notified of the result of successful writing, and the process is terminated (S79).

前述した処理の次に、再々度データ3を書き込む場合について説明する。
ホスト側は書き込みデータとして、図9のデータ番号3(901)とデータ長0x40(902)とデータ本体(903)を指定し、延命対策データ領域(201)書込み指示を行う(S5)。まず、延命対策アドレス管理領域(202)に格納されているアドレス管理情報確認処理(S11、図13)を行う。
Next, a case where the data 3 is written again after the above-described processing will be described.
The host side designates data number 3 (901), data length 0x40 (902), and data body (903) of FIG. 9 as write data, and issues a life extension countermeasure data area (201) write instruction (S5). First, the address management information confirmation process (S11, FIG. 13) stored in the life extension countermeasure address management area (202) is performed.

延命対策アドレス管理領域A(302)の最上位アドレスの消去ブロックである0x1AC00−0x1AFFFの確認フラグ(0x1AFFE)を確認し、0x1111と一致するか否かを判定する(S43)。この判定で一致する場合には、次に移行する。一方、不一致の場合には、次の消去ブロックの確認フラグを確認する。   The confirmation flag (0x1AFFE) of 0x1AC00-0x1AFFF, which is the erase block of the highest address in the life extension countermeasure address management area A (302), is confirmed to determine whether or not it matches 0x1111 (S43). If they match in this determination, the process proceeds to the next. On the other hand, if they do not match, the confirmation flag of the next erase block is confirmed.

次に使用フラグを上位アドレスから順に確認し、0x1111と一致する使用フラグ番号があるか否かを判定する。この判定において、一致する使用フラグ番号が“1”であることから、アドレス管理情報1(0x1AC1C−0x1AC37)が現在有効な情報であることがわかる。そのアドレス管理情報1を参照する。   Next, the usage flags are checked in order from the higher address, and it is determined whether there is a usage flag number that matches 0x1111. In this determination, since the matching use flag number is “1”, it can be seen that the address management information 1 (0x1AC1C-0x1AC37) is currently valid information. The address management information 1 is referred to.

使用フラグ1(0x1AFB8)の延命対策アドレス管理領域Aの最下位アドレス(0x1A000)からのオフセットは、0xFB8である。これに対応する延命対策アドレス管理領域Bの最下位アドレス(0x1B000)から同じオフセット0xFB8である使用フラグ1(0x1BFB8)を参照する。この使用フラグが0x1111と一致するか否かを判定する(S47)。一致する場合は次に移行する。一方、不一致の場合には、次の使用フラグを確認する(S49)。   The offset of the use flag 1 (0x1AFB8) from the lowest address (0x1A000) of the life extension address management area A is 0xFB8. The use flag 1 (0x1BFB8) having the same offset 0xFB8 is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B corresponding thereto. It is determined whether or not this use flag matches 0x1111 (S47). If they match, move on to the next. On the other hand, if they do not match, the next use flag is confirmed (S49).

アドレス管理情報1(0x1AC1C−0x1AC37)の延命対策アドレス管理領域A(302)の最下位アドレス(0x1A000)からのオフセットは、0xC1Cである。延命対策アドレス管理領域Bの最下位アドレス(0x1B000)から同じオフセット0xC1Cであるアドレス管理情報1(0x1BC1C−0x1BC37)を参照する。   The offset of the address management information 1 (0x1AC1C-0x1AC37) from the lowest address (0x1A000) of the life extension address management area A (302) is 0xC1C. The address management information 1 (0x1BC1C-0x1BC37) having the same offset 0xC1C is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B.

延命対策アドレス管理領域(302)のアドレス管理情報1(0x1AC1C−0x1AC37)と延命対策アドレス管理領域B(301)のアドレス管理情報1(0x1BC1C−0x1BC37)を比較する。延命対策アドレス管理領域B(301)の確認フラグが0x1111と不一致であり、かつ、延命対策アドレス管理領域A(302)の確認フラグが0x1111と一致し(S44)、使用フラグ1が有効状態である場合(S45)は、アドレス管理領域A(302)の最新アドレス管理情報であるアドレス管理情報1(0x1AC1C−0x1AC37)が正しいアドレス管理情報であると決定する。   Address management information 1 (0x1AC1C-0x1AC37) in the life extension countermeasure address management area (302) is compared with address management information 1 (0x1BC1C-0x1BC37) in the life extension countermeasure address management area B (301). The confirmation flag of the life extension countermeasure address management area B (301) does not match 0x1111, and the confirmation flag of the life extension countermeasure address management area A (302) matches 0x1111 (S44), and the use flag 1 is in the valid state. In the case (S45), it is determined that the address management information 1 (0x1AC1C-0x1AC37), which is the latest address management information in the address management area A (302), is correct address management information.

そこで、延命対策アドレス管理領域A(302)のアドレス管理情報1(0x1AC1C−0x1AC37)を読み出し、アドレス管理情報2(0x1AC38−0x1AC53)に同じ情報を格納する。   Therefore, the address management information 1 (0x1AC1C-0x1AC37) in the life extension address management area A (302) is read, and the same information is stored in the address management information 2 (0x1AC38-0x1AC53).

そして使用フラグ2(0x1AFBA)を使用状態に更新する。次に延命対策アドレス管理領域B(301)のアドレス管理情報2(0x1BC38−0x1BC53)に同じ情報を格納し、使用フラグ2(0x1BFBA)を使用状態に更新する(1410)(S50)。延命対策アドレス管理領域A(302)のアドレス管理情報2に“1”加算し、アドレス管理情報3(0x1AC54−0x1AC6F)が延命対策アドレス管理領域A(302)の新アドレス管理情報と確定する(S33)。   Then, the use flag 2 (0x1AFBA) is updated to the use state. Next, the same information is stored in the address management information 2 (0x1BC38-0x1BC53) of the life extension countermeasure address management area B (301), and the use flag 2 (0x1BFBA) is updated to the use state (1410) (S50). “1” is added to the address management information 2 of the life extension countermeasure address management area A (302), and the address management information 3 (0x1AC54-0x1AC6F) is determined as the new address management information of the life extension countermeasure address management area A (302) (S33). ).

同様に、延命対策アドレス管理領域B(301)のアドレス管理情報2に1加算し、アドレス管理情報3(0x1BC54−0x1BC6F)が延命対策アドレス管理領域B(301)の新アドレス管理情報と確定する(S33)。次に、アドレス管理情報3(0x1AC54−0x1AC6F)の開始アドレス項目1−4を参照して大きさを比較し、最上位アドレスのデータ番号が3であり、開始アドレスは0x1D000であることがわかる。   Similarly, 1 is added to the address management information 2 of the life extension countermeasure address management area B (301), and the address management information 3 (0x1BC54-0x1BC6F) is determined as the new address management information of the life extension countermeasure address management area B (301) ( S33). Next, referring to the start address item 1-4 of the address management information 3 (0x1AC54-0x1AC6F), the sizes are compared, and it can be seen that the data number of the highest address is 3, and the start address is 0x1D000.

データ3長を参照し、開始アドレス0x1D000にデータ3長0x040を加算し、新データ開始アドレスが0x1D040と確定する。アドレス管理情報(図5)の不良ブロック番号項目を参照し、不良ブロック番号は0x7Cであり、アドレス0x1F000−0x1F3FFが不良ブロックであり、それ以外の消去ブロックは正常であることがわかる。現アドレス管理情報、新アドレス管理情報、現データ開始アドレス、新データ開始アドレスのいずれも不良ブロックに該当しないため(S35)、次に移行する(S36)。   With reference to the data 3 length, the data 3 length 0x040 is added to the start address 0x1D000, and the new data start address is determined to be 0x1D040. Referring to the bad block number item of the address management information (FIG. 5), it can be seen that the bad block number is 0x7C, addresses 0x1F000-0x1F3FF are bad blocks, and the other erase blocks are normal. Since none of the current address management information, the new address management information, the current data start address, and the new data start address corresponds to a bad block (S35), the process proceeds to the next (S36).

次に延命対策データ領域(201)への書き込みを行う。新データ開始アドレス0x1D040と延命対策データ領域(201)の開始アドレス0x1C000のオフセットが消去ブロックサイズ1KBの3個分のサイズ(3KB)の整数倍であるかどうかを確認し、整数倍でないことを確認する(S61)。そこで、データ3として、ユーザから指定されたデータ本体を0x1D040から0x1D07Fに書き込む(S63)。次に延命対策アドレス管理領域A(302)のアドレス管理情報3(0x1AC54−0x1AC6F)のデータ1開始アドレス、データ1長、データ2開始アドレス、データ2長、データ4開始アドレス、データ4長、不良ブロック番号について、アドレス管理情報2(0x1AC38−0x1AC53)と同じデータを書き込む。データ3開始アドレスは新データ開始アドレスとして0x1D040、データ3長は0x0040を書き込む(S73)。使用フラグ3を使用状態に更新する(S77)。そして、延命対策アドレス管理領域B(301)のアドレス管理情報3(0x1BC54−0x1BC6F)のデータ1開始アドレス、データ1長、データ2開始アドレス、データ2長、データ3開始アドレス、データ3長、データ4開始アドレス、データ4長、不良ブロック番号も同様に更新する(S17)。つまり、延命対策アドレス管理領域A(302)と延命対策アドレス管理領域B(301)とは全く同じデータを保持している。延命対策アドレス管理領域B(301)は延命対策アドレス管理領域A(302)に対して、バックアップとして機能する。そして、使用フラグ3を使用状態に更新する。ユーザに書込み成功結果を通知し、処理を終了する。   Next, writing to the life extension countermeasure data area (201) is performed. Check if the offset of the new data start address 0x1D040 and the start address 0x1C000 of the life extension countermeasure data area (201) is an integral multiple of the size of three erase block sizes 1KB (3KB), and confirm that it is not an integral multiple (S61). Therefore, the data body designated by the user is written from 0x1D040 to 0x1D07F as data 3 (S63). Next, the data 1 start address, data 1 length, data 2 start address, data 2 length, data 4 start address, data 4 length, failure of the address management information 3 (0x1AC54-0x1AC6F) in the life extension address management area A (302) For the block number, the same data as the address management information 2 (0x1AC38-0x1AC53) is written. The data 3 start address is written as 0x1D040 as the new data start address, and the data 3 length is written as 0x0040 (S73). The use flag 3 is updated to the use state (S77). The data 1 start address, data 1 length, data 2 start address, data 2 length, data 3 start address, data 3 length, data of the address management information 3 (0x1BC54-0x1BC6F) in the life extension countermeasure address management area B (301) The 4 start address, the data 4 length, and the bad block number are similarly updated (S17). That is, the life extension countermeasure address management area A (302) and the life extension countermeasure address management area B (301) hold the same data. The life extension address management area B (301) functions as a backup for the life extension address management area A (302). Then, the use flag 3 is updated to the use state. The user is notified of the result of successful writing, and the process ends.

次に、延命対策データ領域の読み出し指示があるとき(S7)の処理を説明する。   Next, the processing when there is an instruction to read the life extension countermeasure data area (S7) will be described.

延命対策アドレス管理領域A(302)の最上位アドレスの消去ブロックである0x1AC00−0x1AFFFの確認フラグ(0x1AFFE)を確認し、0x1111と一致するか否かを判定する(S43)。   The confirmation flag (0x1AFFE) of 0x1AC00-0x1AFFF, which is the erase block of the highest address in the life extension countermeasure address management area A (302), is confirmed to determine whether or not it matches 0x1111 (S43).

この判定において、一致する場合には次に移行する。不一致の場合は、次の消去ブロックの確認フラグを確認する。次に使用フラグを上位アドレスから順に確認し、0x1111と一致する使用フラグ番号があるか否かを判定する。この判定では、一致する使用フラグ番号が3であることから、アドレス管理情報3(0x1AC54−0x1AC6F)が現在有効な情報であることがわかる。   In this determination, if they match, the process proceeds to the next. If they do not match, the confirmation flag of the next erase block is confirmed. Next, the usage flags are checked in order from the higher address, and it is determined whether there is a usage flag number that matches 0x1111. In this determination, since the matching use flag number is 3, it can be seen that the address management information 3 (0x1AC54-0x1AC6F) is currently valid information.

そのアドレス管理情報3を参照する。使用フラグ3(0x1AFBC)の延命対策アドレス管理領域Aの最下位アドレス(0x1A000)からのオフセットは、0xFBCである。これに対応する延命対策アドレス管理領域Bの最下位アドレス(0x1B000)から同じオフセット0xFBCである使用フラグ3(0x1BFBC)を参照する。この使用フラグが0x1111と一致するか否かを判定する(S47)。この判定で一致する場合は、次に移行する。一方、不一致の場合は、次の使用フラグを確認する。   The address management information 3 is referred to. The offset of the use flag 3 (0x1AFBC) from the lowest address (0x1A000) of the life extension countermeasure address management area A is 0xFBC. The use flag 3 (0x1BFBC) having the same offset 0xFBC is referenced from the lowest address (0x1B000) of the life extension countermeasure address management area B corresponding to this. It is determined whether or not this use flag matches 0x1111 (S47). If they match in this determination, the process proceeds to the next. On the other hand, if they do not match, the next use flag is confirmed.

次に、アドレス管理情報3(0x1AC54−0x1AC6F)の延命対策アドレス管理領域A(302)の最下位アドレス(0x1A000)からのオフセットは、0xC54である。延命対策アドレス管理領域B(301)の最下位アドレス(0x1B000)から同じオフセット0xC54であるアドレス管理情報3(0x1BC54−0x1BC6F)を参照する。   Next, the offset of the address management information 3 (0x1AC54-0x1AC6F) from the lowest address (0x1A000) of the life extension address management area A (302) is 0xC54. The address management information 3 (0x1BC54-0x1BC6F) having the same offset 0xC54 is referred from the lowest address (0x1B000) of the life extension countermeasure address management area B (301).

延命対策アドレス管理領域A(302)のアドレス管理情報3(0x1AC54−0x1AC6F)と延命対策アドレス管理領域B(301)のアドレス管理情報3(0x1BC54−0x1BC6F)を比較する(S48)。本情報が一致するので、アドレス管理情報3が現アドレス管理情報と確定する。(S21)
アドレス管理情報(図5)の不良ブロック番号項目を参照し、不良ブロック番号は0x7Cであり、アドレス0x1F000−0x1F3FFが不良ブロックであり、それ以外の消去ブロックは正常であることがわかる。現アドレス管理情報、現データ開始アドレスのいずれも不良ブロックに該当しないため次に移行する。
Address management information 3 (0x1AC54-0x1AC6F) in the life extension countermeasure address management area A (302) is compared with address management information 3 (0x1BC54-0x1BC6F) in the life extension countermeasure address management area B (301) (S48). Since this information matches, the address management information 3 is confirmed as the current address management information. (S21)
Referring to the bad block number item in the address management information (FIG. 5), it can be seen that the bad block number is 0x7C, addresses 0x1F000-0x1F3FF are bad blocks, and the other erase blocks are normal. Since neither the current address management information nor the current data start address corresponds to a bad block, the process proceeds to the next.

次にアドレス管理情報3(0x1AC54−0x1AC6F)のデータ3開始アドレス項目を参照し、0x1D040であることがわかる。データ3長項目を参照し、0x40であることがわかる。延命対策データ領域(201)アドレス0x1D040からデータ長0x40分のデータを読み出し、指定された読み出しバッファに書き込む(S22)。ユーザに読み出し成功結果を通知し、処理を終了する。   Next, referring to the data 3 start address item of the address management information 3 (0x1AC54-0x1AC6F), it can be seen that it is 0x1D040. With reference to the data 3 length item, it can be seen that it is 0x40. Data for life extension measure data area (201) The data for data length 0x40 is read from address 0x1D040 and written to the designated read buffer (S22). The user is notified of the result of successful reading, and the process ends.

本実施形態では、以下のような効果を得ることができる。   In the present embodiment, the following effects can be obtained.

(1)フラッシュメモリの書き込みデータ数を固定値にし、書き込む度に前回書込みデータのサイズ分加算したアドレスに書き込むことにより、書込み回数を管理することなく、簡易的に延命対策を行うことができる。論物変換テーブル、書込み回数などを管理しない簡易的な方法であるため、実装が容易であり、開発期間、開発規模を縮小することが可能になる。 (1) By setting the number of write data in the flash memory to a fixed value and writing to the address added by the size of the previous write data every time writing is performed, it is possible to simply take measures to extend the life without managing the number of writes. Since it is a simple method that does not manage the logical-physical conversion table, the number of times of writing, etc., it is easy to implement and the development period and development scale can be reduced.

(2)一定消去ブロック毎に書き込みデータをまとめて書き込むことにより、延命対策データ読み出し時間を短縮することができる。 (2) By writing the write data together for each fixed erase block, it is possible to shorten the life extension data read time.

本発明のフラッシュメモリ制御システムにおける一実施形態に係るシステム全体構成を示すブロック図である。It is a block diagram which shows the whole system structure which concerns on one Embodiment in the flash memory control system of this invention. フラッシュメモリの概念的な構成を示す図である。It is a figure which shows the notional structure of flash memory. 延命対策アドレス管理領域における全体構成を示している。2 shows the overall configuration of the life extension address management area. 延命対策アドレス管理領域における1消去ブロックの構成について示す図である。It is a figure shown about the structure of 1 erasure block in a life extension countermeasure address management area | region. 延命対策アドレス管理領域に格納されているアドレス管理情報の構成を示す図である。It is a figure which shows the structure of the address management information stored in the life extension countermeasure address management area. 延命対策アドレス管理領域に格納されているアドレス管理情報格納例を示す図である。It is a figure which shows the example of address management information storage stored in the life extension countermeasure address management area. 延命対策データ領域の一部の構成を示す図である。It is a figure which shows the structure of a part of life extension countermeasure data area | region. データ3における書込み後の延命対策データ領域の一部の構成例を示す図である。It is a figure which shows the example of a structure of a part of life extension countermeasure data area | region after writing in the data 3. FIG. ホスト側からフラッシュメモリに書き込むデータの一構成例を示す図である。It is a figure which shows the example of 1 structure of the data written in a flash memory from the host side. 本実施形態の動作について説明するためのフローチャートである。It is a flowchart for demonstrating operation | movement of this embodiment. 延命対策データ領域の書込み処理について説明するためのフローチャートである。It is a flowchart for demonstrating the write-in process of a life extension countermeasure data area | region. 延命対策データ領域の読み出し処理のサブルーチンについて説明するためのフローチャートである。It is a flowchart for demonstrating the subroutine of the reading process of a life extension countermeasure data area. アドレス管理情報の確認処理の前半部分について説明するためのフローチャートである。It is a flowchart for demonstrating the first half part of the confirmation process of address management information. アドレス管理情報リカバリ処理について説明するためのフローチャートである。It is a flowchart for demonstrating an address management information recovery process. 延命対策データ領域への書き込み処理について説明するためのフローチャートである。It is a flowchart for demonstrating the write-in process to a life extension countermeasure data area | region. 延命対策アドレス管理領域A更新について説明するためのフローチャートである。It is a flowchart for demonstrating life extension countermeasure address management area | region A update.

符号の説明Explanation of symbols

1…フラッシュ制御装置、2…表示装置、3…記憶装置、4…制御装置、5…電源、11…発振器、12…入出カインタフェース、13…MPU、14…RAM、15…フラッシュメモリ。 DESCRIPTION OF SYMBOLS 1 ... Flash control apparatus, 2 ... Display apparatus, 3 ... Memory | storage device, 4 ... Control apparatus, 5 ... Power supply, 11 ... Oscillator, 12 ... Input / output interface, 13 ... MPU, 14 ... RAM, 15 ... Flash memory.

Claims (5)

一定のデータ長を有する複数のデータ領域に分割された延命対策データ領域、及び、データ書き込みを行うデータ領域に対して少なくともデータ領域の使用有無とデータ開始アドレスとデータ長とを管理するためのアドレス管理テーブルが設けられた延命対策アドレス管理領域、を有するフラッシュメモリと、
フラッシュメモリヘ可変長データ書込む際に、前記延命対策アドレス管理領域の前記アドレス管理テーブルを参照し、書込みデータ開始アドレスを確定後、確定した書込みデータ開始アドレスにデータを書き込み、アドレス管理テーブルを更新し、新たなデータ書込み毎に異なるアドレスへ書き込む制御を行う制御部と、
を具備することを特徴とするフラッシュメモリ制御システム。
Address for managing at least use / nonuse of data area, data start address and data length for data area for life extension divided into a plurality of data areas having fixed data length, and data area to which data is written A flash memory having a life extension address management area provided with a management table;
When writing variable length data to the flash memory, refer to the address management table in the address management area for life extension, determine the write data start address, write the data to the determined write data start address, and update the address management table A control unit that performs control to write to a different address for each new data write;
A flash memory control system comprising:
前記制御部は、
データ開始アドレスが予め定めたアドレスと合致する際に、順次異なるアドレスに分散して書き込まれている複数の延命対策データを、データ開始アドレスから連続して書き込むことを特徴とする請求項1に記載のフラッシュメモリ制御システム。
The controller is
The plurality of life extension countermeasure data written in a distributed manner at different addresses are sequentially written from the data start address when the data start address matches a predetermined address. Flash memory control system.
前記制御部は、
等二分割された第1の延命対策アドレス管理領域と第2の延命対策アドレス管理領域とで構成される前記延命対策アドレス管理領域に対して、データ書込み時に、それぞれの第1及び第2の延命対策アドレス管理領域に、連続的に同じ管理内容となるように記憶更新を指示することを特徴とする請求項1に記載のフラッシュメモリ制御システム。
The controller is
When the data is written to the life extension address management area composed of the first life extension countermeasure address management area and the second life extension address management area divided into two equal parts, the first and second life extension 2. The flash memory control system according to claim 1, wherein the storage address is instructed in the countermeasure address management area so that the same management contents are continuously obtained.
フラッシュメモリに対して、データ開始アドレスと長さでデータ種を管理するアドレス管理テーブルを有し、
データの書き込みの際にデータ種を指定した書込み要求時に前記アドレス管理テーブルを参照して、未使用状態のアドレスをそのデータ種の開始アドレスとして指定し、
前記データを記憶した後に前記アドレス管理テーブルを更新することにより、書き込み毎に異なるアドレスに可変長データを順次書き込むことを特徴とするフラッシュメモリ制御方法。
For flash memory, it has an address management table that manages data types by data start address and length,
Refer to the address management table at the time of a write request specifying a data type when writing data, and specify an unused address as the start address of the data type,
A flash memory control method, wherein the variable length data is sequentially written to a different address for each writing by updating the address management table after storing the data.
前記可変長データを順次、異なるデータ領域に書き込むデータ開始アドレスが予め定めたアドレスと合致する際に、順次異なるアドレスに分散して書き込まれている複数の延命対策データを、データ開始アドレスから連続して書き込むことを特徴とする請求項4に記載のフラッシュメモリ制御方法。   When the data start address for sequentially writing the variable-length data to different data areas matches a predetermined address, a plurality of life extension countermeasure data that are sequentially written to different addresses are continuously transmitted from the data start address. 5. The flash memory control method according to claim 4, wherein writing is performed.
JP2006243588A 2006-09-08 2006-09-08 Flash memory control system and control method thereof Expired - Fee Related JP5060088B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006243588A JP5060088B2 (en) 2006-09-08 2006-09-08 Flash memory control system and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006243588A JP5060088B2 (en) 2006-09-08 2006-09-08 Flash memory control system and control method thereof

Publications (2)

Publication Number Publication Date
JP2008065646A true JP2008065646A (en) 2008-03-21
JP5060088B2 JP5060088B2 (en) 2012-10-31

Family

ID=39288311

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006243588A Expired - Fee Related JP5060088B2 (en) 2006-09-08 2006-09-08 Flash memory control system and control method thereof

Country Status (1)

Country Link
JP (1) JP5060088B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008233192A (en) * 2007-03-16 2008-10-02 Hoya Corp Interchangeable lens and camera system having memory
JP2011175377A (en) * 2010-02-23 2011-09-08 Renesas Electronics Corp Flash memory control device and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0744453A (en) * 1993-08-03 1995-02-14 Casio Comput Co Ltd Data storage device
JPH0830515A (en) * 1994-07-20 1996-02-02 Toshiba Corp Data processor using flash eeprom
JPH1173363A (en) * 1997-08-29 1999-03-16 Matsushita Graphic Commun Syst Inc Memory controller
JPH1185629A (en) * 1997-07-15 1999-03-30 Fujitsu Ltd Managing system for flash memory
JPH11144478A (en) * 1997-11-10 1999-05-28 Hitachi Device Eng Co Ltd Information storage method of nonvolatile semiconductor memory and electronic apparatus
JPH11260074A (en) * 1998-03-13 1999-09-24 Rohm Co Ltd Memory device using eeprom
JPH11328982A (en) * 1998-03-19 1999-11-30 Fuji Electric Co Ltd Data management system for flash memory

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0744453A (en) * 1993-08-03 1995-02-14 Casio Comput Co Ltd Data storage device
JPH0830515A (en) * 1994-07-20 1996-02-02 Toshiba Corp Data processor using flash eeprom
JPH1185629A (en) * 1997-07-15 1999-03-30 Fujitsu Ltd Managing system for flash memory
JPH1173363A (en) * 1997-08-29 1999-03-16 Matsushita Graphic Commun Syst Inc Memory controller
JPH11144478A (en) * 1997-11-10 1999-05-28 Hitachi Device Eng Co Ltd Information storage method of nonvolatile semiconductor memory and electronic apparatus
JPH11260074A (en) * 1998-03-13 1999-09-24 Rohm Co Ltd Memory device using eeprom
JPH11328982A (en) * 1998-03-19 1999-11-30 Fuji Electric Co Ltd Data management system for flash memory

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008233192A (en) * 2007-03-16 2008-10-02 Hoya Corp Interchangeable lens and camera system having memory
JP2011175377A (en) * 2010-02-23 2011-09-08 Renesas Electronics Corp Flash memory control device and method

Also Published As

Publication number Publication date
JP5060088B2 (en) 2012-10-31

Similar Documents

Publication Publication Date Title
JP4079506B2 (en) Method for controlling nonvolatile semiconductor memory system
US6865658B2 (en) Nonvolatile data management system using data segments and link information
KR100847506B1 (en) Storage device, memory management method and program
JP3708047B2 (en) Managing flash memory
JP4122972B2 (en) Data recording apparatus and data writing method for flash memory
JP4828816B2 (en) Memory card, semiconductor device, and memory card control method
US8392797B2 (en) Error correcting controller, flash memory chip system, and error correcting method thereof
KR20020009564A (en) Memory system
JP2008537192A (en) How to manage copy operations in flash memory
JPWO2005111812A1 (en) MEMORY CONTROL CIRCUIT, NONVOLATILE MEMORY DEVICE, AND MEMORY CONTROL METHOD
KR100370893B1 (en) Flash memory unit and control method of flash memory
JP2009134416A (en) Memory system
JP4666081B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4460967B2 (en) MEMORY CARD, NONVOLATILE SEMICONDUCTOR MEMORY, AND SEMICONDUCTOR MEMORY CONTROL METHOD
CN107045423B (en) Memory device and data access method thereof
US20070005929A1 (en) Method, system, and article of manufacture for sector mapping in a flash device
JP2007094639A (en) Memory controller and flash memory system
JP4488048B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2007293917A (en) Method for controlling memory system
JP4235646B2 (en) Memory controller and flash memory system
JP5060088B2 (en) Flash memory control system and control method thereof
JP4661497B2 (en) Memory controller, flash memory system, and flash memory control method
JP2009093528A (en) Memory data management apparatus
JP4513786B2 (en) Memory controller, memory system, and memory control method
KR20070061543A (en) Emulating small block size of flash memory

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081001

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110811

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110823

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111024

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120403

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20120529

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120604

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120710

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120803

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150810

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150810

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees