JPH09198884A - Management method of flash memory - Google Patents

Management method of flash memory

Info

Publication number
JPH09198884A
JPH09198884A JP505896A JP505896A JPH09198884A JP H09198884 A JPH09198884 A JP H09198884A JP 505896 A JP505896 A JP 505896A JP 505896 A JP505896 A JP 505896A JP H09198884 A JPH09198884 A JP H09198884A
Authority
JP
Japan
Prior art keywords
block
card
flash memory
spare
flag
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
JP505896A
Other languages
Japanese (ja)
Other versions
JP3472008B2 (en
Inventor
Hidenobu Tanuma
英順 田沼
Hiroyuki Sakamoto
広幸 坂本
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 JP00505896A priority Critical patent/JP3472008B2/en
Publication of JPH09198884A publication Critical patent/JPH09198884A/en
Application granted granted Critical
Publication of JP3472008B2 publication Critical patent/JP3472008B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)
  • For Increasing The Reliability Of Semiconductor Memories (AREA)

Abstract

PROBLEM TO BE SOLVED: To achieve higher reliability of a flash memory by detecting the saturation of an alternative area as quickly as possible. SOLUTION: Card management information read out of a flash memory card 11 is reloaded at each block alternative processing and based on the results, it is examined whether alternatively applicable spare block is left or not. When the absence of the alternatively applicable spare block is detected, a procedure for extending the use of the flash card 11 is started immediately. This enables early detection of the saturation of the alternative area before the deficiency of the flash memory card 11 itself occurs because of disability of alternative application thereby enabling enhancing of the reliability of the flash memory sufficiently.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明はフラッシュメモリ
管理方法に関し、特に不良ブロックを代替するためのス
ペアブロックが用意されたフラッシュEEPROMを有
するフラッシュメモリ装置の管理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a flash memory management method, and more particularly to a management method for a flash memory device having a flash EEPROM having spare blocks for replacing defective blocks.

【0002】[0002]

【従来の技術】従来、パーソナルコンピュータやワーク
ステーション等のデータ処理装置の外部記憶装置として
は、通常、ハードディスク装置やフロッピーディスク装
置などのディスク装置が用いられていた。
2. Description of the Related Art Conventionally, a disk device such as a hard disk device or a floppy disk device has been usually used as an external storage device of a data processing device such as a personal computer or a workstation.

【0003】最近では、それらディスク装置に代わる外
部記憶装置として、フラッシュEEPROMを内蔵した
フラッシュメモリカードが使用されるようになり、カー
ド装着用のスロットが標準装備されたパーソナルコンピ
ュータや、パーソナルコンピュータに外付けされて使用
されるメモリカードリーダ/ライタなどの周辺装置も開
発されている。
Recently, a flash memory card having a built-in flash EEPROM has come to be used as an external storage device replacing these disk devices, and a personal computer equipped with a card mounting slot as a standard device or an external device. Peripheral devices such as memory card readers / writers attached and used are also being developed.

【0004】フラッシュメモリカードは携帯性に富んで
おり、またフロッピーディスクよりも大きな容量のファ
イルを取り扱う事ができる。このため、特にノートブッ
ク型のポータブルコンピュータ、PDA、電子スチルカ
メラなどの外部記憶装置として有効である。
The flash memory card is highly portable and can handle a file having a larger capacity than a floppy disk. Therefore, it is particularly effective as an external storage device such as a notebook type portable computer, PDA, electronic still camera and the like.

【0005】[0005]

【発明が解決しようとする課題】しかし、フラッシュメ
モリカードは、書き換え回数の制限という固有の問題を
有しており、新たなメモリ技術の採用によって改良が続
けられてはいるものの、外部記憶装置として使用する上
では、データ記憶の信頼性の面で完全ではない。このた
め、フラッシュメモリカードにおいては、データのリー
ド/ライトだけでなく、データの信頼性についてもソフ
トウェアで管理することが必要である。
However, the flash memory card has an inherent problem that the number of times of rewriting is limited, and although it is continuously improved by adopting a new memory technology, it is used as an external storage device. In terms of use, the reliability of data storage is not perfect. Therefore, in the flash memory card, it is necessary to manage not only data read / write but also data reliability by software.

【0006】通常、フラッシュメモリカードにおいて
は、スペアブロックが用意されており、リード/ライト
エラーなどが発生した不良ブロックをスペアブロックに
よって代替することによって信頼性の向上が図られてい
る。ところが、従来では、未使用のスペアブロックが残
っているか否かは実際に不良ブロックが発生してその代
替処理を開始する段階になるまで検知することができな
い。このため、もし全てのスペアブロックが使用されて
しまった後において不良ブロックが生じると、その時点
で代替不能が初めて検知され、それによってカードアク
セスが一切不能とされてしまう。このため、ユーザには
カードアクセスが禁止された時点でカード不良が通知さ
れることになり、この時点では、すでにデータのバック
アップ作業などを行うことはできない状態である。
Usually, in a flash memory card, a spare block is prepared and reliability is improved by substituting a spare block for a defective block in which a read / write error has occurred. However, conventionally, it is not possible to detect whether or not an unused spare block remains until a stage at which a defective block actually occurs and replacement processing thereof is started. For this reason, if a defective block occurs after all spare blocks have been used, the immutability cannot be detected for the first time at that point, thereby disabling card access at all. Therefore, the user is notified of the card failure when the card access is prohibited, and at this time, the data backup operation cannot be performed.

【0007】この発明はこのような点に鑑みてなされた
ものであり、代替領域の飽和をいち早く検知できるよう
にし、フラッシュメモリの信頼性を十分に向上させるこ
とが可能なフラッシュメモリ管理方法を提供することを
目的とする。
The present invention has been made in view of the above circumstances, and provides a flash memory management method capable of quickly detecting the saturation of the alternative area and sufficiently improving the reliability of the flash memory. The purpose is to do.

【0008】[0008]

【課題を解決するための手段】この発明は、不良ブロッ
クを代替するためのスペアブロックが用意されたフラッ
シュEEPROMを有するフラッシュメモリ装置の管理
方法において、前記フラッシュEEPROMの不良ブロ
ックとその代替のために使用されたスペアブロックとの
関係を示すカード管理情報を前記フラッシュメモリ装置
から読み取り、不良ブロックをスペアブロックによって
代替する度に前記カード管理情報を書き換え、その書き
換え結果に基づいて代替可能なスペアブロックが残って
いるか否かを検出し、代替可能なスペアブロックが無く
なったことを検出したとき、代替不能による前記フラッ
シュメモリ装置の不良化を招く前に前記フラッシュメモ
リ装置の延命のための手続きを行うことを特徴とする。
SUMMARY OF THE INVENTION The present invention relates to a method of managing a flash memory device having a flash EEPROM in which a spare block for replacing a defective block is prepared, the defective block of the flash EEPROM and its replacement. The card management information indicating the relationship with the used spare block is read from the flash memory device, the card management information is rewritten every time a defective block is replaced by a spare block, and a spare block that can be replaced is created based on the result of the rewriting. Performing a procedure for extending the life of the flash memory device before detecting a remaining spare block and detecting that the spare block that can be replaced is lost Is characterized by.

【0009】このフラッシュメモリ管理方法において
は、フラッシュメモリ装置から読み取ったカード管理情
報をブロック代替処理を行う度に書き換え、その結果に
基づいて代替可能なスペアブロックが残っているか否か
が調べられる。もし代替可能なスペアブロックが無くな
ったことが検出されたならば、その時点で、フラッシュ
メモリ装置の延命のための手続きが開始される。よっ
て、代替不能によるフラッシュメモリ装置の不良が発生
する前に、代替領域の飽和をいち早く検知できるように
なり、フラッシュメモリの信頼性を十分に向上させるこ
とが可能となる。
In this flash memory management method, the card management information read from the flash memory device is rewritten every time the block replacement process is performed, and it is checked based on the result whether or not there is a spare block that can be replaced. If it is detected that the alternative spare block is exhausted, at that time, the procedure for extending the life of the flash memory device is started. Therefore, it becomes possible to quickly detect the saturation of the alternative area before a failure of the flash memory device due to the inability to replace occurs, and it is possible to sufficiently improve the reliability of the flash memory.

【0010】フラッシュメモリ装置の延命のための手続
きとしては、ユーザへの通知の他、アクセス形態をリー
ドオンリーに制限する、代替処理を禁止してその代わり
に新たな不良ブロックに対するアクセス権を排除する、
スペアブロック以外の他のブロックをスペアブロックと
して割り当ててスペアブロック数を増加させる等の処理
を行うことが好ましい。これにより、フラッシュメモリ
装置の延命を図ることができる。
As a procedure for extending the life of the flash memory device, in addition to notifying the user, the access form is limited to read-only, the alternative process is prohibited, and the access right to a new defective block is eliminated instead. ,
It is preferable to perform processing such as allocating blocks other than the spare blocks as spare blocks to increase the number of spare blocks. As a result, the life of the flash memory device can be extended.

【0011】[0011]

【発明の実施の形態】以下、図面を参照して、この発明
の実施形態を説明する。図1には、この発明の一実施例
に係るフラッシュメモリ管理方法によって制御されるフ
ラッシュメモリカード11の構成とそのカード11をア
クセス制御するポータブルパーソナルコンピュータのハ
ードウェアおよびソフトウェア構成が示されている。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows a configuration of a flash memory card 11 controlled by a flash memory management method according to an embodiment of the present invention, and a hardware and software configuration of a portable personal computer that controls access to the card 11.

【0012】フラッシュメモリカード11はJEIDA
/PCMCIAに準拠した物理的および電気的仕様を持
つPCカードであり、他のPCカード12と同様に、パ
ーソナルコンピュータのPCカードホストアダプタ13
が提供するカードスロットに取り外し自在に装着され
る。
The flash memory card 11 is JEIDA
/ PCMCIA-compliant PC card having physical and electrical specifications, and like other PC cards 12, a PC card host adapter 13 of a personal computer
It is detachably attached to the card slot provided by.

【0013】フラッシュメモリカード11の認識および
アクセスは、パーソナルコンピュータのシステムメモリ
にロードされて実行されるフラッシュメモリカードドラ
イバ14、カードサービス15、ソケットサービス1
6、およびメモリテクノロジトライバ17などによって
制御される。
The flash memory card 11 is recognized and accessed by being loaded into the system memory of the personal computer and executed. The flash memory card driver 14, the card service 15, and the socket service 1
6, and the memory technology triber 17 and the like.

【0014】フラッシュメモリカードドライバ14は、
フラッシュメモリカード11に対応したデバイスドライ
バプログラムであり、JEIDA/PCMCIAで規定
されているクライアントドライバとして使用される。こ
のフラッシュメモリカードドライバ14は、オペレーテ
ィングシステム18やアプリケーションプログラム19
からのコマンドをフラッシュメモリカード11用のコマ
ンド(ページライトコマンド、ページリードコマンド、
ブロックイレーズコマンドなど)に変換して、フラッシ
ュメモリカード11をアクセス制御する。
The flash memory card driver 14 is
It is a device driver program corresponding to the flash memory card 11, and is used as a client driver defined by JEIDA / PCMCIA. The flash memory card driver 14 includes an operating system 18 and application programs 19
From the command for the flash memory card 11 (page write command, page read command,
(Block erase command, etc.) to access control the flash memory card 11.

【0015】また、フラッシュメモリカードドライバ1
4は、フラッシュメモリカード11の信頼性を向上させ
るために、フラッシュメモリカード11に対するアクセ
スで発生したエラー履歴の管理機能や、不良ブロックの
代替機能、さらには代替領域超過の際のカード延命機能
などを有している。
Further, the flash memory card driver 1
In order to improve the reliability of the flash memory card 11, 4 is a function of managing an error history generated by accessing the flash memory card 11, a function of replacing a defective block, and a function of extending the life of the card when the replacement area is exceeded. have.

【0016】カードサービス15、ソケットサービス1
6、およびメモリテクノロジドライバ17は、それぞれ
JEIDA/PCMCIAによって規定されたドライバ
プログラム群であり、PCカードのリソース管理、PC
カード認識などに利用される。
Card service 15, socket service 1
6 and a memory technology driver 17 are a driver program group defined by JEIDA / PCMCIA, respectively, and are used for resource management of PC card, PC
It is used for card recognition.

【0017】フラッシュメモリカード11は、パーソナ
ルコンピュータの2次記憶装置として利用されるPCカ
ードであり、アトリビュートメモリ111と、コモンメ
モリ112を内蔵している。
The flash memory card 11 is a PC card used as a secondary storage device of a personal computer and has an attribute memory 111 and a common memory 112 built therein.

【0018】アトリビュートメモリ111は、EEPR
OMなどから構成される不揮発性メモリであり、ここに
はカード属性情報が格納されている。カード属性情報
は、コモンメモリ112のメモリの種類、メモリサイ
ズ、アクセス速度等の情報と、フラッシュメモリカード
11の用途(ディスクとして使用するか、メモリとして
使用するかなど)に関する情報を含んでいる。
The attribute memory 111 is an EEPR.
It is a non-volatile memory composed of an OM or the like, and card attribute information is stored therein. The card attribute information includes information such as the type of memory of the common memory 112, the memory size, and the access speed, and information on the purpose of the flash memory card 11 (whether it is used as a disk or a memory).

【0019】さらに、このフラッシュメモリカード11
においては、コモンメモリ112に使用されているNA
ND型フラッシュEEPROMのイレーズ限界回数を示
す値もカード属性情報の1つとしてアトリビュートメモ
リ111に格納されている。
Further, this flash memory card 11
, The NA used for the common memory 112
A value indicating the erase limit number of the ND type flash EEPROM is also stored in the attribute memory 111 as one of the card attribute information.

【0020】コモンメモリ12は、パーソナルコンピュ
ータから供給されるユーザデータなどを記憶するための
メモリデバイスであり、複数のNAND型フラッシュE
EPROMから構成されている。
The common memory 12 is a memory device for storing user data supplied from a personal computer, and includes a plurality of NAND flash E.
It is composed of an EPROM.

【0021】NAND型フラッシュEEPROMにおい
ては、書き込みや消去を行う際に扱うデータ量に最低単
位が定まっており、消去はブロック単位で実行され、デ
ータ書き込み、および読み出しはページ単位で実行され
る。
In the NAND flash EEPROM, the minimum amount of data to be handled when writing or erasing is defined, erasing is executed in block units, and data writing and reading are executed in page units.

【0022】この実施形態では、NAND型フラッシュ
EEPROMとして、例えば、16MビットのNAND
型フラッシュEEPROMが使用される場合を想定す
る。この16MビットのNAND型フラッシュEEPR
OMは、図2に示されているように、メモリセルアレイ
21とデータレジスタ22を備えている。メモリセルア
レイ21は、8K行×264列×8ビットのメモリ構成
を有し、512個のブロックに分割されている。データ
消去はこのブロック単位で実行することができる。各ブ
ロックは16ページ(行)から構成されており、各ペー
ジは、256バイトのデータ記憶領域と8バイトの冗長
領域を備えている。
In this embodiment, the NAND flash EEPROM is, for example, a 16 Mbit NAND.
Suppose a type flash EEPROM is used. This 16 Mbit NAND flash EEPR
As shown in FIG. 2, the OM includes a memory cell array 21 and a data register 22. The memory cell array 21 has a memory configuration of 8K rows × 264 columns × 8 bits, and is divided into 512 blocks. Data erasing can be performed in units of this block. Each block is composed of 16 pages (rows), and each page has a data storage area of 256 bytes and a redundant area of 8 bytes.

【0023】データの書込みと読み出しは、256+8
バイトのデータレジスタ22を介して、ページ単位(2
56+8バイト)で実行される。また、指定したページ
内の冗長領域(8バイト)だけをリード/ライトアクセ
スすることもできる。
Data writing and reading is 256 + 8
Through the byte data register 22, page units (2
56 + 8 bytes). Further, it is possible to read / write only the redundant area (8 bytes) in the designated page.

【0024】図1のコモンメモリ112のデータ記憶空
間は、多数のブロックを含むユーザデータ格納領域と、
不良ブロック代替用のいくつかのスペアブロックを含む
スペアブロック領域と、カード管理情報を記憶するブロ
ックを含むカード管理情報領域とに分割されている。
The data storage space of the common memory 112 of FIG. 1 includes a user data storage area including a large number of blocks,
It is divided into a spare block area including some spare blocks for replacing defective blocks and a card management information area including blocks for storing card management information.

【0025】カード管理情報は、データ書き込みや消去
などを正常に実行することができない不良ブロックの物
理ブロック番号(物理ブロックアドレス)を管理する不
良ブロック管理テーブル、およびスペアブロックの物理
ブロック番号毎にそれが代替する不良ブロックの物理ブ
ロック番号(物理ブロックアドレス)を管理するスペア
ブロック管理テーブルなどを含んでいる。
The card management information includes a bad block management table for managing physical block numbers (physical block addresses) of defective blocks in which data writing and erasing cannot be normally executed, and a physical block number for each spare block. Includes a spare block management table for managing the physical block number (physical block address) of the defective block to be replaced.

【0026】これら不良ブロック管理テーブルおよびス
ペアブロック管理テーブルの内容を書き換えることによ
り、不良ブロックをスペアブロックによって代替するこ
とができる。すなわち、エラー発生したブロックはその
物理ブロック番号が不良ブロック管理テーブルに登録さ
れることによって不良ブロックとして扱われる。アクセ
ス対象のブロックが不良ブロックならば、スペアブロッ
ク管理テーブルが参照され、これによって代替先のスペ
アブロックが認識される。これによって、不良ブロック
の代りに、スペアブロックがアクセスされる。フラッシ
ュメモリカードドライバ14は、フラッシュメモリカー
ド11の挿入時にそのカード11からカード管理情報を
読み取り、カード管理フラグを作成する。このカード管
理フラグは、代替領域超過をいち早く検知し、その際の
カード延命機能を実現するため等に利用される。
By rewriting the contents of these defective block management table and spare block management table, the defective block can be replaced by a spare block. That is, the block in which an error has occurred is treated as a bad block by registering its physical block number in the bad block management table. If the block to be accessed is a defective block, the spare block management table is referred to and the spare block of the replacement destination is recognized. As a result, the spare block is accessed instead of the defective block. The flash memory card driver 14 reads the card management information from the card 11 when the flash memory card 11 is inserted, and creates a card management flag. The card management flag is used to detect the excess of the alternative area promptly and to realize a card life extension function at that time.

【0027】また、コモンメモリ112においては、各
ページの8バイトの冗長領域は、ページステータス情報
などの管理データの格納に利用されている。この管理デ
ータは、フラッシュメモリカード11の信頼性を高める
ために、前述のフラッシュメモリカードドライバ14に
よって管理されている。
In the common memory 112, the 8-byte redundant area of each page is used to store management data such as page status information. This management data is managed by the above-mentioned flash memory card driver 14 in order to improve the reliability of the flash memory card 11.

【0028】ページステータス情報は、対応するページ
に対するアクセスで発生したエラー内容を識別するため
の複数のフラグから構成されている。フラッシュメモリ
カードドライバ14は、各冗長領域のフラグを参照する
ことにより、ページ単位でエラー発生履歴などを認識す
ることができる。
The page status information is composed of a plurality of flags for identifying the error content generated in the access to the corresponding page. The flash memory card driver 14 can recognize the error occurrence history or the like in page units by referring to the flags in each redundant area.

【0029】以下、図3を参照して、コモンメモリ11
2上におけるユーザデータおよび管理データの記憶形式
について具体的に説明する。1ページのデータ領域は2
56バイトであるので、フラッシュメモリカード11を
フロッピーディスクまたはハードディスクとして使用す
る場合には、1セクタ分のユーザデータは図示のように
連続する2ページに亙って記憶される。
Hereinafter, referring to FIG. 3, the common memory 11 will be described.
The storage formats of the user data and the management data on the computer 2 will be specifically described. 1 page data area is 2
Since it is 56 bytes, when the flash memory card 11 is used as a floppy disk or a hard disk, user data for one sector is stored in two consecutive pages as shown in the figure.

【0030】各ブロックの先頭ページ(ページ0)の8
バイトの冗長領域には、次のような管理データが格納さ
れる。 ページデータ用LRC(2バイト) イレーズカウンタ(4バイト) イレーズカウンタ用LRC(1バイト) ページステータス情報(1バイト) ページデータ用LRCは、水平冗長検査(LRC)の手
法を利用して、ページ0の256バイトのデータ領域に
格納されたユーザデータ(セクタ0の上位256バイ
ト)を計算することによって得られたエラー訂正符号で
ある。
8 of the first page (page 0) of each block
The following management data is stored in the byte redundant area. LRC for page data (2 bytes) Erase counter (4 bytes) LRC for erase counter (1 byte) Page status information (1 byte) LRC for page data uses the horizontal redundancy check (LRC) method to page 0 Is an error correction code obtained by calculating the user data (upper 256 bytes of sector 0) stored in the 256-byte data area.

【0031】このページデータ用LRCは、データライ
ト時に作成され、データリード時に参照される。フラッ
シュメモリカードドライバ14は、その上位ソフトウェ
ア(OS、アプリケーションプログラム)にデータを渡
すときには、ページデータ用LRCを利用して、そのデ
ータの有効性を確認する。
This page data LRC is created at the time of data write and is referred to at the time of data read. When passing the data to the upper software (OS, application program), the flash memory card driver 14 uses the page data LRC to check the validity of the data.

【0032】イレーズカウンタは、対応するブロックの
消去回数(データ書換え回数)を示すものであり、各ブ
ロックの先頭ページにのみ書き込まれる。イレーズカウ
ンタのデータ長は4バイトであり、最大で4G(ギガ)
回数分を表記できる。このように大きなデータ長を確保
したのは、これからのフラッシュメモリデバイス技術の
進歩により、消去限界回数が増えていくことを考慮した
ためである。
The erase counter indicates the erase count (data rewrite count) of the corresponding block, and is written only in the first page of each block. The data length of the erase counter is 4 bytes, and the maximum is 4G (giga).
You can write the number of times. The reason why such a large data length is ensured is that it is considered that the limit number of erasures will increase due to the progress of the flash memory device technology in the future.

【0033】イレーズカウンタの値は、対応するブロッ
クが消去される度に+1カウントアップされる。イレー
ズカウンタの値がアトリビュートメモリ111に格納さ
れている消去限界回数を越えると、そのブロックをスペ
アブロックによって代替するための処理がフラッシュメ
モリカードドライバ14によって実行される。
The value of the erase counter is incremented by +1 every time the corresponding block is erased. When the value of the erase counter exceeds the erase limit number of times stored in the attribute memory 111, the flash memory card driver 14 executes a process for replacing the block with a spare block.

【0034】アトリビュートメモリ111に格納されて
いる消去限界回数の値は、マージンを確保するために、
フラッシュEEPROM自体の実際の消去限界回数より
も小さな値に設定されている。
The value of the erase limit number stored in the attribute memory 111 is set in order to secure a margin.
It is set to a value smaller than the actual erase limit number of the flash EEPROM itself.

【0035】イレーズカウンタ用LRCは、その上位4
バイトのイレーズカウンタから水平冗長検査(LRC)
によって計算されたエラー訂正符号である。イレーズカ
ウンタは、ブロック全体のデータ管理に影響を及ぼす重
要なデータであり、イレーズカウンタ用LRCはそのイ
レーズカウンタの信頼性を担保するために使用される。
The erase counter LRC is the upper 4
Byte erase counter to horizontal redundancy check (LRC)
It is the error correction code calculated by. The erase counter is important data that affects the data management of the entire block, and the erase counter LRC is used to ensure the reliability of the erase counter.

【0036】ページステータス情報は対応するページの
状態を示すものであり、その1バイト中の8ビットにそ
れぞれに意味を持たせることにより、対応するページの
状態を8つのフラグによって表す。
The page status information indicates the status of the corresponding page, and the status of the corresponding page is represented by eight flags by giving meaning to each of the 8 bits in the 1 byte.

【0037】ページ1〜ページ16それぞれの冗長領域
には、ページデータ用LRCとページステータス情報だ
けが格納され、イレーズカウンタおよびイレーズカウン
タ用LRCは格納されない。
In each of the redundant areas of pages 1 to 16, only the page data LRC and the page status information are stored, and the erase counter and the erase counter LRC are not stored.

【0038】次に、ページステータス情報の詳細を説明
する。ページステータス情報は8つのフラグを持つこと
ができるが、この実施例では、次の5つのフラグが定義
されている。
Next, details of the page status information will be described. The page status information can have eight flags, but in this embodiment, the following five flags are defined.

【0039】プログラムフラグ(b7) b7=0(プログラム済み) =1(未プログラム:消去済み) イレーズ回数オーバーフラグ(b6) b6=0(イレーズ回数がしきい値を超過) ベリファイエラーフラグ(b2) b2=0(リードベリファイエラー) プログラムエラーフラグ(b1) b1=0(プログラムエラー) イレーズエラーフラグ(b0) b0=0(イレーズエラー) 通常状態(工場出荷時も含む)においては、ページステ
ータス情報の1バイトは、FFh(8ビットがすべて
1)で表現される。以下、各フラグの説明を行う。
Program flag (b7) b7 = 0 (programmed) = 1 (unprogrammed: erased) Erase count over flag (b6) b6 = 0 (erase count exceeds threshold) Verify error flag (b2) b2 = 0 (Read verify error) Program error flag (b1) b1 = 0 (Program error) Erase error flag (b0) b0 = 0 (Erase error) In normal status (including factory shipment), page status information One byte is represented by FFh (8 bits are all 1). Hereinafter, each flag will be described.

【0040】プログラムフラグ(b7)は、対応するペ
ージにデータを書き込む場合にブロックイレーズを実行
する必要があるか否かを判断するために使用されるもの
であり、対応するページを含むブロックが消去済で、そ
のページに対する書き込みがまだ実行されてない状態
(プログラムフラグ=1)と、対応するページに対する
書き込みが実行済みである状態(プログラムフラグ=
0)のいずれかを示す。
The program flag (b7) is used to determine whether or not block erase needs to be executed when writing data to the corresponding page, and the block including the corresponding page is erased. State (program flag = 1) in which the writing to the corresponding page has not been executed yet and a state in which the writing to the corresponding page has already been executed (program flag =)
0) is indicated.

【0041】消去のみのコマンドが発行された直後か、
初期状態である場合は、プログラムフラグは“1”であ
る。この場合、書き込む際に再度消去する必要は無い。
イレーズ回数オーバーフラグ(b6)は、対応するペー
ジを含むブロックの消去回数がアトリビュートメモリ1
11に記録されている消去限界回数の値を超過している
か否かを示すフラグである。
Immediately after the erase-only command is issued,
In the initial state, the program flag is "1". In this case, there is no need to erase again when writing.
The erase count over flag (b6) indicates that the erase count of the block including the corresponding page is the attribute memory 1
11 is a flag indicating whether or not the value of the erase limit number recorded in 11 is exceeded.

【0042】すなわち、フラッシュメモリカードデバイ
スドライバ14は、ブロックイレーズを実行する度に対
応するイレーズカウンタの値を+1インクリメントし、
そのインクリメントされたイレーズカウンタの値がアト
リビュートメモリ111の消去限界回数を越えているか
否かを調べる。越えていたならば、該当するブロックに
含まれる全ページの冗長領域、またはそのブロックの先
頭ページの冗長領域に、“0”のイレーズ回数オーバー
フラグがセットされる。また、この場合には、そのブロ
ックはその時点で劣化を起こして無くても不良ブロック
として扱われ、スペアブロックとの代替処理が行われ
る。フラッシュメモリカードデバイスドライバ14は、
各不良ブロックのイレーズ回数オーバーフラグを参照す
ることにより、実際にエラーを起こしているブロック
か、イレーズ回数オーバーによって不良として扱われて
いるブロックかを識別することができる。
That is, the flash memory card device driver 14 increments the value of the corresponding erase counter by +1 every time block erase is executed,
It is checked whether or not the value of the incremented erase counter exceeds the erase limit number of times in the attribute memory 111. If it exceeds, the erase count over flag of "0" is set in the redundant area of all pages included in the corresponding block or the redundant area of the first page of the block. Further, in this case, the block is treated as a defective block even if it has not deteriorated at that time, and the replacement process with the spare block is performed. The flash memory card device driver 14
By referring to the erase count over flag of each defective block, it is possible to identify whether the block actually causes an error or the block treated as defective by the erase count excess.

【0043】ベリファイエラーフラグ(b2)は、対応
するページに対するページリード時に実行されるリード
ベリファイ作業でエラーが発生したか否かを示すフラグ
である。
The verify error flag (b2) is a flag indicating whether or not an error has occurred in the read verify operation executed at the time of page reading for the corresponding page.

【0044】すなわち、フラッシュメモリカードデバイ
スドライバ14は、指定されたページからデータをリー
ドした後、そのリードデータの正当性を対応するページ
データLRCを利用して検証する。リードデータにエラ
ーが検出されたならば、ベリファイエラーフラグが
“0”にセットされる。この場合、ページリードはリト
ライされるが、リトライ処理で再度エラーが発生される
と、そのページを含むブロックは不良ブロックとして扱
われ、スペアブロックとの代替が行われる。ベリファイ
エラーが原因で代替された不良ブロックは、以降、使用
されることはない。
That is, the flash memory card device driver 14 reads the data from the specified page, and then verifies the validity of the read data by using the corresponding page data LRC. If an error is detected in the read data, the verify error flag is set to "0". In this case, the page read is retried, but when an error occurs again in the retry processing, the block including the page is treated as a defective block and replaced with the spare block. The defective block replaced by the verify error will not be used thereafter.

【0045】プログラムエラーフラグ(b1)は、対応
するページに対するページライト(プログラム)実行後
にそのライトデータの正当性を検証するために実行され
るプログラムベリファイ作業でエラーが発生したか否か
を示すフラグである。
The program error flag (b1) is a flag indicating whether or not an error has occurred in the program verify operation executed for verifying the correctness of the write data after executing the page write (program) for the corresponding page. Is.

【0046】すなわち、フラッシュメモリカードデバイ
スドライバ14は、指定されたページにライトデータを
書き込んだ後、そのページからデータを一旦リードし
て、ライトデータと比較する。不一致であれば、プログ
ラムエラーフラグが“0”にセットされる。この場合、
ページライトはリトライされるが、リトライ処理で再度
エラーが発生されると、そのページを含むブロックは不
良ブロックとして扱われ、スペアブロックと代替され
る。この代替処理では、不良ブロックの内容が読み出さ
れてスペアブロックにコピーされた後、スペアブロック
に対するライトデータの書き込みが実行される。プログ
ラムエラーが原因で代替された不良ブロックは、以降、
使用されることはない。
That is, the flash memory card device driver 14 writes the write data to the designated page, then once reads the data from the page, and compares it with the write data. If they do not match, the program error flag is set to "0". in this case,
The page write is retried, but when an error occurs again in the retry processing, the block including the page is treated as a bad block and replaced with the spare block. In this alternative process, the contents of the defective block are read and copied to the spare block, and then write data is written to the spare block. The bad blocks replaced due to the program error will be
Never used.

【0047】イレーズエラーフラグ(b0)は、対応す
るページを含むブロックに対する消去動作が正常に実行
されたか否かを示すフラグである。すなわち、フラッシ
ュメモリカードデバイスドライバ14は、指定されたブ
ロックに対するイレーズ処理を実行した後、イレーズ処
理が正常に実行されたか否かを調べる。イレーズが失敗
した場合には、そのブロックに含まれる全ページの冗長
領域、またはそのブロックの先頭ページの冗長領域に、
“0”のイレーズエラーフラグがセットされる。この場
合、ブロックイレーズ処理はリトライされるが、リトラ
イ処理で再度エラーが発生されると、そのブロックは不
良ブロックとして扱われ、スペアブロックと代替され
る。イレーズエラーが原因で代替された不良ブロック
は、以降、使用されることはない。
The erase error flag (b0) is a flag indicating whether the erase operation for the block including the corresponding page has been normally executed. That is, the flash memory card device driver 14 checks whether or not the erase process is normally executed after executing the erase process for the designated block. If the erase fails, the redundant area of all pages included in the block, or the redundant area of the first page of the block,
The erase error flag of "0" is set. In this case, the block erase process is retried, but when an error occurs again in the retry process, the block is treated as a defective block and replaced with the spare block. The defective block replaced by the erase error is not used thereafter.

【0048】図4には、フラッシュメモリカードドライ
バ14によって作成および管理されるカード管理フラグ
の構成が示されている。カード管理フラグは8ビットの
フラグを用いて実現されており、それら8ビットによっ
てカードの内部状態が表現される。カード管理フラグの
各ビットの意味は以下のとおりである。
FIG. 4 shows the structure of the card management flag created and managed by the flash memory card driver 14. The card management flag is realized by using an 8-bit flag, and the internal state of the card is expressed by these 8 bits. The meaning of each bit of the card management flag is as follows.

【0049】「ビット0 カード検知フラグ」カードが
挿入されたことを検出した時点で有効(ビットが1)と
なり、システム内で次の挿抜のイベントが起きるまで、
このフラグは維持される。ソフトウェア内部でカードの
存在を確認するプロセスにおいて、このフラグが有効の
間には、ハードウェアに直接応答することなく処理が行
えるようになる。
"Bit 0 card detection flag" It becomes valid (bit is 1) when it is detected that a card has been inserted, and until the next insertion / removal event occurs in the system,
This flag is maintained. In the process of confirming the existence of the card inside the software, while this flag is valid, the processing can be performed without directly responding to the hardware.

【0050】このフラグはカードの抜去のイベントや、
他のプロセス実行時にカードが変更されたことを検出し
ない限り、リセットは行われない。 「ビット1 カード認定状態フラグ」カードがアクセス
可能になる設定がすべて完了の場合、フラグを有効とす
る。このフラグを参照することにより、その時点のカー
ドが設定をするべきなのかが判別可能になる。このフラ
グが無効である場合に他のフラグも参照の上、ソフトウ
ェアは何をするべきなのかを判断することが可能にな
る。
This flag is used for card removal events,
The reset will not occur unless it detects that the card has changed during the execution of another process. "Bit 1 card certification status flag" The flag is valid when all the settings to make the card accessible are completed. By referring to this flag, it becomes possible to determine whether the card at that time should be set. If this flag is disabled, it will be possible to refer to other flags as well to determine what the software should do.

【0051】「ビット2 カード内の管理情報の読み込
みフラグ」動的にソフトウェア内に持つデータ以外に、
カードのデータ領域にそれぞれのカードの状態を表す管
理情報がある場合、その管理情報をシステムのメモリ領
域に読み込みが完了したことを示すフラグである。この
フラグが有効である場合、カード内部の情報を毎回読み
にいく必要はなく、メモリ上の管理情報を参照して動作
することが可能になる。ソフトウェアのプロセスの処理
時間向上のために用いられるフラグである。また、管理
情報の内容の更新が行われる場合も、このフラグとビッ
ト00を参照することにより直接カード内部から情報を
読み込むのではなく、メモリを利用することも可能にな
る。
"Bit 2 management information read flag in card" In addition to data dynamically held in software,
When there is management information indicating the status of each card in the data area of the card, this is a flag indicating that the management information has been read into the memory area of the system. When this flag is valid, it is not necessary to read the information inside the card every time, and it becomes possible to operate by referring to the management information on the memory. This flag is used to improve the processing time of the software process. Further, even when the content of the management information is updated, it is possible to use the memory instead of directly reading the information from the inside of the card by referring to this flag and bit 00.

【0052】「ビット3 不良ブロック管理テーブルの
有効/無効フラグ」フラッシュEEPROMを搭載した
メモリカードにおいて、カード使用中に半導体の劣化に
よる不良ブロックが発生する。その不良ブロックを管理
するテーブルが動作上で存在する場合に、管理するその
不良ブロック管理テーブルが今アクセスしているカード
に対して、有効なのかを判別するためのフラグである。
これにより、不良ブロックとして登録されているアドレ
スへのアクセス要求がきた場合に、即座にエラーを返す
ことが可能になる。
"Valid 3 Valid / Invalid Flag of Bad Block Management Table" In a memory card equipped with a flash EEPROM, a bad block occurs due to deterioration of a semiconductor during use of the card. This is a flag for determining whether the bad block management table to be managed is valid for the card which is being accessed when the table for managing the bad block exists in operation.
This makes it possible to immediately return an error when an access request is made to an address registered as a bad block.

【0053】「ビット4 カード全体の状態フラグ」こ
のフラグが有効な場合、現時点でカードに問題が無いこ
とを判別することが可能になる。このフラグが無効であ
る場合、一切の外部からのカードへのアクセスに対して
即座にエラーを返すことが可能になる。このフラグはカ
ード挿入直後のすべての初期化プロセスにおいて、問題
なく終了した場合に有効となる。
"Bit 4 Status flag of entire card" When this flag is valid, it is possible to determine that there is no problem with the card at this time. If this flag is disabled, it will be possible to immediately return an error for any external access to the card. This flag is valid when all initialization processes immediately after card insertion are completed without any problems.

【0054】「ビット5 代替ブロック超過フラグ」カ
ード内部に不良ブロック発生時に代替するための領域と
して設けていたブロックがすべて使われていることを示
すフラグである。このフラグが有効になっているカード
に対し、その後無理な書き込みや消去を繰り返し不良カ
ードとなってしまう前に、カードをリードオンリーの状
態にするなどのカード延命処置をとることができる。そ
れにより大きな範囲でのデータの損失にならないように
制御することが可能になる。
"Bit 5 alternative block excess flag" This flag indicates that all the blocks provided inside the card as an area for replacement when a defective block occurs are used. It is possible to take a card life extension measure such as putting the card into a read-only state before a card in which this flag is valid becomes a defective card after repeated forcible writing and erasing. This makes it possible to control so as not to cause data loss in a large range.

【0055】「ビット6 予約領域とし0をセット」 「ビット7 カード管理情報更新リクエストフラグ」メ
モリ内に読み込んだカードの管理情報の内容が更新さ
れ、カード内のデータ領域に書き込む必要が生じた場合
にフラグを有効とする。このフラグが有効であったこと
を検出した場合に、管理情報を更新するプロセスに進
む。このフラグが有効にならない限り、メモリに読み込
んだ管理情報はカードの挿抜で消去されたり上書きされ
てもカードの管理上、問題が無いということになる。
"Bit 6 Reserved area is set to 0""Bit 7 Card management information update request flag" When the content of the management information of the card read in the memory is updated and it becomes necessary to write to the data area in the card Flag is enabled. If it detects that this flag was valid, it proceeds to the process of updating the management information. Unless this flag is valid, there is no problem in managing the card even if the management information read into the memory is erased or overwritten by inserting or removing the card.

【0056】このような8ビット(1バイト)分のデー
タにより、カード内の数々の状態を表記できる。本実施
形態では、このフラグをフラッシュメモリカードドライ
バ14内部に持つことを前提に説明を行う。
With such 8-bit (1 byte) data, various states in the card can be written. In the present embodiment, description will be made on the assumption that this flag is provided inside the flash memory card driver 14.

【0057】図5には、カード管理情報のデータ形式が
示されている。このカード情報は、本来データ領域のど
の領域に存在しても良いが、本実施形態ではカード11
の最終消去ブロックに記述されている。 1)チェックビット列(オフセット 0h) チェックビット列はカード管理情報の正当性を示すもの
で、16バイトの固定値である。
FIG. 5 shows the data format of the card management information. Although this card information may originally exist in any area of the data area, the card 11 is used in this embodiment.
It is described in the final erase block of. 1) Check bit string (offset 0h) The check bit string indicates the validity of the card management information, and is a fixed value of 16 bytes.

【0058】カード管理情報は、カードの最終ブロック
に格納されているが、もしも最終ブロックが不良ブロッ
クだった場合、その一つ前のブロックに格納される。こ
の場合、00hがカード管理情報内のチェックビット列
の場所に書き込まれる。
The card management information is stored in the last block of the card. However, if the last block is a defective block, it is stored in the block immediately before that. In this case, 00h is written in the place of the check bit string in the card management information.

【0059】チェックビット列が正しく読み込まれなか
った場合、そのカード管理情報は無効と認識され、その
前のブロックに新しいカード管理情報を作成する。 2)カードバージョン情報(オフセット 10h) バージョン情報は2バイトでカードの仕様バージョンを
示す。
If the check bit string is not read correctly, the card management information is recognized as invalid, and new card management information is created in the previous block. 2) Card version information (offset 10h) The version information is 2 bytes and indicates the specification version of the card.

【0060】Byte0:カードメジャーバージョン 現在のカードメジャーバージョンは01hである。 Byte1:カードマイナーバージョン 現在のカードマイナーバージョンは00hである。 3)総ブロック数(オフセット 12h) カードの総ブロック数を示す。この情報はアトリビュー
トメモリに記述されているメモリ容量から計算される総
ブロック数と一致していなければならない。総ブロック
数はカードのメモリ容量2Mバイト当たり512であ
る。
Byte 0: Card major version The current card major version is 01h. Byte 1: Card minor version The current card minor version is 00h. 3) Total block number (offset 12h) Indicates the total block number of the card. This information must match the total number of blocks calculated from the memory capacity described in the attribute memory. The total number of blocks is 512 per 2 Mbytes of memory capacity of the card.

【0061】Byte0:総ブロック数(LSB) Byte1:総ブロック数 Byte2:総ブロック数 Byte3:総ブロック数(MSB) データ領域の総ブロック数は、以下の計算式で得ること
がでる。
Byte0: total number of blocks (LSB) Byte1: total number of blocks Byte2: total number of blocks Byte3: total number of blocks (MSB) The total number of blocks in the data area can be obtained by the following formula.

【0062】データ領域総ブロック数=総ブロック数−
(総スペアブロック数+カード管理情報ブロックの総
数) 4)ブロックサイズ(オフセット 16h) ブロック当たりのバイト数を示す。この値は4096の
固定値である。
Total number of blocks in data area = total number of blocks−
(Total number of spare blocks + total number of card management information blocks) 4) Block size (offset 16h) Indicates the number of bytes per block. This value is a fixed value of 4096.

【0063】 Byte0:カードのブロックサイズ(LSB)00H Byte1:カードのブロックサイズ(MSB)10H 5)ページサイズ(オフセット 18h) ページ当たりのバイト数を示す。この値は256の固定
値である。
Byte 0: Card block size (LSB) 00H Byte 1: Card block size (MSB) 10H 5) Page size (offset 18h) Indicates the number of bytes per page. This value is a fixed value of 256.

【0064】 Byte0:カードのページサイズ(LSB)00H Byte1:カードのページサイズ(MSB)01H 6)不良ブロックテーブル形式(オフセット 1Eh) カード管理情報内の不良ブロックテーブルのフォーマッ
トを示す。
Byte 0: Card page size (LSB) 00H Byte 1: Card page size (MSB) 01H 6) Bad block table format (offset 1Eh) This shows the format of the bad block table in the card management information.

【0065】 Byte0:ビット 7−2 予約00h Bit 1−0 不良ブロックテーブルエントリサイズ 00 予約 01 予約 10 不良ブロックテーブルの各エントリサイズは2バイト 11 予約 Byte1:予約00h 7)不良ブロックテーブルオフセット(オフセット 2
0h) 不良ブロックテーブルの位置を示す。カード管理情報ブ
ロックの先頭からのオフセットで表す。
Byte 0: Bit 7-2 Reserved 00h Bit 1-0 Bad block table entry size 00 Reserved 01 Reserved 10 Each entry size of bad block table is 2 bytes 11 Reserved Byte 1: Reserved 00h 7) Bad block table offset (offset 2)
0h) Indicates the position of the bad block table. It is represented by the offset from the beginning of the card management information block.

【0066】Byte0:不良ブロックテーブルオフセ
ット(LSB) Byte1:不良ブロックテーブルオフセット(MS
B) 8)不良ブロックテーブルエントリ数(オフセット 2
2h) 不良ブロックテーブルのエントリ数を示す。カードデバ
イスドライバがサポートできる不良ブロックテーブルエ
ントリの最大値は512である。
Byte 0: bad block table offset (LSB) Byte 1: bad block table offset (MS)
B) 8) Number of bad block table entries (offset 2
2h) Indicates the number of entries in the bad block table. The maximum number of bad block table entries that the card device driver can support is 512.

【0067】Byte0:不良ブロックテーブルエント
リ数(LSB) Byte1:不良ブロックテーブルエントリ数(MS
B) 9)登録不良ブロック数(オフセット 24h) 不良ブロックテーブルに登録されている不良ブロックの
数を示す。
Byte0: Number of bad block table entries (LSB) Byte1: Number of bad block table entries (MS
B) 9) Number of Registered Bad Blocks (Offset 24h) Indicates the number of bad blocks registered in the bad block table.

【0068】Byte0:登録されている不良ブロック
エントリ数(LSB) Byte1:登録されている不良ブロックエントリ数
(MSB) 出荷時に不良ブロックエントリが登録されている可能性
もある。 10)スペアブロックテーブル形式(オフセット 2C
h) カードのスペアブロックテーブルのフォーマットを示
す。
Byte 0: Number of registered bad block entries (LSB) Byte 1: Number of registered bad block entries (MSB) It is possible that a bad block entry was registered at the time of shipment. 10) Spare block table format (offset 2C
h) shows the format of the spare block table of the card.

【0069】 Byte0:ビット 7−2 予約00h Bit1−0 スペアブロックテーブルエントリサイズ 00 予約 01 予約 10 スペアブロックテーブルの各エントリサイズは2バイト 11 予約 Byte1:予約00h スペアブロックテーブル形式は0002hの固定値であ
る。 11)スペアブロックテーブルオフセット(オフセット
2Eh) スペアブロックテーブルの位置をカード管理情報ブロッ
クの先頭からのオフセットで示す。
Byte 0: Bit 7-2 Reserved 00h Bit1-0 Spare block table entry size 00 Reserved 01 Reserved 10 Each entry size of the spare block table is 2 bytes 11 Reserved Byte 1: Reserved 00h Spare block table format is a fixed value of 0002h is there. 11) Spare block table offset (offset 2Eh) The position of the spare block table is indicated by the offset from the beginning of the card management information block.

【0070】Byte0:スペアブロックテーブルオフ
セット(LSB) Byte1:スペアブロックテーブルオフセット(MS
B) 12)スペアブロックテーブルエントリ数(オフセット
30h) スペアブロックテーブルに格納可能なエントリ数を示
す。代替領域が存在しない場合は0とし、エントリ数の
最大値は512である。スペアブロックテーブルエント
リは、カードの総容量に対しての比率(1〜5%)で決
定する。エントリ数と一致するだけのスペアブロック数
が存在する必要がある。
Byte 0: Spare block table offset (LSB) Byte 1: Spare block table offset (MS)
B) 12) Spare block table entry number (offset 30h) Indicates the number of entries that can be stored in the spare block table. If there is no alternative area, it is set to 0, and the maximum number of entries is 512. The spare block table entry is determined by the ratio (1 to 5%) to the total capacity of the card. There must be enough spare blocks to match the number of entries.

【0071】カード管理情報が格納されたブロックが不
良になった場合、代替領域の最後にカード管理情報を移
し、総スペアブロックテーブルエントリ数も1減らす必
要がある。
When the block in which the card management information is stored becomes defective, it is necessary to move the card management information to the end of the alternative area and reduce the total number of spare block table entries by one.

【0072】出荷時には代替領域を確保していないた
め、総スペアブロックテーブルエントリ数は0である。 Byte0:スペアブロックテーブルエントリ数(LS
B) Byte1:スペアブロックテーブルエントリ数(MS
B) 13)使用スペアブロック数(オフセット 32h) 使用中のスペアブロックの数を示す。ここに記してある
数はスペアブロック領域の不良ブロックも含む。出荷時
にはスペアブロック領域が確保されていないため、この
数値は0になる。
Since the alternative area is not secured at the time of shipping, the total number of spare block table entries is 0. Byte 0: number of spare block table entries (LS
B) Byte 1: number of spare block table entries (MS
B) 13) Number of used spare blocks (offset 32h) Indicates the number of spare blocks in use. The numbers described here also include defective blocks in the spare block area. Since the spare block area is not secured at the time of shipment, this numerical value becomes 0.

【0073】 Byte0:使用済みのスペアブロック数(LSB) Byte1:使用済みのスペアブロック数(MSB) 14)カード管理情報格納ブロック数(オフセット 3
8h) カード管理情報として使用されている物理ブロックの数
を示す。カード管理情報を格納可能な最大ブロック数は
50である。
Byte 0: number of used spare blocks (LSB) Byte 1: number of used spare blocks (MSB) 14) number of card management information storage blocks (offset 3
8h) Indicates the number of physical blocks used as card management information. The maximum number of blocks that can store card management information is 50.

【0074】Byte0:カード管理情報格納ブロック
数 例:0…無効(ここに0が記述されていることはありえ
ない) 1…カード管理情報が1つの物理ブロックに格納されて
いる。
Byte0: Number of blocks for storing card management information Example: 0 ... Invalid (0 cannot be described here) 1 ... Card management information is stored in one physical block.

【0075】 2…カード管理情報が2つの物理ブロックに格納されて
いる。 : Byte1:予約00h 一つのカード管理情報が複数の物理ブロックにまたがる
ことは可能である。例えば、不良ブロックテーブルとス
ペアテーブルが違う物理ブロックに格納できる。ここに
登録されている数値は物理ブロックサイズに関連する。
カードの場合、この数値は常に1である。 15)ファイルフォーマット文字列(オフセット 3E
h) 特定のファイルフォーマットでカードを利用するための
識別情報を示す。ここは8バイトのキャラクタ文字列で
表記され、カードのフォーマットを示す。以下の文字列
は既に定義されている。
2 ... Card management information is stored in two physical blocks. : Byte1: Reservation 00h One card management information can span a plurality of physical blocks. For example, the bad block table and the spare table can be stored in different physical blocks. The numerical value registered here is related to the physical block size.
For cards, this number is always 1. 15) File format character string (offset 3E
h) Indicates identification information for using the card in a specific file format. This is represented by an 8-byte character string and indicates the card format. The following strings have already been defined.

【0076】“ ”空白 カードが特定のファイルフ
ォーマットでフォーマットされていないことを示す。
(工場出荷時) “DOS FAT”DOSのFATフォーマットでフォ
ーマットされていることを示す。 16)アプリケーション/機器情報文字列(オフセット
46h) 特定のアプリケーション、または機器で利用するための
識別情報を示す。ここは16バイトのキャラクタ文字列
で、16文字以内であればどう記述してもかまわない。
しかし、以下の文字列は既に定義されている。
“” Indicates that the blank card is not formatted with the specified file format.
(Factory default) "DOS FAT" Indicates that the format is the DOS FAT format. 16) Application / device information character string (offset 46h) Indicates identification information for use in a specific application or device. This is a 16-byte character string, and it does not matter if it is 16 characters or less.
However, the following strings are already defined.

【0077】“ ”(16個の空白)特定のア
プリケーション/機器の指定無し(工場出荷時) 17)不良ブロックテーブル(オフセット 400h) 不良ブロックを登録するためのテーブルである。不良ブ
ロックの物理ブロック番号が格納される。物理ブロック
番号はカードの先頭ブロックを0とした値である。不良
ブロックエントリは、512エントリが用意され、2バ
イトでブロック番号を各エントリに記述する。
"" (16 blanks) No specific application / device specified (factory default) 17) Bad block table (offset 400h) This is a table for registering a bad block. The physical block number of the bad block is stored. The physical block number is a value in which the head block of the card is 0. As bad block entries, 512 entries are prepared, and a block number is described in each entry with 2 bytes.

【0078】未使用不良ブロックエントリの領域はFF
FFhである。これは、エントリ内に何も記述されてい
ないことを表す。FFFFh以外の数値が記述されてい
る場合は、使用済みということになる。使用済みのエン
トリ領域に未使用の領域があってはならない。必ず未使
用領域は使用済み領域の後になければならない。不良ブ
ロック番号は問題が起きたときにテーブル内に記述され
るため、不良ブロックエントリ内の番号は順不同であ
る。記述されているブロック数は、登録不良ブロック数
領域に記述されている必要がある。
The area of the unused bad block entry is FF
FFh. This means that nothing is written in the entry. If a numerical value other than FFFFh is described, it means that it has been used. There must be no unused area in the used entry area. The unused area must always follow the used area. Since the bad block number is described in the table when a problem occurs, the numbers in the bad block entry are in no particular order. The number of blocks described needs to be described in the registration defective block number area.

【0079】 Entry 0:Byte0:Bad block#0(LSB) Byte1:Bad block#0(MSB) Entry 1:Byte0:Bad block#1(LSB) Byte1:Bad block#1(MSB) : Entry 511:Byte0:Bad block#511(LSB) Byte1:Bad block#511(MSB) コメント:FFFFh=空き 18)スペアブロックテーブル(オフセット 800
h) データ領域中に発生した不良ブロックをスペアブロック
に代替したことを示すテーブルである。スペアブロック
テーブルは先頭から使用され、テーブル内には不良が発
生した物理ブロック番号が登録される。
Entry 0: Byte 0: Bad block # 0 (LSB) Byte 1: Bad block # 0 (MSB) Entry 1: Byte 0: Bad block # 1 (LSB) Byte 1: Bad block # 1 (MSB): Entry 511: : Bad block # 511 (LSB) Byte1: Bad block # 511 (MSB) Comment: FFFFh = empty 18) Spare block table (offset 800
h) A table showing that a defective block generated in the data area is replaced with a spare block. The spare block table is used from the beginning, and the physical block number in which the defect has occurred is registered in the table.

【0080】不良ブロックテーブルは最大512のエン
トリで構成され、各エントリには不良ブロック番号を格
納する。スペアブロックの最初のエントリを0とし、対
応するスペアブロックテーブルエントリに代替される不
良ブロック番号を格納する。
The bad block table is composed of 512 entries at the maximum, and the bad block number is stored in each entry. The first entry of the spare block is set to 0, and the defective block number replaced by the corresponding spare block table entry is stored.

【0081】未使用不良ブロックテーブルエントリの内
容はFFFFhである。そしてこれはエントリ内に何も
記述されていないことを表す。スペアブロックが不良ブ
ロックである場合は対応するスペアブロックテーブルエ
ントリの内容はFFFEhである。そしてこのブロック
はスペアブロックとして使用できない。0000h〜F
FFDhまでの値が、スペアブロックとして有効に使わ
れていることを表す。
The content of the unused bad block table entry is FFFFh. And this means that nothing is described in the entry. When the spare block is a defective block, the content of the corresponding spare block table entry is FFFEh. And this block cannot be used as a spare block. 0000h-F
A value up to FFDh indicates that it is effectively used as a spare block.

【0082】 Entry 0:Byte0:Bad block#0(LSB) Byte1:Bad block#0(MSB) Entry 1:Byte0:Bad block#1(LSB) Byte1:Bad block#1(MSB) : Entry 511:Byte0:Bad block#511(LSB) Byte1:Bad block#511(MSB) コメント:FFFFh=空き 19)チェックサム(オフセット FFFh) 2バイトのチェックサムは以下の計算方法で算出され
る。
Entry 0: Byte 0: Bad block # 0 (LSB) Byte 1: Bad block # 0 (MSB) Entry 1: Byte 0: Bad block # 1 (LSB) Byte 1: Bad block # 1 (MSB): Entry 0: 511 : Bad block # 511 (LSB) Byte 1: Bad block # 511 (MSB) Comment: FFFFh = empty 19) Checksum (offset FFFh) The 2-byte checksum is calculated by the following calculation method.

【0083】・管理情報領域の先頭からチェックサムの
直前までの内容を16ビット長で加算する。 ・その結果の下位16ビットの2の補数を格納する。
The contents from the beginning of the management information area to immediately before the checksum are added in 16-bit length. Store the lower 16-bit two's complement of the result.

【0084】つまり、カード管理情報ブロックの先頭か
ら最後まで16ビットで加算した結果が00hであれ
ば、正常なチェックサムである。 20)予約(00h) 将来の使用のための予約領域で00hに初期化された領
域である。 21)予約(FFh) 将来の使用のための予約領域でFFhに初期化された領
域である。
That is, if the result of adding 16 bits from the beginning to the end of the card management information block is 00h, it is a normal checksum. 20) Reserved (00h) Reserved area for future use, which is an area initialized to 00h. 21) Reserved (FFh) Reserved area for future use, which is an area initialized to FFh.

【0085】次に、図6〜図8のフローチャートを参照
して、フラッシュメモリカードデバイスドライバ14に
よって実行されるページリード、ページライト、および
ブロックイレーズ処理について説明する。
Next, the page read, page write, and block erase processing executed by the flash memory card device driver 14 will be described with reference to the flowcharts of FIGS.

【0086】まず、図6のフローチャートを参照して、
OS18やアプリケーションプログラム19からリード
コマンドが発行された場合に実行されるページリード処
理の手順を説明する。
First, referring to the flowchart of FIG.
A procedure of page read processing executed when a read command is issued from the OS 18 or the application program 19 will be described.

【0087】OS18やアプリケーションプログラム1
9からリード要求コマンドを受け取ると、フラッシュメ
モリカードデバイスドライバ14は、ページリージコマ
ンドを発行することによって、リード要求コマンドによ
って指定されたページに対するリードアクセスを開始
し、そのページから256バイトのユーザデータと8バ
イトの管理データを同時にリードする(ステップS10
1)。
OS 18 and application program 1
Upon receiving the read request command from the flash memory card device 9, the flash memory card device driver 14 issues a page page command to start the read access to the page specified by the read request command. Read 8-byte management data at the same time (step S10)
1).

【0088】この後、フラッシュメモリカードデバイス
ドライバ14は、リードされたページデータに含まれる
256バイトのユーザデータに従ってLRCを計算し
(ステップS102)、その計算されたLRCと、リー
ドされたページデータに含まれるページデータ用LRC
との一致の有無に従ってページリードが成功したか否か
を判断する(ステップS103)。
After that, the flash memory card device driver 14 calculates the LRC according to the 256-byte user data included in the read page data (step S102), and calculates the calculated LRC and the read page data. LRC for included page data
It is determined whether or not the page read has succeeded according to the presence or absence of (step S103).

【0089】計算されたLRCが、リードされたページ
データに含まれるページデータ用LRCと一致したなら
ば、ページリードが正常に実行されたことが確認され、
リードされたページデータに含まれる256バイトのユ
ーザデータが有効データとして、OS18やアプリケー
ションプログラム19に渡される。
If the calculated LRC matches the page data LRC included in the read page data, it is confirmed that the page read is normally executed,
The 256-byte user data included in the read page data is passed to the OS 18 and the application program 19 as valid data.

【0090】一方、不一致であれば、ページリードが失
敗したと認識され、ベリファイエラーフラグが“0”に
セットされた後、ページリードがリトライされる(ステ
ップS105)。このリトライで再度リード処理のエラ
ーが発生されると、フラッシュメモリカードデバイスド
ライバ14は、ブロック代替処理を行う(ステップS1
06)。
On the other hand, if they do not match, it is recognized that the page read has failed, the verify error flag is set to "0", and then the page read is retried (step S105). When a read processing error occurs again in this retry, the flash memory card device driver 14 performs block replacement processing (step S1).
06).

【0091】このブロック代替処理では、カード11か
ら読み出してメモリに格納されているカード管理情報の
スペアブロック管理テーブルが書き替えられ、エラー発
生したブロックの物理ブロック番号が所定のスペアブロ
ックに対応するエントリに登録される。この後、フラッ
シュメモリカードデバイスドライバ14は、エラー発生
したブロックの物理ブロック番号を不良ブロックテーブ
ルに登録してそれを不良ブロックにする(ステップS1
07)。また、ここでは、使用スペアブロック数が+1
され、これによって代替ブロック超過が発生するかどう
かが調べられる。代替ブロック超過の場合の処理の詳細
は、図11を参照して後述する。
In this block substitution processing, the spare block management table of the card management information read from the card 11 and stored in the memory is rewritten, and the physical block number of the block in which the error has occurred corresponds to the predetermined spare block. Be registered with. Thereafter, the flash memory card device driver 14 registers the physical block number of the block in which the error has occurred in the defective block table and sets it as the defective block (step S1).
07). Further, here, the number of used spare blocks is +1.
Is checked to see if this causes a substitution block excess. Details of the processing in the case of excess of the alternative block will be described later with reference to FIG. 11.

【0092】これらステップS106,S107の処理
により、以降は、不良ブロックを指定するブロック番号
がスペアブロックのブロック番号に変換され、不良ブロ
ックの代りに、スペアブロックがアクセスされることに
なる。
By the processes of steps S106 and S107, the block number designating the defective block is converted into the block number of the spare block, and the spare block is accessed instead of the defective block.

【0093】なお、ステップS106とS107はどち
らを先に実行しても良い。次に、図7のフローチャート
を参照して、OS18やアプリケーションプログラム1
9からライトコマンドが発行された場合に実行されるペ
ージライト処理の手順を説明する。
Either step S106 or S107 may be executed first. Next, referring to the flowchart of FIG. 7, the OS 18 and the application program 1
A procedure of page write processing executed when a write command is issued from 9 will be described.

【0094】OS18やアプリケーションプログラム1
9からライト要求コマンドを受け取ると、フラッシュメ
モリカードデバイスドライバ14は、まず、冗長領域だ
けをリードする専用コマンドをフラッシュEEPROM
に発行して、ライトアクセス対象のページから8バイト
の管理データをリードする(ステップS201)。次い
で、フラッシュメモリカードデバイスドライバ14は、
リードした管理データに含まれるプログラムフラグを参
照して、該当するページが消去済か否かを調べる(ステ
ップS202)。
OS 18 and application program 1
Upon receiving the write request command from the flash memory card 9, the flash memory card device driver 14 first issues a dedicated command for reading only the redundant area to the flash EEPROM.
Is issued to read the 8-byte management data from the write-access target page (step S201). Then, the flash memory card device driver 14
By referring to the program flag included in the read management data, it is checked whether or not the corresponding page has been erased (step S202).

【0095】該当するページが消去済で無い(プログラ
ムフラグ=“1”)ならば、フラッシュメモリカードデ
バイスドライバ14は、ステップS205以降のページ
ライト処理の実行に先だって、次の処理を行う。
If the corresponding page has not been erased (program flag = “1”), the flash memory card device driver 14 performs the following processing prior to executing the page write processing in step S205 and thereafter.

【0096】すなわち、フラッシュメモリカードデバイ
スドライバ14は、まず、ライト対象のページを含むブ
ロックに対するイレーズ処理を実行し(ステップS20
3)、その後、ステップS201でリードした管理デー
タに含まれるイレーズカウンタの値を+1カウントアッ
プする(ステップS204)。
That is, the flash memory card device driver 14 first executes the erase process for the block including the page to be written (step S20).
3) After that, the value of the erase counter included in the management data read in step S201 is incremented by +1 (step S204).

【0097】このようにしてプログラム可能状態になる
と、フラッシュメモリカードデバイスドライバ14は、
256バイトのライトデータからページデータ用LRC
などを計算によって求め、256バイトのライトデータ
と8バイトの管理データを含むページライトデータを生
成する(ステップS205)。
When the programmable state is achieved in this way, the flash memory card device driver 14
From 256 bytes of write data to page data LRC
Are calculated and page write data including 256 bytes of write data and 8 bytes of management data is generated (step S205).

【0098】次に、フラッシュメモリカードデバイスド
ライバ14は、ページライトコマンドを発行してページ
ライトデータのライトアクセスを実行し(ステップS2
06)、その後、書き込んだデータを即座にフラッシュ
EEPROMから読み出して、それをページライトデー
タと比較するライトベリファイを実行する(ステップS
207)。
Next, the flash memory card device driver 14 issues a page write command to execute write access of page write data (step S2).
06) Then, the written data is immediately read from the flash EEPROM, and the write verify is performed to compare it with the page write data (step S).
207).

【0099】リードデータとページライトデータが一致
せず、ページライトが失敗したと判断されると、フラッ
シュメモリカードデバイスドライバ14は、プログラム
エラーフラグを“0”にセットした後、ページライト処
理をリトライする(ステップS209)。このリトライ
で再度ページライト処理のエラーが発生されると、フラ
ッシュメモリカードデバイスドライバ14は、ブロック
代替処理を行う(ステップS215)。
If the read data and the page write data do not match and it is determined that the page write has failed, the flash memory card device driver 14 sets the program error flag to "0" and then retries the page write process. Yes (step S209). When a page write processing error occurs again in this retry, the flash memory card device driver 14 performs block substitution processing (step S215).

【0100】このブロック代替処理では、まず、エラー
発生したブロックの記憶内容がそれを代替するスペアブ
ロックにコピーされた後、ライトデータがスペアブロッ
クに書き込まれる。この後、カード管理情報のスペアブ
ロックテーブルが書き替えられて、エラー発生したブロ
ックの物理ブロック番号がそれを代替するスペアブロッ
クのエントリに登録される。この後、フラッシュメモリ
カードデバイスドライバ14は、エラー発生したブロッ
クの物理ブロック番号を不良ブロック管理テーブルに登
録してそれを不良ブロックにする(ステップS21
6)。また、ここでは、使用スペアブロック数が+1さ
れ、代替ブロック超過が発生するかどうかが調べられ
る。
In this block replacement processing, first, the storage content of the block in which the error has occurred is copied to the spare block that replaces it, and then the write data is written to the spare block. After that, the spare block table of the card management information is rewritten, and the physical block number of the block in which the error has occurred is registered in the spare block entry that replaces it. Thereafter, the flash memory card device driver 14 registers the physical block number of the block in which the error has occurred in the bad block management table and sets it as the bad block (step S21).
6). In addition, here, the number of used spare blocks is incremented by 1, and it is checked whether or not a substitute block excess occurs.

【0101】これらステップS215,S216の処理
により、以降は、不良ブロックの代りに、スペアブロッ
クがアクセスされることになる。なお、ステップS10
6とS107はどちらを先に実行しても良い。
By the processes of these steps S215 and S216, the spare block will be accessed in place of the defective block thereafter. Step S10
Either S6 or S107 may be executed first.

【0102】リードデータとページライトデータが一致
し、ページライトが成功したと判断された場合には(リ
トライ成功も含む)、フラッシュメモリカードデバイス
ドライバ14は、ステップS204でカウントアップさ
れたイレーズカウンタの値がアトリビュートメモリ11
1の消去限界回数を越えたか否かを調べる(ステップS
210)。消去限界回数を越えている場合には、フラッ
シュメモリカードデバイスドライバ14は、ブロック代
替処理を行う(ステップS211)。
When the read data and the page write data match and it is determined that the page write is successful (including successful retry), the flash memory card device driver 14 determines whether the erase counter counted up in step S204 Value is attribute memory 11
It is checked whether or not the erase limit number of 1 has been exceeded (step S
210). If the erase limit number of times is exceeded, the flash memory card device driver 14 performs block substitution processing (step S211).

【0103】このブロック代替処理では、まず、消去限
界回数を越えたブロックの記憶内容がそれを代替するス
ペアブロックにコピーされた後、スペアブロックの先頭
ページのイレーズカウンタの値が初期値(=0)に設定
し直される。そして、スペアブロックテーブルが書き替
えられて、消去限界回数を越えたブロックの物理ブロッ
ク番号がそれを代替するスペアブロックのエントリに登
録される。そして、使用スペアブロック数が+1され、
代替ブロック超過が発生するかどうかが調べられる。
In this block replacement processing, first, after the storage contents of the block that has exceeded the erase limit number of times are copied to the spare block that replaces it, the value of the erase counter of the first page of the spare block is set to the initial value (= 0. ) Is set again. Then, the spare block table is rewritten, and the physical block number of the block that has exceeded the erase limit number is registered in the entry of the spare block that replaces it. Then, the number of used spare blocks is incremented by 1,
It is checked whether a substitution block excess occurs.

【0104】この後、フラッシュメモリカードデバイス
ドライバ14は、エラー発生したブロックの物理ブロッ
ク番号を不良ブロック管理テーブルに登録してそれを不
良ブロックにし(ステップS212)、次いで、不良ブ
ロックの先頭ページに“0”のイレーズ回数オーバーフ
ラグをセットする(ステップS213)。
After that, the flash memory card device driver 14 registers the physical block number of the block in which an error has occurred in the bad block management table to make it the bad block (step S212), and then puts "" on the first page of the bad block. An erase count over flag of 0 "is set (step S213).

【0105】これらステップS212,S213の処理
により、以降は、不良ブロックの代りに、スペアブロッ
クがアクセスされることになる。また、ステップS21
3の処理により、不良ブロックにされた原因(代替の原
因)がイレーズ回数オーバーによるものであることを、
知ることができる。
By the processes of these steps S212 and S213, the spare block will be accessed in place of the defective block thereafter. In addition, step S21
By the process of 3, it is confirmed that the cause of the bad block (the alternative cause) is that the erase count is exceeded.
You can know.

【0106】なお、ステップS211とS213はどち
らを先に実行しても良い。また、ステップS210〜S
213の処理は、ステップS202でプログラムフラグ
=1であることが検出された場合には実行する必要はな
い。これは、プログラムフラグ=1ならば、イレーズカ
ウンタのカウントアップは実行されないからである。
Either step S211 or S213 may be executed first. In addition, steps S210 to S
The process of 213 does not need to be executed when it is detected in step S202 that the program flag = 1. This is because if the program flag = 1, the erase counter is not counted up.

【0107】次に、図8のフローチャートを参照して、
OS18やアプリケーションプログラム19からイレー
ズコマンドが発行された場合に実行されるブロックイレ
ーズ処理の手順を説明する。
Next, referring to the flow chart of FIG.
A procedure of block erase processing executed when an erase command is issued from the OS 18 or the application program 19 will be described.

【0108】OS18やアプリケーションプログラム1
9からイレーズコマンドを受け取ると、フラッシュメモ
リカードデバイスドライバ14は、まず、冗長領域だけ
をリードする専用コマンドをフラッシュEEPROMに
発行して、ブロックイレーズ対象の先頭ページから8バ
イトの管理データをリードする(ステップS301)。
次いで、フラッシュメモリカードデバイスドライバ14
は、リードした管理データに含まれるプログラムフラグ
を参照して、該当するページがプログラムされている状
態か否かを調べる(ステップS302)。
OS 18 and application program 1
When the erase command is received from the flash memory 9, the flash memory card device driver 14 first issues a dedicated command for reading only the redundant area to the flash EEPROM to read the 8-byte management data from the first page of the block erase target ( Step S301).
Then, the flash memory card device driver 14
Refers to the program flag included in the read management data to check whether or not the corresponding page is in the programmed state (step S302).

【0109】該当するページがプログラムされている
(プログラムフラグ=“0”)ならば、フラッシュメモ
リカードデバイスドライバ14は、ブロックイレーズコ
マンドを発行して、イレーズ対象のブロックに対するイ
レーズ処理を実行し(ステップS303)、その後、ス
テップS301でリードした管理データに含まれるイレ
ーズカウンタの値を+1カウントアップする(ステップ
S304)。
If the relevant page is programmed (program flag = “0”), the flash memory card device driver 14 issues a block erase command to execute the erase process for the block to be erased (step After that, the value of the erase counter included in the management data read in step S301 is incremented by +1 (step S304).

【0110】次いで、フラッシュメモリカードデバイス
ドライバ14は、例えば、イレーズしたブロックの記憶
データが初期値(各ビット=“1”)か否かを調べるこ
となどにより、ブロックイレーズが正常に実行されたか
否かを検出する(ステップS305)。
Next, the flash memory card device driver 14 determines whether the block erase has been normally executed, for example, by checking whether the stored data of the erased block is the initial value (each bit = "1"). It is detected (step S305).

【0111】ブロックイレーズが失敗したと判断される
と、フラッシュメモリカードデバイスドライバ14は、
イレーズ対象ブロックの先頭ページの冗長領域に“0”
のイレーズフラグをセットした後、ブロックイレーズ処
理をリトライする(ステップS306)。このリトライ
で再度ブロックイレーズ処理のエラーが発生されると、
フラッシュメモリカードデバイスドライバ14は、ブロ
ック代替処理を行う(ステップS312)。
When it is determined that the block erase has failed, the flash memory card device driver 14
“0” in the redundant area of the first page of the erase target block
After the erase flag is set, the block erase process is retried (step S306). If a block erase processing error occurs again in this retry,
The flash memory card device driver 14 performs block substitution processing (step S312).

【0112】このブロック代替処理では、まず、スペア
ブロックテーブルが書き替えられて、エラー発生したブ
ロックの物理ブロック番号がそれを代替するスペアブロ
ックのエントリに登録される。この後、フラッシュメモ
リカードデバイスドライバ14は、エラー発生したブロ
ックの物理ブロック番号を不良ブロック管理テーブルに
登録してそれを不良ブロックにする(ステップS31
3)。また、ここでは、使用スペアブロック数が+1さ
れ、代替ブロック超過が発生するかどうかが調べられ
る。
In this block replacement processing, first, the spare block table is rewritten, and the physical block number of the block in which the error has occurred is registered in the entry of the spare block that replaces it. Thereafter, the flash memory card device driver 14 registers the physical block number of the block in which the error has occurred in the bad block management table and sets it as the bad block (step S31).
3). In addition, here, the number of used spare blocks is incremented by 1, and it is checked whether or not a substitute block excess occurs.

【0113】これらステップS312,S313の処理
により、以降は、不良ブロックの代りに、スペアブロッ
クがアクセスされることになる。なお、ステップS31
2とS313はどちらを先に実行しても良い。
By the processes of these steps S312 and S313, the spare block will be accessed in place of the defective block thereafter. Note that step S31
Either S2 or S313 may be executed first.

【0114】ブロックイレーズが成功したと判断された
場合には(リトライ成功も含む)、フラッシュメモリカ
ードデバイスドライバ14は、ステップS304でカウ
ントアップされたイレーズカウンタの値がアトリビュー
トメモリ111の消去限界回数を越えたか否かを調べる
(ステップS307)。消去限界回数を越えている場合
には、フラッシュメモリカードデバイスドライバ14
は、ブロック代替処理を行う(ステップS308)。
If it is determined that the block erase is successful (including successful retry), the flash memory card device driver 14 determines that the erase counter value counted up in step S304 indicates the erase limit number of the attribute memory 111. It is checked whether or not it has been exceeded (step S307). If the erase count is exceeded, the flash memory card device driver 14
Performs block substitution processing (step S308).

【0115】このブロック代替処理では、消去限界回数
を越えたブロックの物理ブロック番号がそれを代替する
スペアブロックのエントリに登録される。この後、フラ
ッシュメモリカードデバイスドライバ14は、エラー発
生したブロックの物理ブロック番号を不良ブロックテー
ブルに登録してそれを不良ブロックにし(ステップS3
09)、次いで、不良ブロックの先頭ページに“0”の
イレーズ回数オーバーフラグをセットする(ステップS
310)。また、ここでは、使用スペアブロック数が+
1され、代替ブロック超過が発生するかどうかが調べら
れる。
In this block replacement processing, the physical block number of the block that has exceeded the erase limit number is registered in the entry of the spare block that replaces it. After that, the flash memory card device driver 14 registers the physical block number of the block in which the error has occurred in the defective block table and sets it as the defective block (step S3).
09), and then an erase count over flag of "0" is set to the first page of the defective block (step S).
310). Also, here, the number of used spare blocks is +
1 and it is checked whether a substitute block excess occurs.

【0116】これらステップS308,S309の処理
により、以降は、不良ブロックの代りに、スペアブロッ
クがアクセスされることになる。また、ステップS31
0の処理により、不良ブロックにされた原因(代替の原
因)がイレーズ回数オーバーによるものであることを、
知ることができる。なお、ステップS308とS309
はどちらを先に実行しても良い。
By the processing of these steps S308 and S309, the spare block will be accessed in place of the defective block thereafter. Step S31
By the processing of 0, it is confirmed that the cause of the bad block (the alternative cause) is that the erase count is exceeded.
You can know. Note that steps S308 and S309
May be executed first.

【0117】一方、ステップS307で消去限界回数を
越えていないことが検出された場合には、フラッシュメ
モリカードデバイスドライバ14は、イレーズしたブロ
ックの先頭ページに、ステップS304でカウントアッ
プしたイレーズカウンタの値を書き込み、そして各ペー
ジのプログラムフラグを“1”にリセットして終了する
(ステップS311)。
On the other hand, if it is detected in step S307 that the erase limit number has not been exceeded, the flash memory card device driver 14 adds the value of the erase counter counted up in step S304 to the first page of the erased block. Is written, and the program flag of each page is reset to "1" to finish (step S311).

【0118】次に、図9のフローチャートを参照して、
カード初期化時に行われるカード管理フラグの生成処理
について説明する。フラッシュメモリカードデバイスド
ライバ14は、カードサービス15からの通知によって
カード挿入を検知すると、そのカードのアトリビュート
メモリからCISをリードしてそれがフラッシュメモリ
カード11か否かを判断し、フラッシュメモリカード1
1であれば、カード検知フラグb0を1にする(ステッ
プS401)。この後、カード初期化ルーチンを行い、
初期化が全て正常終了したときに、フラッシュメモリカ
ードデバイスドライバ14は、カード状態設定フラグb
1を1にする(ステップS402)。次いで、フラッシ
ュメモリカードデバイスドライバ14は、フラッシュメ
モリカード11からカード管理情報をコンピュータのメ
インメモリ上に読み込み、それが正常終了したときに管
理情報読み込みフラグb2を1にする(ステップS40
3)。
Next, referring to the flow chart of FIG.
A card management flag generation process performed at the time of card initialization will be described. When the flash memory card device driver 14 detects the card insertion by the notification from the card service 15, the flash memory card device driver 14 reads the CIS from the attribute memory of the card to determine whether the card is the flash memory card 11 or not.
If it is 1, the card detection flag b0 is set to 1 (step S401). After this, perform the card initialization routine,
When all the initialization is completed normally, the flash memory card device driver 14 determines that the card state setting flag b
1 is set to 1 (step S402). Next, the flash memory card device driver 14 reads the card management information from the flash memory card 11 into the main memory of the computer, and sets the management information read flag b2 to 1 when the card management information ends normally (step S40).
3).

【0119】この後、フラッシュメモリカードデバイス
ドライバ14は、読み込んだカード管理情報の不良ブロ
ックテーブルに記述されている任意の不良ブロックにア
クセスしてページステータスフラグを読み取り、本当に
不良か否かを調べて不良ブロックの有効性を検証する。
ページステータスフラグにエラーフラグがあれば、不良
ブロックテーブルの内容が正しいものと判断して、不良
ブロック管理テーブル有効/無効フラグb3を1にする
(ステップS404)。次いで、フラッシュメモリカー
ドデバイスドライバ14は、カード管理情報のスペアブ
ロックテーブルエントリ数で指定される総スペアブロッ
ク数が、使用スペアブロック数で指定される使用済みス
ペアブロック数よりも多いか否かを調べ、使用済みスペ
アブロック数よりも多ければ代替ブロック超過フラグb
5を0、使用済みスペアブロック数以下であれば代替ブ
ロック超過フラグb5を1にする(ステップS40
5)。
After that, the flash memory card device driver 14 accesses an arbitrary bad block described in the bad block table of the read card management information, reads the page status flag, and checks whether it is really bad or not. Verify the validity of bad blocks.
If the page status flag has an error flag, it is determined that the content of the bad block table is correct, and the bad block management table valid / invalid flag b3 is set to 1 (step S404). Next, the flash memory card device driver 14 checks whether the total number of spare blocks designated by the number of spare block table entries in the card management information is larger than the number of used spare blocks designated by the number of used spare blocks. , If the number of spare blocks is larger than the number of used spare blocks, the alternative block excess flag b
5 is 0, and if it is less than or equal to the number of used spare blocks, the alternative block excess flag b5 is set to 1 (step S40).
5).

【0120】以上の処理が全て正常に終了してエラーや
代替ブロック超過が無かった場合には、フラッシュメモ
リカードデバイスドライバ14は、カード全体の状態フ
ラグb4を1にする(ステップS406)。
When all of the above processes have been completed normally and there is no error or excess of alternative blocks, the flash memory card device driver 14 sets the status flag b4 of the entire card to 1 (step S406).

【0121】次に、図10のフローチャートを参照し
て、カード管理情報更新時に行われるカード管理フラグ
の生成処理について説明する。フラッシュメモリカード
デバイスドライバ14は、不良ブロック発生等によって
カード管理情報を更新するとき、カード管理情報更新フ
ラグb7を1にする。
Next, with reference to the flow chart of FIG. 10, a card management flag generation process performed at the time of updating the card management information will be described. The flash memory card device driver 14 sets the card management information update flag b7 to 1 when updating the card management information due to occurrence of a defective block or the like.

【0122】次に図11のフローチャートを使用して、
カード管理フラグを使用したカード管理の手順を説明す
る。カード11がシステムに挿入され、物理的に挿入さ
れたことを信号で検知後、フラッシュメモリカードデバ
イスドライバ14は、カード管理情報をシステムのメモ
リの領域にロードする(ステップS601)。次に、フ
ラッシュメモリカードデバイスドライバ14は、カード
11の属性情報CISを読みだし、カードの初期化を開
始する(ステップS602)。そして、必要なリソース
を確保した後、カード管理フラグとして管理できるもの
はフラグを立てる。すべての初期化が終了した時点でカ
ード管理フラグのチェックを行い、通常プロセスが実行
可能かどうかを判別する(ステップS603,S60
4)。
Next, using the flowchart of FIG. 11,
A card management procedure using the card management flag will be described. After the card 11 is inserted into the system and the signal that the card 11 is physically inserted is detected, the flash memory card device driver 14 loads the card management information into the memory area of the system (step S601). Next, the flash memory card device driver 14 reads the attribute information CIS of the card 11 and starts the initialization of the card (step S602). Then, after securing the necessary resources, flags that can be managed as card management flags are set. When all the initialization is completed, the card management flag is checked to determine whether the normal process can be executed (steps S603 and S60).
4).

【0123】通常プロセスの実行を開始した場合(ステ
ップS605)は、必要な情報をカード管理フラグか、
またはメモリにマップされているカード管理情報を参照
して調べ、カード11の状態の変更があれば必要に応じ
てフラグとカード管理情報を書き換えればよい。このフ
ラグとカード管理情報は、更新されるか、カード11が
抜かれるまで保持される。そして、通常プロセスのアク
セス処理が原因でカード管理情報を更新する必要が生じ
た場合は(ステップS606)、その更新結果に応じて
カード管理フラグの代替領域超過フラグをたてるか否か
が調べられる。
When the execution of the normal process is started (step S605), necessary information is sent to the card management flag or
Alternatively, the card management information mapped in the memory may be referred to and checked, and if the state of the card 11 is changed, the flag and the card management information may be rewritten as necessary. This flag and card management information are held until updated or the card 11 is removed. When it is necessary to update the card management information due to the access process of the normal process (step S606), it is checked whether the alternative area excess flag of the card management flag is set according to the update result. .

【0124】そして、通常プロセスを実行するのに必要
とするフラグが立っていない場合、以下の処理が行われ
る。ビット5に1が立っている場合(ステップS60
7)、カード11内部に設けた代替領域が飽和している
ため、カード11の延命を図るために、アクセスモード
の切り替えが行われる(ステップS611)。そして、
ユーザに代替領域の飽和を通知することなどによって、
カード11内部のデータを別のメディアに移す作業を実
行させる。そして、カード11が抜かれれば(ステップ
S612)、処理は終了する。
Then, when the flag required for executing the normal process is not set, the following processing is performed. When 1 is set in bit 5 (step S60
7) Since the alternative area provided inside the card 11 is saturated, the access mode is switched to extend the life of the card 11 (step S611). And
By notifying the user of the saturation of the alternative area,
The operation of transferring the data in the card 11 to another medium is executed. Then, if the card 11 is removed (step S612), the process ends.

【0125】また、アクセスモードを次のように切り替
えて、カード使用を続行することもできる。 1)アクセスモード1 代替領域が使用中に飽和した場合は、不良カードとする
のを防ぐため、カード11のアクセス形態をリードオン
リーに制限する。この場合、この後、カード11に対す
る消去や書き込みは禁止される。カード11の状態を保
持しないで書き込みや消去を許すと、通常ブロックが不
良となった場合に代替領域不足のため不良カードとなっ
てしまうからである。
It is also possible to switch the access mode as follows and continue using the card. 1) Access mode 1 When the alternative area is saturated during use, the access mode of the card 11 is limited to read only in order to prevent the card from becoming a defective card. In this case, thereafter, erasing or writing to the card 11 is prohibited. This is because if writing and erasing are allowed without holding the state of the card 11, a normal block becomes a defective card due to lack of a replacement area when the block becomes defective.

【0126】この後、カード11が選択できるアクセス
モードを二つ設けることが可能になる。 2)アクセスモード2 ひとつはカード11の状態をこのままにし、代替領域飽
和後の不良ブロックに対しては一切のアクセス権を許さ
ないものとしてカード容量を減少させながら使用するモ
ードである。
After that, it becomes possible to provide two access modes that the card 11 can select. 2) Access Mode 2 One is a mode in which the state of the card 11 is kept as it is, and the card capacity is reduced while the access is not permitted to the defective block after the replacement area saturation.

【0127】2)アクセスモード3 もうひとつは、代替領域飽和後にカード11を再度フォ
ーマットする時に代替領域の全容量に対する割合を増や
すことで、再度カードを使用できるようにするモードで
ある。
2) Access Mode 3 The other is a mode in which the card can be used again by increasing the ratio of the alternative area to the total capacity when the card 11 is reformatted after the alternative area is saturated.

【0128】この2点のモードの違いは、カード11を
使用しているユーザが使用可能容量を把握している状態
でカード11の利用可能容量の減少を許すか、使えば使
うほど無意識の内にカード容量が減っていくかの違いで
ある。カード11がどのアクセスモードになっていて、
ソフトウェアがどういう動作をすればよいかは、カード
管理情報内に管理するか、前述のカード管理フラグを1
6ビットにしてフラグで管理するなど様々な方法がとれ
る。その管理方法を具体例をあげて説明すると、カード
管理情報では、既に予約としてとってある領域を利用し
て1〜2バイト表現で以下のように設定することが可能
である。 (1バイトで表現する) 00h…通常アクセスモード 01h…代替領域拡張モード 02h…不良セクタ(ブロック)モード FFh…リードオンリーモード また、フラグを拡張する場合であれば上記の1バイト表
記をビットマップにするだけで実現可能である。フラグ
を利用する場合は、8バイトすべてをアクセスモードの
表現に使うのは無駄な部分が生じるため、前記のカード
管理情報の内容を変更する。
The difference between these two modes is that the user who is using the card 11 permits the decrease in the available capacity of the card 11 while knowing the available capacity, or the more the card is used, the more unconscious it becomes. The difference is that the card capacity will decrease. Which access mode the card 11 is in
The operation of the software is managed in the card management information or the card management flag described above is set to 1
Various methods such as 6-bit management with flags are possible. The management method will be described with reference to a specific example. In the card management information, it is possible to use the area already reserved as a 1 to 2 byte expression and set as follows. (Expressed in 1 byte) 00h ... Normal access mode 01h ... Alternative area expansion mode 02h ... Bad sector (block) mode FFh ... Read-only mode If the flag is expanded, the above 1-byte notation is converted to a bitmap. It can be realized just by doing. When using the flag, it is useless to use all 8 bytes for expressing the access mode, so the contents of the card management information are changed.

【0129】 ビット7 ビット6 0 0 …通常アクセスモード 0 1 …代替領域拡張モード 1 0 …不良セクタ(ブロック)モード 1 1 …リードオンリーモード カード管理情報でアクセスモードを管理する場合は、そ
のカードが管理情報を書き換えない限り、モードが有効
のままになる。逆に管理フラグ内でモードを切り替える
場合は、カードを挿入して抜き去るまでの間だけモード
が有効になる。
Bit 7 Bit 6 0 0 ... Normal access mode 0 1 ... Alternate area expansion mode 1 0 ... Bad sector (block) mode 1 1 ... Read-only mode When the access mode is managed by the card management information, the card is The mode remains valid unless the management information is rewritten. Conversely, when switching the mode within the management flag, the mode is valid only until the card is inserted and removed.

【0130】フラッシュメモリカードの場合は、いろい
ろな手法で寿命を伸ばすように努力がされてきている
が、本実施形態の機能を実現すると寿命近辺でのデータ
の損失の防止とPCカードとしての寿命を延長すること
が可能になる。
In the case of a flash memory card, efforts have been made to extend the life of the flash memory card by various methods. However, if the function of this embodiment is realized, the loss of data near the life of the flash memory card and the life of the PC card will be prevented. Can be extended.

【0131】また、図11において、他のビットに対す
る処理は以下の通りである。ビット0が1になっていな
い時(ステップS608)、挿入直後にこのフラグが有
効になっていない場合は、フラッシュメモリカードドラ
イバ14の管理すべきPCカードではないか、あるいは
挿入直後に抜き去られたかと判断し、処理を中断する。
Further, in FIG. 11, the processing for other bits is as follows. If the bit 0 is not 1 (step S608) and this flag is not enabled immediately after insertion, it is not a PC card to be managed by the flash memory card driver 14 or is removed immediately after insertion. It is determined that the process is stopped and the process is interrupted.

【0132】ビット1が1になっていない場合(ステッ
プS609)は、カード11が動作するためのすべての
条件が揃っていない可能性があるため、カード11の初
期化処理を再度実行する必要がある。ビット2、3が同
時に1に立っていない場合(ステップS610)、カー
ド管理情報が正常に読み出せなかったか、カード管理情
報は読み出せたが、必要とする情報がきちんと読み出せ
なかった可能性がある。もう一度読み出し処理を行う
か、カードの初期化からやり直す必要がある。
If the bit 1 is not 1 (step S609), all the conditions for the card 11 to operate may not be met, and the initialization process of the card 11 needs to be executed again. is there. If bits 2 and 3 are not set to 1 at the same time (step S610), it is possible that the card management information could not be read normally, or that the card management information could be read but the necessary information could not be read properly. is there. It is necessary to perform the reading process again or restart from the initialization of the card.

【0133】ビット4に1が立っている場合、初期化の
段階でカードを不良と判別しているため一切のその後の
アクセスは無効となる。以上説明したように、この実施
形態においては、フラッシュメモリカード11から読み
取ったカード管理情報をブロック代替処理を行う度に書
き換え、その結果に基づいて代替可能なスペアブロック
が残っているか否かが調べられる。もし代替可能なスペ
アブロックが無くなったことが検出されたならば、その
時点で、フラッシュメモリカード11の延命のための手
続きが開始される。よって、代替不能によるフラッシュ
メモリカード11自体の不良が発生する前に、代替領域
の飽和をいち早く検知できるようになり、フラッシュメ
モリの信頼性を十分に向上させることが可能となる。
If the bit 4 is set to 1, the card is determined to be defective at the initialization stage, and any subsequent access is invalid. As described above, in this embodiment, the card management information read from the flash memory card 11 is rewritten every time the block replacement processing is performed, and it is checked whether or not there is a spare block that can be replaced based on the result. To be If it is detected that the spare blocks that can be replaced have run out, the procedure for extending the life of the flash memory card 11 is started at that point. Therefore, it becomes possible to quickly detect the saturation of the replacement area before the failure of the flash memory card 11 itself caused by the inability to replace, and it is possible to sufficiently improve the reliability of the flash memory.

【0134】また、アクセス形態をリードオンリーに制
限する、代替処理を禁止してその代わりに新たな不良ブ
ロックに対するアクセス権を排除する、スペアブロック
以外の他のブロックをスペアブロックとして割り当てて
スペアブロック数を増加させる等の処理を行うことによ
り、フラッシュメモリカード11の延命を図ることがで
きる。
In addition, the number of spare blocks is limited by restricting the access form to read-only, prohibiting the alternative process and excluding the access right to a new defective block, allocating blocks other than spare blocks as spare blocks. The life of the flash memory card 11 can be extended by performing processing such as increasing

【0135】[0135]

【発明の効果】以上説明したように、この発明によれ
ば、代替領域の飽和をいち早く検知できるようになり、
フラッシュメモリの信頼性を十分に向上させることが可
能となる。
As described above, according to the present invention, the saturation of the alternative area can be detected quickly,
It is possible to sufficiently improve the reliability of the flash memory.

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

【図1】この発明の一実施形態に係るフラッシュメモリ
カード管理方法を使用したパーソナルコンピュータのハ
ードウェアおよびソフトウェア構成を示すブロック図。
FIG. 1 is a block diagram showing a hardware and software configuration of a personal computer using a flash memory card management method according to an embodiment of the present invention.

【図2】同実施形態で使用されるフラッシュメモリカー
ドに設けられたフラッシュEEPROMの回路構成を示
す図。
FIG. 2 is a diagram showing a circuit configuration of a flash EEPROM provided in the flash memory card used in the embodiment.

【図3】同実施形態で使用されるフラッシュメモリカー
ドに格納される管理データのデータ構造を説明するため
の図。
FIG. 3 is a view for explaining a data structure of management data stored in the flash memory card used in the same embodiment.

【図4】同実施形態で使用されるカード管理フラグのデ
ータ構造を示す図。
FIG. 4 is a view showing a data structure of a card management flag used in the same embodiment.

【図5】同実施形態で使用されるカード管理情報のデー
タ構造を示す図。
FIG. 5 is a view showing a data structure of card management information used in the embodiment.

【図6】同実施形態におけるリードアクセス処理の手順
を説明するフローチャート。
FIG. 6 is an exemplary flowchart illustrating a procedure of read access processing according to the first embodiment.

【図7】同実施形態におけるライトアクセス処理の手順
を説明するフローチャート。
FIG. 7 is an exemplary flowchart illustrating a procedure of write access processing according to the first embodiment.

【図8】同実施形態におけるブロックイレーズ処理の手
順を説明するフローチャート。
FIG. 8 is an exemplary flowchart illustrating a procedure of block erase processing according to the first embodiment.

【図9】同実施形態においてカード初期化時に行われる
カード管理フラグの生成処理の手順を示すフローチャー
ト。
FIG. 9 is an exemplary flowchart showing a procedure of a card management flag generation process performed at card initialization in the embodiment.

【図10】同実施形態においてカード管理情報更新時に
行われるカード管理フラグの生成処理の手順を示すフロ
ーチャート。
FIG. 10 is an exemplary flowchart showing a procedure of a card management flag generation process performed when updating card management information in the embodiment.

【図11】同実施形態におけるカード管理フラグを使用
したカード管理の手順を説明するフローチャート。
FIG. 11 is an exemplary flowchart illustrating a card management procedure using a card management flag according to the first embodiment.

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

11…フラッシュメモリカード、12…他のPCカー
ド、13…PCカードホストアダプタ、14…フラッシ
ュメモリカードドライバ、15…カードサービス、16
…ソケットサービス、17…メモリテクノロジドライ
バ、18…OS、10…アプリケーションプログラム。
11 ... Flash memory card, 12 ... Other PC card, 13 ... PC card host adapter, 14 ... Flash memory card driver, 15 ... Card service, 16
... socket service, 17 ... memory technology driver, 18 ... OS, 10 ... application program.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 不良ブロックを代替するためのスペアブ
ロックが用意されたフラッシュEEPROMを有するフ
ラッシュメモリ装置の管理方法において、 前記フラッシュEEPROMの不良ブロックとその代替
のために使用されたスペアブロックとの関係を示すカー
ド管理情報を前記フラッシュメモリ装置から読み取り、 不良ブロックをスペアブロックによって代替する度に前
記カード管理情報を書き換え、その書き換え結果に基づ
いて代替可能なスペアブロックが残っているか否かを検
出し、 代替可能なスペアブロックが無くなったことを検出した
とき、代替不能による前記フラッシュメモリ装置の不良
化を招く前に前記フラッシュメモリ装置の延命のための
手続きを行うことを特徴とするフラッシュメモリ管理方
法。
1. A management method of a flash memory device having a flash EEPROM in which a spare block for replacing a defective block is prepared, the relationship between a defective block of the flash EEPROM and a spare block used for the replacement. Is read from the flash memory device, the card management information is rewritten every time a defective block is replaced by a spare block, and it is detected based on the result of the rewriting whether or not a spare block that can be replaced remains. A flash memory management method, wherein when it is detected that a spare block that can be replaced is exhausted, a procedure for extending the life of the flash memory device is performed before the failure of the flash memory device is caused by the inability to replace. .
【請求項2】 不良ブロックを代替するためのスペアブ
ロックが用意されたフラッシュEEPROMを有するフ
ラッシュメモリ装置の管理方法において、 前記フラッシュEEPROMの不良ブロックとその代替
のために使用されたスペアブロックとの関係を示すカー
ド管理情報を前記フラッシュメモリ装置から読み取り、 不良ブロックをスペアブロックによって代替する度に前
記カード管理情報を書き換え、その書き換え結果に基づ
いて代替可能なスペアブロックが残っているか否かを検
出し、 代替可能なスペアブロックが無くなったことを検出した
とき、前記フラッシュメモリ装置に対するアクセス形態
をリードオンリーに制限することを特徴とするフラッシ
ュメモリ管理方法。
2. A management method of a flash memory device having a flash EEPROM in which a spare block for replacing a defective block is prepared, wherein a relationship between a defective block of the flash EEPROM and a spare block used for its replacement is provided. Is read from the flash memory device, the card management information is rewritten every time a defective block is replaced by a spare block, and it is detected based on the result of the rewriting whether or not a spare block that can be replaced remains. A flash memory management method, wherein when it is detected that there is no substitute spare block, the access mode to the flash memory device is limited to read only.
【請求項3】 不良ブロックを代替するためのスペアブ
ロックが用意されたフラッシュEEPROMを有するフ
ラッシュメモリ装置の管理方法において、 前記フラッシュEEPROMの不良ブロックとその代替
のために使用されたスペアブロックとの関係を示すカー
ド管理情報を前記フラッシュメモリ装置から読み取り、 不良ブロックをスペアブロックによって代替する度に前
記カード管理情報を書き換え、その書き換え結果に基づ
いて代替可能なスペアブロックが残っているか否かを検
出し、 代替可能なスペアブロックが無くなったことを検出した
とき、ブロック代替を禁止し、その代わりに以降発生し
た不良ブロックについてのアクセス権を排除することを
特徴とするフラッシュメモリ管理方法。
3. A management method of a flash memory device having a flash EEPROM in which a spare block for replacing a defective block is prepared, the relationship between a defective block of the flash EEPROM and a spare block used for the replacement. Is read from the flash memory device, the card management information is rewritten every time a defective block is replaced by a spare block, and it is detected based on the result of the rewriting whether or not a spare block that can be replaced remains. A flash memory management method characterized in that, when it detects that there is no spare block that can be replaced, block replacement is prohibited, and instead, access right to a defective block that occurs subsequently is excluded.
【請求項4】 不良ブロックを代替するためのスペアブ
ロックが用意されたフラッシュEEPROMを有するフ
ラッシュメモリ装置の管理方法において、 前記フラッシュEEPROMの不良ブロックとその代替
のために使用されたスペアブロックとの関係を示すカー
ド管理情報を前記フラッシュメモリ装置から読み取り、 不良ブロックをスペアブロックによって代替する度に前
記カード管理情報を書き換え、その書き換え結果に基づ
いて代替可能なスペアブロックが残っているか否かを検
出し、 代替可能なスペアブロックが無くなったことを検出した
とき、前記フラッシュメモリ装置のスペアブロック以外
の他のブロックをスペアブロックとして割り当ててスペ
アブロック数を増加させることを特徴とするフラッシュ
メモリ管理方法。
4. A method of managing a flash memory device having a flash EEPROM in which a spare block for replacing a defective block is prepared, the relationship between a defective block of the flash EEPROM and a spare block used for the replacement. Is read from the flash memory device, the card management information is rewritten every time a defective block is replaced by a spare block, and it is detected based on the result of the rewriting whether or not a spare block that can be replaced remains. A flash memory management method, wherein when it is detected that there are no spare blocks that can be replaced, a block other than the spare block of the flash memory device is assigned as a spare block to increase the number of spare blocks.
JP00505896A 1996-01-16 1996-01-16 Flash memory management method Expired - Fee Related JP3472008B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP00505896A JP3472008B2 (en) 1996-01-16 1996-01-16 Flash memory management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00505896A JP3472008B2 (en) 1996-01-16 1996-01-16 Flash memory management method

Publications (2)

Publication Number Publication Date
JPH09198884A true JPH09198884A (en) 1997-07-31
JP3472008B2 JP3472008B2 (en) 2003-12-02

Family

ID=11600806

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00505896A Expired - Fee Related JP3472008B2 (en) 1996-01-16 1996-01-16 Flash memory management method

Country Status (1)

Country Link
JP (1) JP3472008B2 (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001027736A1 (en) * 1999-10-12 2001-04-19 Sony Computer Entertainment Inc. Entertainment device, information processor, and portable recorder
JP2007505416A (en) * 2003-09-10 2007-03-08 ハイパーストーン・アクチエンゲゼルシヤフト Managing defective blocks in flash memory
JP2008040713A (en) * 2006-08-04 2008-02-21 Hitachi Ltd Storage system for suppressing fault of storage medium group
JP2008108162A (en) * 2006-10-27 2008-05-08 Megachips Lsi Solutions Inc Memory management method
JP2008123160A (en) * 2006-11-10 2008-05-29 Megachips Lsi Solutions Inc Memory management method
US7404031B2 (en) 2004-07-23 2008-07-22 Kabushiki Kaisha Toshiba Memory card, nonvolatile semiconductor memory, and method of controlling semiconductor memory
JP2008257744A (en) * 2001-01-18 2008-10-23 Hewlett Packard Co <Hp> Module-replaceable computing system and signal mediating method
US7519876B2 (en) 2005-07-01 2009-04-14 Kabushiki Kaisha Toshiba Memory card using flash memory and method of controlling the same
KR100914089B1 (en) * 2002-10-28 2009-08-27 샌디스크 코포레이션 Maintaining erase counts in non-volatile storage systems
US7836244B2 (en) 2006-11-02 2010-11-16 Samsung Electronics Co., Ltd. Method of providing block state information in semiconductor memory device including flash memory
JP2011198409A (en) * 2010-03-19 2011-10-06 Toshiba Information Systems (Japan) Corp Nonvolatile memory
JP2012048746A (en) * 2011-11-22 2012-03-08 Hitachi Ltd Managing system and managing method for storage system using flash memory
JP2013008402A (en) * 2011-06-22 2013-01-10 Lapis Semiconductor Co Ltd Semiconductor storage device
JP2013149112A (en) * 2012-01-20 2013-08-01 Hitachi Ltd Management method for storage medium
CN103530210A (en) * 2013-09-29 2014-01-22 深圳市江波龙电子有限公司 Method and system for detecting flash memory management
US8904088B2 (en) 2008-09-30 2014-12-02 Samsung Electronics Co., Ltd. Method of managing a solid state drive, associated systems and implementations
WO2016017321A1 (en) * 2014-07-29 2016-02-04 ソニー株式会社 Memory controller, storage device, information processing system, and method of controlling memory controller
USRE47638E1 (en) * 2004-07-12 2019-10-08 Toshiba Memory Corporation Storage device including flash memory and capable of predicting storage device performance based on performance parameters

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8706950B2 (en) 2008-03-01 2014-04-22 Kabushiki Kaisha Toshiba Memory system

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6766417B1 (en) 1999-10-12 2004-07-20 Sony Computer Entertainment Inc. Entertainment apparatus, information processing unit and portable storage device
KR100729496B1 (en) * 1999-10-12 2007-06-15 가부시키가이샤 소니 컴퓨터 엔터테인먼트 Entertainment device, information processor, and portable recorder
WO2001027736A1 (en) * 1999-10-12 2001-04-19 Sony Computer Entertainment Inc. Entertainment device, information processor, and portable recorder
JP2008257744A (en) * 2001-01-18 2008-10-23 Hewlett Packard Co <Hp> Module-replaceable computing system and signal mediating method
KR100914089B1 (en) * 2002-10-28 2009-08-27 샌디스크 코포레이션 Maintaining erase counts in non-volatile storage systems
JP2007505416A (en) * 2003-09-10 2007-03-08 ハイパーストーン・アクチエンゲゼルシヤフト Managing defective blocks in flash memory
USRE47638E1 (en) * 2004-07-12 2019-10-08 Toshiba Memory Corporation Storage device including flash memory and capable of predicting storage device performance based on performance parameters
US7404031B2 (en) 2004-07-23 2008-07-22 Kabushiki Kaisha Toshiba Memory card, nonvolatile semiconductor memory, and method of controlling semiconductor memory
US7519876B2 (en) 2005-07-01 2009-04-14 Kabushiki Kaisha Toshiba Memory card using flash memory and method of controlling the same
JP2008040713A (en) * 2006-08-04 2008-02-21 Hitachi Ltd Storage system for suppressing fault of storage medium group
JP2008108162A (en) * 2006-10-27 2008-05-08 Megachips Lsi Solutions Inc Memory management method
US7836244B2 (en) 2006-11-02 2010-11-16 Samsung Electronics Co., Ltd. Method of providing block state information in semiconductor memory device including flash memory
JP2008123160A (en) * 2006-11-10 2008-05-29 Megachips Lsi Solutions Inc Memory management method
US8904088B2 (en) 2008-09-30 2014-12-02 Samsung Electronics Co., Ltd. Method of managing a solid state drive, associated systems and implementations
US9542199B2 (en) 2008-09-30 2017-01-10 Samsung Electronics Co., Ltd. Method of managing a solid state drive, associated systems and implementations
JP2011198409A (en) * 2010-03-19 2011-10-06 Toshiba Information Systems (Japan) Corp Nonvolatile memory
JP2013008402A (en) * 2011-06-22 2013-01-10 Lapis Semiconductor Co Ltd Semiconductor storage device
JP2012048746A (en) * 2011-11-22 2012-03-08 Hitachi Ltd Managing system and managing method for storage system using flash memory
JP2013149112A (en) * 2012-01-20 2013-08-01 Hitachi Ltd Management method for storage medium
CN103530210A (en) * 2013-09-29 2014-01-22 深圳市江波龙电子有限公司 Method and system for detecting flash memory management
CN103530210B (en) * 2013-09-29 2017-04-26 深圳市江波龙电子有限公司 Method and system for detecting flash memory management
WO2016017321A1 (en) * 2014-07-29 2016-02-04 ソニー株式会社 Memory controller, storage device, information processing system, and method of controlling memory controller

Also Published As

Publication number Publication date
JP3472008B2 (en) 2003-12-02

Similar Documents

Publication Publication Date Title
JP3472008B2 (en) Flash memory management method
JP4668416B2 (en) Protecting boot block code when enabling write access to the boot block
JP3078946B2 (en) Managing method of batch erase nonvolatile memory and semiconductor disk device
US7295479B2 (en) Apparatus and method for managing bad blocks in a flash memory
JP4037605B2 (en) Nonvolatile memory unit controller, memory system having the controller, and nonvolatile memory unit control method
US5406529A (en) Flash non-volatile memory
US6865658B2 (en) Nonvolatile data management system using data segments and link information
EP1548602B1 (en) Non-volatile storage device control method
JP3233079B2 (en) Data processing system and data processing method
US20070016719A1 (en) Memory device including nonvolatile memory and memory controller
JP2990181B1 (en) Flash memory, microcomputer having flash memory, and method of storing program in flash memory
US20080104361A1 (en) Storage Device, Memory Managing Apparatus, Memory Managing Method, and Program
JP3576625B2 (en) Data management method for flash memory card and data processing device using the data management method
KR100370893B1 (en) Flash memory unit and control method of flash memory
JP3268130B2 (en) Data processing device using flash EEPROM
JP2000020252A (en) Storage device using nonvolatile semiconductor memory
JP2004220068A (en) Memory card and method for writing data in memory
JP2004326523A (en) Storage device with rewritable nonvolatile memory, and control method of nonvolatile memory for storage device
JP3826115B2 (en) Storage device, memory management method, and program
JPH0729392A (en) Nonvolatile semiconductor memory and semiconductor disk device using the same
US20050068842A1 (en) Electronic device, nonvolatile memory and method of overwriting data in nonvolatile memory
JP2010092113A (en) Storage device, electronic device and data management method
JPH07141479A (en) Ic memory card and file control system using ic memory card
JP4131147B2 (en) Determination method of flash memory in printer, program for causing computer to execute this method, recording medium recording this program, and printer including flash memory
JP4580724B2 (en) Nonvolatile memory control method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070912

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080912

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees