JP3390740B2 - Method of controlling storage device - Google Patents

Method of controlling storage device

Info

Publication number
JP3390740B2
JP3390740B2 JP2000347526A JP2000347526A JP3390740B2 JP 3390740 B2 JP3390740 B2 JP 3390740B2 JP 2000347526 A JP2000347526 A JP 2000347526A JP 2000347526 A JP2000347526 A JP 2000347526A JP 3390740 B2 JP3390740 B2 JP 3390740B2
Authority
JP
Japan
Prior art keywords
data
block
sector
write
area
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.)
Expired - Lifetime
Application number
JP2000347526A
Other languages
Japanese (ja)
Other versions
JP2001188712A (en
Inventor
新平 小松
由美 森田
朋弘 林
省吾 柴崎
裕之 伊藤
勝 竹原
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2000347526A priority Critical patent/JP3390740B2/en
Publication of JP2001188712A publication Critical patent/JP2001188712A/en
Application granted granted Critical
Publication of JP3390740B2 publication Critical patent/JP3390740B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 【0001】 【産業上の利用分野】本発明はパソコンの外部記憶装置
等に使用されるフラッシュ・メモリ等の上書きのできな
い記憶装置の制御方法に関する。 【0002】 【従来の技術】近年、パソコン等の外部記憶装置とし
て、フラッシュ・メモリを使った外部記憶装置が注目を
あびている。フラッシュ・メモリは、不揮発性のためバ
ックアップ電源が不要であり、電気的に書き換えること
ができ、しかも安価であるが、次のような問題点を持っ
ている。 データを消去してからでなければ、データの書き込
みはできず、また、消去の単位はバイト単位は不可能で
あり、セクタ、ブロックもしくはチップ単位となる。こ
のため、通常のメモリのように、バイト単位でデータを
書き換えることはできず、読み出し速度に対して、書き
込み速度あるいは消去速度が遅い。 消去回数に制限があり、通常、消去回数が10万〜
100万回程度で消去不能となるといわれている。この
ため、セクタ、もしくはブロックの消去回数が平均化す
るように使用しないと、消去回数の多い部分が先に不良
となり、使用可能領域が減少する。フラッシュ・メモリ
は上記のような問題点をもっているため、フラッシュ・
メモリを使用するにあたっては、データの退避領域を用
意し、データの書き換え時にデータを退避したり、管理
テーブルを設けてデータの書き込み/消去を管理した
り、さらに、不良セクタ、ブロック等が発生した場合に
救済措置を講ずるなど、種々の方策が講じる必要があ
る。 【0003】 【発明が解決しようとする課題】フラッシュ・メモリは
不揮発性で電気的に書き換えることができる等の長所を
持っている反面、上記のように多くの問題点を持ってお
り、従来から使用されているDRAM、SRAM等の半
導体メモリとは異なり、その使用にあたって解決しなけ
ればならない問題点も多い。本発明は上記した問題点に
鑑みなされたものであって、本発明の目的は、フラッシ
ュ・メモリ等のように上書きができず、また、バイト単
位で消去することができないメモリの信頼性を向上させ
ることである。 【0004】 【課題を解決するための手段】図1ないし図4は本発明
の原理図であり、図1は本発明の全体の概略構成を示す
原理図、図2〜図4は本発明の概要を示す原理図であ
る。図1ないし図4において、1は記憶装置、1aは上
書きすることができず、また、セクタ、ブロック等の所
定の単位でしかデータを消去することができない、例え
ばフラッシュ・メモリ等から構成される記憶領域、1b
は記憶領域1aへのデータの書き込み等を制御したり、
記憶領域1aの消去等を行う制御手段、1cは記憶領域
1aへのデータの書き込み時に一時的にデータを格納し
たり、また、記憶領域1aのデータを退避するための一
次記憶媒体、1d,1eは記憶領域1aのアドレスをデ
コードするためのデコードテーブル、2は本体処理装置
である。上記課題を解決するため、本発明の請求項1の
発明は、図1,図4に示すように、読み書きが可能で、
かつ、記憶領域の一部が破壊する可能性のある記憶領域
1aと、記憶領域1a中のデータが記憶されている場所
を示す書き換え可能なデコーダ1dとを備えた記憶装置
において、デコーダを2段設け、記憶装置1の記憶領域
1aの一部が破壊したとき、もしくは、デコータ1d,
1eの一部が破壊したとき、2段のデコーダ1d,1e
のいずれか一方、もくしは、両方を書き換えることによ
り、破壊した部分へのデコードが行われないようにした
ものである。 【0005】 【作用】図1において、本体処理装置2から記憶装置1
に書き込みデータが送られてくると、制御手段1bはデ
ータを一次記憶媒体1cに格納する。そして、デコード
・テーブル1d(1e)を参照してアドレスをデコード
し、一次記憶媒体1cに格納されたデータを記憶領域1
aの新たなセクタもしくはブロックに書き込む。その
際、書き込むデータの論理アドレスと同一の論理アドレ
スのデータが記憶領域1aに既に存在している場合に
は、そのデータを消去したり、そのデータを格納した領
域に消去可能フラグを立てる。また、データを格納した
領域に消去フラグを立てた場合には、制御手段1bは所
定の時期に所定の単位で、消去不可のデータを一次記憶
媒体1cに退避して記憶領域1aを消去し、一次記憶媒
体1cに退避したデータを記憶領域1aに書き戻す等の
処理を行い、空き領域の作成等を行う。さらに、制御手
段1bは記憶領域1aの一部が不良になった場合には、
デコード・テーブル1d(1e)を書き換えるなどし
て、不良部分を予備領域で代替する。 【0006】図2(a)に示す記憶領域1aが複数のブ
ロック1a−1,…,1a−Nと、該ブロックを区切っ
たセクタから構成され、書き込まれたデータをブロック
単位で消去する記憶装置、図4に示す記憶領域1が上書
きできない複数のセクタで構成され、セクタに書き込ま
れたデータをセクタ単位で消去する記憶装置において、
データの書き込み/消去は次のように行われる。 (1) 記憶領域1aが複数のブロック1a−1,…,1a
−Nと、該ブロックを区切ったセクタから構成され、書
き込まれたデータをブロック単位で消去する記憶装置1
において、図2(b)に示すように、ブロック1a−
1,…,1a−N内の消去不可のデータを空きセクタが
ある他のブロックに退避するに際して、消去可能なセク
タ数が多いブロックからmブロックと、消去可能が少な
いブロックからnブロック(m,nは任意の整数)を選
択し、選択されたブロックを同時に空きセクタがある他
のブロックに、セクタを散在させて均一に、退避する。
これにより、空きブロックを作成することができるとと
もに、結果的に各ブロックに書き換えが多いセクタと書
き換えが少ないセクタが混在することとなり、ブロック
の消去回数を平均化することができる。 (2) 記憶領域1aが、退避領域を含む複数のブロック1
a−1,…,1a−Nから構成され、書き込まれたデー
タをブロック単位で消去する記憶装置において、図2
(c)に示すように消去可能なデータを含むブロック1
a−1,…,1a−Nのデータの内、消去不可のデータ
のみを退避領域に移動したのち、上記ブロックのデータ
を消去し、消去したブロックを新たな退避領域とするこ
とにより、空き領域を作成する。これにより、消去可能
データをなくすことができ、本処理を予め行っておくこ
とにより、書き込み時間を短縮することができる。 (3) データの書き込み方向に対して、退避領域の反対側
のブロックの消去不可のデータのみを退避領域に移動し
たのち、上記ブロックのデータを消去し、消去したブロ
ックを新たな退避領域とする。これにより、書き込み場
所を示す書き込みポインタと退避領域の間に全ての空き
領域を存在させることができる。したがって、処理の中
断があっても、書き込みポインタの示す位置からデータ
を書き込むことができ、処理中断後に必要とする処理量
を少なくすることができる。 (4) 記憶領域1が、予備領域を含む複数のブロック1a
−1,…,1a−Nから構成され、書き込まれたデータ
をブロック単位で消去する記憶装置において、図2
(a)、図3(a)に示すように書き込みポイントを予
備領域に設定し、データが書き込まれたブロックの消去
不可のデータを予備領域に移動したのち、上記ブロック
のデータを消去する処理を繰り返し、最後に消去したブ
ロック以外のブロックの空きセクタ数が予備領域にある
セクタ数と等しいか、もしくは、大きくなったとき、予
備領域のデータを最後に消去したブロック以外のブロッ
クに移動する。これにより、空き領域を作成することが
できる。また、空きブロックが使用不可になったとき、
使用不可となったブロックを救済して空きブロックを作
成することができる。さらに、予備領域のデータを、デ
ータを最後に消去したブロック以外のブロックに移動す
る際、移動先の書き込みポイントを、データを最後に消
去したブロックの後のブロックから検索して予備領域の
データを移動するようにすることにより、最後に消去を
かけたブロックと書き込みポインタの間に全ての空きセ
クタを存在させることができ、処理中断後の処理を簡単
にすることができる。またさらに、処理中断後、処理を
再開したとき、予備領域に消去可能なデータがあるか、
あるいは、消去不可のデータのみがあるかに応じて、処
理中断時点を判断することができ、処理中断時点の判断
を単純化することができる。 (5) 記憶領域1が複数のブロック1a−1,…,1a−
Nから構成され、書き込まれたデータをブロック単位で
消去する記憶装置1において、ブロック毎に書き込みの
有無を示すフラグF1を設けて、図3(b)に示すよう
に、フラグF1を参照して、書き込まれたデータを消去
する。これにより、不要な消去を避けることができ、消
去時間の短縮を図ることができるとともに、記憶媒体の
寿命を延ばすことができる。また、全記憶領域の消去処
理が実行中であることを示す実行中フラグF2を設ける
ことにより、全記憶領域の消去処理を実行中に、処理が
中断された際、実行中フラグを参照して、全記憶領域の
消去処理中であることを判断することができ、不意の処
理中断に対応することができる。 (6) 記憶領域1a上に同一の機能に対応した複数ビット
のフラグを記録し、該フラグの論理積によりフラグの判
定を行うようにする。これにより、全ビットが不良にな
らない限り、正しい判定値を常に出力することができ、
システムの信頼性を向上させることができる。 (7) 図4に示すように、記憶領域1が上書きできない複
数のセクタで構成され、セクタに書き込まれたデータを
セクタ単位で消去する記憶装置において、同一のセクタ
番号を持つセクタを少なくとも2個用意し、同一番号が
付されたセクタのいずれか一方にデータがあった場合、
他方のセクタにデータを書き込むと同時に、一方のセク
タのデータを消去する。これにより、書き込み速度を向
上することができる。 (8) 図4に示す記憶装置において、書き込みするセクタ
にデータがある場合、データを一次記憶装置1cに転送
している間に、上記セクタのデータを消去し、データの
消去完了後、もしくは、データ転送の終了後、上記セク
タにデータを書き込む。これにより書き込み速度を向上
することができる。 (9) 図4に示す記憶装置において、不良なセクタを代替
する予備の領域1b−1,1b−2と、書き込みセクタ
を管理する書き換え可能なデコード・テーブル1dを設
け、不良なセクタが発生したとき、上記デコード・テー
ブル1dを書き換えることにより、予備の領域1b−
1,1b−2に書き込みセクタを変更し、予備の領域1
b−1,1b−2がなくなつたとき、デコード・テーブ
ル1dを書き換えてセクタを再構成するようにしたの
で、不良セクタ発生時の救済を行うことができる。 (10)図4に示す記憶装置において、N個のセクタ番号に
対してN+1個のセクタを設けるとともに、N+1個の
各セクタをN個のセクタ番号で共有し、データをセクタ
へ書き込む際、データをN+1個のセクタの内の空いて
いるセクタに書き込む。これにより、書き込み速度を向
上することができるとともに、余分に用意するセクタの
数を少なくすることができ、コストダウンを図ることが
できる。また、不良なセクタを代替する予備の領域1b
−1,1b−2を設け、不良なセクタが発生したとき、
デコード・テーブル1dを書き換え、予備の領域1b−
1,1b−2に書き込みブロックあるいはセクタを変更
するようにしたり、デコード・テーブル1dを再編成す
る。これにより、不良セクタ発生時の救済を行うことが
できる。 (11)記憶領域1aが複数に分割されており、分割された
チップ内に複数のブロックが設けられ、チップ内のブロ
ックにデータを書き込む際、新たなブロックにデータを
書き込み、書き込んだデータがチップ内に既に存在して
いる場合には、そのデータをブロック単位で消去する記
憶装置において、データを書き込むチップを、書き込む
データに対応させて固定する。これにより、制御手段1
bは各チップ内のデータのみを管理すればよく、全領域
を管理する必要がない。このため、制御手段1bにおけ
る管理テーブルを簡単にすることができ、書き込み速度
を向上させることができる。また、各チップ内にデータ
を書き込むための複数のワークブロックを設けることに
より、ワークブロックに不良が発生した場合に、不良と
なったワークブロックを救済することができる。 【0007】本発明の請求項1の発明は、上述の読み書
きが可能で、かつ、記憶領域の一部が破壊する可能性の
ある記憶領域1aと、記憶領域1a中のデータが記憶さ
れている場所を示す書き換え可能なデコーダ1dとを備
えた記憶装置において、図4に示すようにデコーダを2
段設け、記憶装置1の記憶領域1aの一部が破壊したと
き、2次デコード部のアドレスを書き換えて、破壊した
部分へのデコードを行われないようにし、2次デコード
部が破壊したとき、1次デコード部を書き換えて、破壊
した部分へのデコードを行われないようにしたので、デ
コーダとして、EEPROM、フラッシュメモリ等のそ
の一部が破壊する可能性のある記憶媒体を用いた場合に
おいても、アドレスがエラーとなる確率を著しく減少さ
せることができ、信頼性を確保することができる。 【0008】 【実施例】次に、本発明の実施例を説明する。 A.本発明の前提となる記憶装置の構成。 図5は本発明の前提となるフラッシュ・メモリを使用し
た記憶装置の構成を示すブロック図である。同図におい
て、20は例えばメモリ・カード等の記憶装置、21は
フラッシュ・メモリのデータの書換え、消去等を制御す
るコントローラLSI、22はプロセッサ、23は各種
テーブルを格納したり、データの書き込み時のデータ・
バッファあるいは退避バッファとして使用されるSRA
M、24はクロック発振器、25−1〜25−5はフラ
ッシュ・メモリである。同図において、本体よりSRA
M23に転送されたデータをフラッシュ・メモリ25−
1〜25−5に書き込む際、前記したようにフラッシュ
・メモリは上書きができないので、データを書き込み場
合には、新たな領域にデータを書き込む。また、データ
更新の場合には、旧データに消去フラグを立てる等の措
置を講ずる。そして、旧データに消去フラグが立てられ
ている場合には、所定の時期に、消去フラグが付されて
いないデータのみを所定の単位でSRAM23の退避領
域に退避し、フラッシュ・メモリの書き込むべき領域を
消去したのち、データを書き戻すことによりデータの整
理を行う。 【0009】図6は上記したSRAM23の内容を示す
図であり、同図に示すように、SRM23には下記のデ
ータが格納される。 (1) 消去回数テーブル フラッシュ・メモリの各ブロックの消去回数を保持して
いる。 (2) 消去可能セクタ数テーブル 各ブロックの消去可能セクタ・フラグの立っている総数
値を保持する。 (3) 書き込みポインタ フラッシュ・メモリに書き込みを開始するチップNo. ,
ブロックNo. ,セクタ・アドレスNo. を保持する。 (4) WORK−BLOCK−No. 現在のWORK−BLOCK−No. を示し、チップNo.
,ブロックNo. を保持する。 (5) 整理ポインタ 現在、整理をしているチップNo. ,ブロックNo. ,セク
タ・アドレスNo. を保持する。 (6) 書き換え有無 現在、書き込みするデータが新規であるかどうかを示
す。 (7) 書き込み回数 整理時の本体書き込み回数を管理する。 (8) 退避カウンタ 整理時の退避動作のセクタ数を管理する。 (9) チップ数 カードの搭載フラッシュ−チップ数を保持する。 (10)セクタマップ・テーブル 論理アドレスの変換用にチップNo. ,ブロックNo. ,セ
クタ・アドレスNo. を保持する。 【0010】図7、図8はフラッシュ・メモリ25−1
〜25−5の内容を示す図であり、フラッシュ・メモリ
の各セクタには、次の(1) から(5) に示す制御情報、デ
ータ等が格納されている。なお、この例においては、セ
クタが126設けられており、各セクタには、(1) から
(5) の管理情報等とデータが格納され、126番目のセ
クタの後に、次の(6) から(14)の管理情報等が格納され
ている。 (1) 不良フラグ このセクタの状態を示し、使用不可の場合に、ここに書
き込みを行う。 (2) 消去フラグ このセクタのデータの状態を示し、書き換え等で無効に
なった場合に、ここに書き込みを行う。 (3) 論理アドレス このセクタの論理アドレスを示す。 (4) データ このセクタに書き込まれたデータ。 (5) チェックサム 書き込んだデータのチェックサム (6) 不良セクタ・メモリ 整理対象ブロックの中の不良セクタを示す。 (7) 整理元消去回数 整理対象ブロックの消去回数。 (8) 退避ブロックNo. データを退避してくるチップNo. ,ブロックNo. (9) 消去Start 整理対象ブロックの消去を開始する時に立てる。 (10)消去End 整理対象ブロックの消去を終了するときに立てる。 (11)All Erase対象 All Erase時に消去対象として確定した時に立
てる。 (12)空きブロック ブロック内にデータがあるかを示し、データがある場合
に立てられる。 (13)ブロック・ステータス このブロックの状態を示し、使用不可になった場合に立
てる。 【0011】図9ないし図13はフラッシュ・メモリ2
5−1から25−5へのデータ書き込み時のプロセッサ
22における処理を示すフローチャートであり、同図を
参照して書き込み時の動作を詳細に説明する。図9のス
テップS1において、SRAM23の、現在書き込みを
するデータが新規であるか否かを示す「書き換えの有
無」(図6参照)を0として、ステップS2において、
整理中であるか否かを判別する。整理中でない場合に
は、ステップS5に行き、SRAM23の、整理時の本
体書き込み回数を管理する「書き込み回数」を0にしス
テップS7に行く。また、整理中の場合には、ステップ
S3に行き、「書き込み回数」に1を加え、ステップS
4において、書き込み回数が6であるか否かを判別す
る。書き込み回数が6の場合には、ステップS6に行
き、書き込み回数を1にする。また、書き込み回数が6
でない場合には、ステップS7に行く。上記処理は、後
述するように、書き込み回数が2〜5の場合には整理動
作を行わないようし、書き込み回数が1の時のみ整理動
作を行うことにより、頻繁な整理動作を避けるためであ
り、上記のように書き込み回数を設定することにより、
5回に1回整理動作を行うこととなる。ステップS7に
おいて、書き込むデータの論理アドレスがオーバーして
いるか否かを判別し、オーバーしている場合には、エラ
ー処理を行う。論理アドレスがオーバーしていない場合
には、ステップS8に行き、旧データかあるか否か、す
なわち、現在書き込むデータが新規なデータであるか否
か判別し、新規なデータでない場合には、ステップS9
において、SRAM23の「書き換えの有無」を1にし
てステップS11に行く。また、新規なデータの場合に
は、ステップS10において、SRAM23の「書き換
えの有無」を0にしてステップS11に行く。ついで、
ステップS11において、本体からデータをSRAMに
転送し、ステップS12において転送エラーがあるか否
かを判別する。転送エラーがある場合にはエラー処理を
行う。転送エラーがない場合には、図10のステップS
13に行き、書き換えの有無、すなわち、新規データで
あるかどうか判別し、新規データでない場合には、デー
タの更新であるので、ステップS14において旧データ
のあるセクタに消去ビットを書き込み、ステップS15
に行く。 【0012】ステップS15において、SRAM23の
整理時の書き込み回数を管理する「書き込み回数」が1
であるか否かを判別し、「書き込み回数」が1の場合に
は、ステップS16以降でフラッシュ・メモリの整理を
行う。また、「書き込み回数」が1でない場合には、図
13のステップS46に行き、ステップS46以降で、
SRAM23のデータをフラッシュ・メモリへ書き込
む。ステップS16において、SRAM23上の整理時
における退避動作のセクタ数を管理する「退避カウン
タ」を0にして、ステップS17において、現在整理を
しているセクタアドレスNo. を示す「整理ポインタ」
(セクタアドレス)が126セクタより多いか否かを判
別し、126より小さくない場合には、整理が終了した
ものとして、図12のステップS38に行く。また、
「整理ポインタ」(セクタアドレス)が126セクタよ
り少ない場合には、ステップS18に行き、整理ポイン
タが0であるか否かを判別し、整理ポインタが0でない
場合にはステップS22に行く。 【0013】整理ポインタが0の場合には、ステップS
19において、各ブロックの消去回数や消去可能セクタ
数をSRAM23のテーブルから求め、それをもとにし
て、整理対象を選択する。ついで、ステップS20にお
いて、フラッシュ・メモリ上のWORK−BLOCKの
退避ブロックNo. (図8参照)に整理対象のチップNo.
,ブロックNo. を書き込む。ステップS21におい
て、書き込みエラーがあるか否か判別し、書き込みエラ
ーがある場合には、エラー処理を行い、書き込みエラー
がない場合には、ステップS22に行く。ステップS2
2において、退避するデータを検索する。すなわち、フ
ラッシュ・メモリのデータに消去フラグ(図7参照)が
書き込まれている場合には、次のセクタに行く。また、
論理アドレスが無い場合には消去フラグを書き込み、次
のセクタに行き、論理アドレスが異常のものは消去フラ
グと不良フラグを書き込み、次のセクタに行く。 【0014】次いで、図11のステップS23に行き、
書き込みエラーがあるか否かを判別し、書き込みエラー
がない場合には、ステップS24において、整理ポイン
タ(セクタアドレス)が126番目のセクタを指してい
るか否かを判別し、整理ポインタが126である場合に
は、整理が終わったものとして、図12のステップS3
8に行く。整理ポインタが126でない場合には、ステ
ップS25に行き、退避するデータをフラッシュ・メモ
リからSRAM23に移動し、ステップS26におい
て、生成したチェックサムがフラッシュ・メモリ上のチ
ェックサム(図7参照)と一致するか否かを判別する。
一致しない場合には、ステップS27において、チェッ
クサムがFFhであるか否かを判別する。そして、チェ
ックサムがFFhでない場合には、ステップS28にい
き、フラッシュ・メモリ上のチェックサムをFFhと
し、データ退避元のセクタの不良フラグを書き込み、ス
テップS29に行く。ステップS29において、書き込
みエラーが有るか否か判別し、ステップS30に行く。
また、ステップS26において、チェックサムが一致す
るか、S27において、チェックサムがFFhの場合に
は、ステップS30に行き、書き込みポインタが示すセ
クタから書き込めるセクタを探し、ステップS31にお
いて、書き込み可能セクタがあるか否かを判別する。書
き込み可能セクタがない場合には、エラー処理を行い、
書き込み可能セクタがある場合には、ステップS32に
行き、SRAM23上のデータをフラッシュ・メモリに
移動する。 【0015】ステップS33において、書き込みエラー
が有るか否かを判別し、書き込みエラーがある場合に
は、ステップS30に戻る。書き込みエラーがない場合
には、図12のステップS34に行き、データ退避元の
セクタの消去フラグを書き込む。そして、ステップS3
5において、書き込みエラーがあるか否かを判別し、書
き込みエラーがない場合には、ステップS36におい
て、SRAM23上のセクタマップテーブルを書き換え
るとともに、退避カウンタに1を加える。ついで、ステ
ップS38において、退避動作が予め定められた所定回
数(この場合には60回)行われたか否かを判別し、退
避動作が60回になった場合には、ひとまずフラッシュ
メモリの整理を終えてステップS38に行く。また、退
避動作が60回になっていない場合には、図10のステ
ップS22に戻り上記処理を繰り返す。 【0016】退避カウンタが60になっているか、前記
した図10のステップS17において、整理ポインタが
126より小さくないと判別された場合には、ステップ
S38に行き、退避カウンタが0であるか否か判別す
る。そして、退避カウンタが0である場合、つまり、整
理ポインタが126より小さくない場合であって、か
つ、退避動作が行われていない場合には、ステップS3
9に行き、ステップS39以降で、不良フラグの情報を
不良セクタメモリに書き込む等の処理を行う。すなわ
ち、退避カウンタが0である場合には、処理時間が短か
かったので、S39以降の不良フラグの情報を不良セク
タメモリに書き込む等の処理を行い、また、退避カウン
タが0でない場合には、図13のステップS46に行
き、SRAM23上のデータをフラッシュ・メモリに移
動する等の処理を行う。 【0017】ステップS39において、退避したブロッ
クの不良フラグの情報を書き込み先(書き込み先はWO
RK−BLOCK)の不良セクタ・メモリ(図8参照)
に書き込み、また、消去回数を整理元消去回数欄(図8
参照)に書き込む。ステップS40において、書き込み
エラーがあるか否かを判別し、書き込みエラーがない場
合には、ステップS41に行き、整理したブロックを消
去する。ステップS42において、消去エラーがあるか
否か判別し、消去エラーがない場合には、図13のステ
ップS43に行き、消去したブロックに不良セクタメモ
リから不良フラグ情報を戻し、整理元消去回数に1を加
えて、消去回数に書き込む。ついで、ステップS44に
おいて、消去したブロックに対応するテーブルの消去回
数に1を加え、消去可能セクタ数を0にする。ステップ
S45において、整理ポインタをWORK−BLOCK
に入れ、整理ポインタを0とする。 【0018】次にステップS46に行き、書き込みポイ
ンタの示すセクタから書き込めるセクタを探し、ステッ
プS47において書き込み可能セクタが有るか否かを判
別する。書き込み可能セクタがある場合には、ステップ
S48に行き、SRAM23上のデータをフラッシュ・
メモリに移動し、ステップS49において、書き込みエ
ラーがあるか否かを判別する。書き込みエラーが有る場
合には、ステップS46に戻り、書き込みエラーがない
場合には、ステップS50に行く。ステップS50にお
いて、書き換え有無が1であるか否か、すなわち、書き
込みするデータが新規であるか否か判別し、書き換えの
有無が1の場合には、ステップS51で消去フラグを書
き込んだセクタに対応する消去可能セクタ数テーブル
(図6参照)の値に1を加え、ステップS52に行く。
ステップS50において、書き換え有無が0である場合
には、ステップ52において、セクタマップテーブル
(図6参照)を書き換え、ステップS53において、次
の書き込みに備えて、書き込みポインタの示すセクタか
ら書き込めるセクタを探しておき終了する。 【0019】B.書き込み/消去処理。 前記したように、フラッシュ・メモリは、消去回数に制
限があり、全てのメモリを有効に活用するためには、消
去回数を平均化する必要がある。また、フラッシュ・メ
モリは上書きをすることができず、データを書き換える
場合には、新たなセクタにデータを書き込んで、旧デー
タに消去可能フラグを立ておくなどの措置を講じ、適宜
の時点で消去可能フラグが立っているセクタを消去する
必要がある。このため、消去可能なデータを消去してデ
ータを書き込むための空き領域を確保する必要があると
ともに、上記空き領域が、不良ブロックが発生するなど
の原因により使えなくなったとき、救済措置を講じて新
たな空き領域を作成する必要がある。以下に、上記した
消去回数の平均化(実施例1)、消去可能なデータを消
去して空き領域を確保する空き領域の作成(実施例
2)、不良ブロック発生時の空き領域作成のための救済
措置(実施例3)等の領域処理についての本発明の実施
例を示す。 【0020】(1)実施例1(消去回数の平均化) 前記したように、フラッシュ・メモリは、消去回数に制
限があり、全てのメモリを有効に活用するためには、消
去回数を平均化する必要がある。本実施例は、各ブロッ
クの消去回数を意識することなく、消去回数のバラツキ
を抑えることが可能な実施例を示しており、本実施例に
おいては、セクタ単位で追記書き込み、ブロック単位で
消去するメモリにおいて、ブロックをセクタ単位で区切
り、以下に示すように、消化可能なセクタが多いブロッ
クと、消去可能なセクタが少ないブロックとを混ぜ合わ
せて新しいブロックに書き込むことにより、消去回数を
平均化している。次に本実施例について説明する。図1
4ないし図18は本実施例における書き込み処理を示す
図であり、本実施例においては、6セクタを持つ6ブロ
ックのフラッシュ・メモリにAからOの論理セクタを書
き込む例を示している。また、以下の説明においては、
ブロック内の空きセクタの数がN個(本実施例では2
個)になった場合にM個のブロック(本実施例では2
個)に退避動作を行うこととし、また、消去可能セクタ
数が多い方からmブロック(本実施例では1ブロック)
と消去可能セクタの少ない方からnブロック(本実施例
では1ブロック)を選択して、同時に退避する。なお、
退避動作を行う場合には、前記したように、消去可能フ
ラグが立っていないセクタを読み出して、図5に示すS
RAM23に移動し、ついで、SRAM23に移動した
セクタを新たなブロックに書き込む。 【0021】図14の(a)において、同一のセクタが
ないので、ブロック1とブロック2にセクタA,B,
C,D,E,F,G,H,Iを、最初のセクタから順番
に書き込む。(b)において、セクタC,Dを書き込
む。この場合には、同一のセクタC,Dがあるので、既
にC,Dが書き込まれているセクタに消去可能フラグを
立て、新しいセクタC,Dを書き込む。ついで、図15
の(c)において、セクタJ,K,L,M,N,Oを書
き込む。この場合にも、(a)の場合と同様、同一のセ
クタがないので、既に書き込まれたセクタの後に順番に
書き込む。(d)において、セクタH,I,J,K,
M,Nを書き込む。同一セクタが書き込まれているの
で、消去可能フラグを立て、新しいセクタH,I,J,
K,M,Nを書き込む。 【0022】図16(e−1),(e−2)において、
セクタC,Dを書き込む。その際、空きブロックの数が
2個になっているので、退避動作を行う。すなわち、図
15の(d)において、消去可能なセクタが最も多いブ
ロック3と、消去可能セクタが最も少ないブロック4を
選択し、ブロック3のセクタとブロック4のセクタを混
在させ、退避先の各ブロックのセクタ数が均一になるよ
うに、空きブロック5と6に書き込む。その結果、図1
6(e−1)に示すように、セクタO,I,K,Mがブ
ロック5に、また、セクタH,J,L,Nがブロック6
に書き込まれ、ブロック3と4が空きブロックとなる。
この状態で、既にC,Dが書き込まれたブロック2に消
去可能フラグを立て、セクタC,Dを図16(e−2)
に示すようにブロック5に書き込む。 【0023】図17(f−1)において、セクタH,
I,Jを書き込む。この場合にも、同一のセクタが既に
あるので、ブロック5とブロック6に消去可能フラグを
立て、ブロック6にセクタH,Iを書き込むが、セクタ
Jを書き込む時点で空きブロックが2個になったので、
前記と同様退避動作を行う。すなわち、(f−2)に示
すように、消去可能なセクタが最も多いブロック2と、
消去可能セクタが最も少ないブロック6を選択し、ブロ
ック2のセクタとブロック6のセクタを混在させ、退避
先の各ブロックのセクタ数が均一になるように、空きな
ブロック3と4に書き込む。ついで、(f−3)に示す
ように、セクタJを書き込む。この場合にも同一セクタ
があるので、既に書き込まれているブロック4のセクタ
に消去可能フラグを立て、ブロック3にセクタJを書き
込む。 【0024】図18(g)において、セクタE,F,G
を書き込む。この場合にも同一セクタがあるので、既に
書き込まれているブロック1,3のセクタに消去可能フ
ラグを立て、ブロック3と4にセクタE,F,Gを書き
込む。図19は本実施例の処理を示すフローチャートで
あり、同図により本実施例の処理について説明する。ス
テップS1において、本体よりデータを受け取ると、ス
テップS2のおいて、空きセクタ有りのブロック数がN
以下であるか否か判別する。空きセクタ有りのブロック
数がN以下でない場合には、ステップS7に行く。空き
セクタ有りのブロック数がN以下の場合には、ステップ
S3において、消去可能セクタ数が多いブロックからm
ブロックを退避対象とし、ステップS4において、消去
可能セクタ数が少ないブロックからnブロックを退避対
象とする。ステップS5において、退避対象のブロック
からデータを空きブロックに移動する。その際の書き込
み方は、データを移動する毎に書き込みブロックを変
え、M個のブロックに書き込んだら最初に書き込んだブ
ロックに戻る。ついで、ステップS6において、退避対
象のブロックを消去する。ステップS7において、同一
論理セクタがあれば、既に書き込まれている物理セクタ
に消去可能フラグを立て、ステップS8において、本体
から受け取ったデータをフラッシュ・メモリに書き込
む。 【0025】ところで、一般にセクタには、システム・
プログラムのように殆ど書き換えが行われないデータを
格納したセクタと、常時書き換えが行われるデータを格
納したセクタがあり、普通にデータの書き込み/退避を
おこなっていると、殆ど書き換えが行われないセクタが
多いブロックは消去回数が少なくなる。したがって、上
記のように、消去可能なセクタが多いブロック(常時書
き換えが行われるセクタが多いブロック)と、消去可能
なセクタが少ないブロック(殆ど書き換えが行われない
セクタが多いブロック)とを混ぜ合わせて新しいブロッ
クに書き込むことにより、結果的に各ブロックに書き換
えが多いセクタと書き換えが少ないセクタが混在するこ
ととなり、ブロックの消去回数を平均化することができ
る。本実施例においては、上記のような原理に基づき書
き込み処理をおこなっているので、各ブロックの消去回
数を意識することなく、消去回数のバラツキを抑えるこ
とができ、フラッシュ・メモリのように消去回数が有限
なメモリの寿命を延ばすことが可能となる。また、消去
回数をカウントすることなく消去回数のバラツキを抑え
ることができるので、消去回数をカウントするための領
域を設けることなく、メモリの管理を行うことも可能と
なる。 【0026】(2)実施例2(消去可能データの消去に
よる空き領域の作成) 前記したように、フラッシュ・メモリは上書きをするこ
とができず、消去した後でなければ書き込みを行うこと
ができない。このため、書き込み時、同一のセクタがあ
る場合には消去可能フラグを立て、適宜の時点で消去可
能フラグが立っているセクタを消去する必要がある。本
実施例は、上記のように、消去フラグがたっている消去
可能なデータを記憶媒体上からなくすための領域処理を
示しており、本実施例による領域処理を処理の空き時間
などに予め行っておくことにより、書き込みできる領域
を確保でき、書き込み時間を短縮することができる。 【0027】図20から図23は本実施例における書き
込み/消去処理を示す図であり、同図により本実施例を
説明する。なお、本実施例においては、次の点を前提と
している。 ブロック数が6個で、1ブロックあたり、6個のセ
クタがあり、リード/ライトはセクタ単位で行い、消去
はブロック単位で行う。 書き込み方式は追記書き込み方式であり、同じアド
レスの論理セクタを書き込むときは、旧論理セクタに格
納されている物理セクタに消去可能フラグを立てる。 追記のために書き込み領域を5ブロック+退避領域
1ブロック(ブロック1〜ブロック6)とする。 書き込み領域がなくなった場合には、消去可能フラ
グが立っている物理セクタが一番多いブロックの消去不
可の物理セクタのデータを退避領域に移動して、移動元
のブロックを消去する。そして、そのブロックを退避領
域として使用し、今までの退避領域を書き込み領域とす
る(この一連の動作を退避動作と呼ぶ)。 本体から送られて来るセクタのアドレスはAからP
とする。 ブロック中に消去可能なデータがm以上あるとき、
本実施例における領域処理の対象とする(図20から図
23の例においては、m=1としている)。なお、図2
0から図23中のブロックの右に付された矢印は書き込
み場所を示す書き込みポインタの位置である。 【0028】図20(a)において、論理セクタA〜G
を書き込む。この場合には、同一アドレスの論理セクタ
がないので、書き込みポインタが指す位置から順番に書
き込む。(b)において、論理セクタA,D〜Gを書き
込む。この場合には、同アドレスの論理セクタ(A,
D,E,F,G)があるので、消去可能フラグを立てた
後に、(a)と同様に書き込む。(c)において、論理
セクタH〜Nを書き込む。この場合には、同一アドレス
の論理セクタがないので、そのまま書き込む。図21
(d)において、A,G〜Lを書き込む。この場合に
は、同アドレスの論理セクタ(A,G,H,I,J,
K,L)があるので、消去可能フラグを立てた後に書き
込む。(e)において、A,H〜Jを書き込む。この場
合にも、同アドレスの論理セクタ(A,H,I,J,)
があるので、消去可能フラグを立てた後に書き込む。
(f−1)において、A,I〜Lの書き込みを行おうと
するが書き込み領域がないので、退避動作をを行う。す
なわち、消去可能フラグが立っている物理セクタが一番
多いブロック(ブロック3)のデータを退避領域(ブロ
ック6)に移動して、移動元のブロックを消去する。そ
して、そのブロック(ブロック3)を退避領域として使
用し、今までの退避領域(ブロック6)を書き込み領域
とする。その結果、(f−1)のようになる。 【0029】ついで、図22(f−2)に示すように、
A,I〜Lを書き込む。この場合には、同アドレスの論
理セクタがあるので、消去可能フラグを立てた後にA,
I〜Lを書き込む。この時、書き込みポインタは退避領
域(ブロック6)の先頭にある。以上のよう書き込むこ
とにより、消去可能なデータを増えたので、本実施例に
よる領域処理を行う。すなわち、退避領域(ブロック
3)から見て、書き込み方向に対して一つ反対方向のブ
ロック(ブロック2)を処理対象として、ブロック2と
3で退避動作を行う。その結果、図22(g−1)に示
すように、ブロック2が退避領域となり、ブロック3に
ブロック2の消去不可のデータが移される。次に上記と
同様に、ブロック1とブロック2で退避動作を行う。そ
の結果(g−2)に示すように、ブロック1が退避領域
となり、ブロック2にブロック1の消去不可のデータが
移される。 【0030】ついで、上記と同様にブロック5と1で退
避動作を行う。その結果、図23(g−3)に示すよう
に、ブロック5が退避領域となり、ブロック1にブロッ
ク5の消去不可のデータが移される。なお、ブロック6
には消去可能のデータがないので、領域処理の対象とし
ない。同様にブロック4と5で退避動作を行う。その結
果、(g−4)に示すように、ブロック4が退避領域と
なり、ブロック5にブロック4の消去不可のデータが移
される。そして、退避領域の位置が処理を行う前の退避
領域の位置まできたので、領域処理を終わる。以上のよ
うな処理を行うことにより、消去可能データは記憶媒体
上からなくなる。次に(h)に示すように、A,H〜J
を書き込む。この場合にも、同アドレスの論理セクタが
あるので、消去可能フラグを立てたのち書き込む。 【0031】図24は本実施例の処理を示すフローチャ
ートであり、同図により本実施例の処理を説明する。ス
テップS1において、現在の退避領域のブロックNo. を
記憶し、ステップS2において、退避領域を処理対象と
する。ステップS3において、処理対象を書き込み方向
とは反対方向に一つ進める。ステップS4において、処
理対象とステップS1において保存した保存ブロックN
o. を比較し、同じであれば処理を終了する。処理対象
と保存ブロックNo. が異なる場合には、ステップS5に
行き、処理対象の消去可能セクタ数を所定値mと比較
し、消去可能セクタ数がm以下の場合には、ステップS
3に戻り、上記処理を繰り返す。消去可能セクタ数がm
より大きい場合には、ステップS6に行き、処理対象を
退避対象として、ステップS7において、書き込みポイ
ンタを退避領域の先頭に移動する。ステップS8におい
て、退避対象のブロックからデータを移動する。ステッ
プS9において、退避対象のブロックを消去し、ステッ
プS10において、退避対象のブロックを退避領域と
し、ステップS3に戻り上記処理を繰り返す。 【0032】本実施例においては、上記のようにして領
域処理を行っているので消去可能データを無くすことが
でき、本実施例の領域処理を予めおこなっておくことに
より、書き込み時間の短縮を図ることができる。また、
領域処理の対象となるブロックを書き込み方向とは反対
方向に進めているので、書き込み場所を示している書き
込みポインタと退避領域の間に全ての空き領域を存在さ
せることができる。その結果、どのような場合に処理の
中断がおこっても、書き込みポインタの示す位置からデ
ータを書き込んで行くことができ、処理中断後に必要と
する処理を少なくすることができ、また、処理を全てお
えていなくても、支障がない。 【0033】(3)実施例3(空き領域の作成のための
救済措置) 前記したように、フラッシュ・メモリはデータ書込みの
ため、メモリ中に空き領域を確保しておく必要がある
が、本実施例は、上記空き領域が、不良ブロックが発生
するなどの原因により使えなくなったとき、救済措置を
講じて新たな空き領域を作成する実施例を示している。
図25から図31は本実施例の空き領域の作成処理を示
す図であり、同図により本実施例を説明する。なお、本
実施例においては次の点を前提としている。 ブロック数が7個で、1ブロックあたり、6個のセ
クタがあり、リード/ライトはセクタ単位で行い、消去
はブロック単位で行う。 書き込み方式は追記書き込み方式であり、同じアド
レスの論理セクタを書き込むときは、旧論理セクタに格
納されている物理セクタに消去可能フラグを立てる。 障害時の救済用に1ブロックの予備領域(ブロック
0)を確保し、追記のために書き込み領域を5ブロック
+退避領域1ブロック(ブロック1〜ブロック6)とす
る。 書き込み領域がなくなった場合には、消去可能フラ
グが立っている物理セクタが一番多いブロックの消去不
可の物理セクタのデータを退避領域に移動して、移動元
のブロックを消去する。そして、そのブロックを退避領
域として使用し、今までの退避領域を書き込み領域とす
る(この一連の動作を退避動作と呼ぶ)。 本体から送られて来るセクタのアドレスはAからP
とする。 【0034】図25(a)において、セクタA〜Gを書
き込む。この場合には、同じ論理セクタがないので、そ
のまま、ブロック1から書き込む。(b)において、セ
クタA,D〜Gを書き込む。この場合には、セクタA,
D〜Gと同一論理セクタがあるので、同一の論理セクタ
に消去可能フラグを立てたのち書き込む。(c)におい
て、セクタH〜Nを書き込む。この場合には、同じ論理
セクタがないので、そのまま書き込む。図26(d)に
おいて、セクタA,G〜Lを書き込む。この場合、セク
タA,G〜Lと同一論理セクタがあるので、同一の論理
セクタに消去可能フラグを立てたのち書き込む。(e)
において、セクタA,H〜Jを書き込む。この場合、セ
クタA,H〜Jと同一論理セクタがあるので、同一の論
理セクタに消去可能フラグを立てたのち書き込む。 【0035】図27(f−1)において、セクタA,I
〜Lを書き込むが、この場合には、書き込み領域がない
ので、退避動作を行った後書き込み処理を行う。すなわ
ち、消去可能フラグが立っているデータが最も多いブロ
ック(ブロック3)の消去可能でないデータを退避領域
(ブロック6)に移動して、移動元のブロックを消去す
る。そして、そのブロック(ブロック3)を退避領域と
して使用し、今までの退避領域を書き込み領域とする。
ついで、(f−2)において、セクタA,I〜Lを書き
込み領域となったブロック6に書き込む。次に、(g)
において、A,M,Nを書き込みを行うが、上記(f)
と同様書き込み領域がないので、まず、退避動作を行
う。すなわち、消去可能フラグが立っているデータが最
も多いブロック(ブロック5)の消去可能でないデータ
を退避領域(ブロック3)に移動して、移動元のブロッ
クを消去する。そして、そのブロック(ブロック5)を
退避領域として使用し、今までの退避領域を書き込み領
域とする。ここで、ブロック5が消去失敗により使用不
可となったとすると、退避領域がなくなるので救済措置
を行う。 【0036】そこで、図28(h)に示すように、予備
ブロック0を仮の退避領域として退避動作を行う。すな
わち、図27(g)において、消去可能でないデータが
最も多いブロック(ブロック1)の消去可能でないデー
タを仮の退避領域(ブロック0)に移動して、移動元の
ブロックを消去する。そして、そのブロック(ブロック
1)を退避領域として使用する。ついで、(i)に示す
ように、予備ブロック(ブロック0)の退避動作を行
う。すなわち、仮の退避領域として用いた予備領域(ブ
ロック0)の論理セクタB,Cをブロック3に移動す
る。これで、予備領域と退避領域が作成されたので、
(j)において、論理セクタA,M,Nをブロック3に
書き込む。次に、セクタA,G,H,O,Pを書き込も
うとするが、書き込み領域がないので、図29(k−
1)に示すように退避動作を行う。すなわち、消去可能
なデータが最も多いブロック(ブロック4)の消去可能
でないデータを退避領域(ブロック1)に移動して、移
動元のブロックを消去する。そして、そのブロック(ブ
ロック4)を退避領域として使用する。ついで、(k−
2)に示すように、セクタA,G,H,O,Pを書き込
むが、セクタA,G,Hについては同じアドレスの論理
セクタがあるので、消去フラグを立てたのちブロック1
に書き込み、セクタO,Pについては、そのまま、書き
込む。 【0037】次に、(l)において、セクタAを書き込
もうとするが、書き込み領域がないので、退避動作を行
う。その結果、ブロック2が退避領域となり、ブロック
2にあったセクタD,E,Fがブロック4に移動する。
ここで、ブロック2が消失失敗で使用不可になったとす
ると、退避領域がなくなるので、救済措置を行う。すな
わち、消去可能なデータが最も多いブロック(ブロック
3)のデータを仮の退避領域(ブロック0)に移動し
て、移動元のブロックを消去する。そして、そのブロッ
ク(ブロック3)を退避領域として使用する。その結
果、図30(m)に示すようになる。なお、この状態
で、電力不足などにより、処理に一旦ストップをかけた
すると、処理を再開したとき、装置側は予備領域に消去
可能なセクタがなく、データがあるので、空き領域作成
中と判断できる。続いて、空き領域作成のための救済措
置を行い、ブロック6のセクタI,Jを予備領域(ブロ
ック0)に移動し、ブロック6のセクタK,Lをブロッ
ク3に移動する。その結果図30(n)に示すようにな
る。 【0038】ここで、退避領域のセクタを除いた空きセ
クタ数が、予備領域(ブロック0)にあるデータの数以
上なので、書き込みポイントを退避領域の後ろから検索
し、空いている領域に、予備領域(ブロック0)からデ
ータを移動する。その際、図31(o)に示すように、
予備領域(ブロック0)のセクタB,C,M,Nを移動
した段階で、本体側が電力不足等により一旦処理にスト
ップをかけたとする。この場合には、処理を再開した時
に、装置側は予備領域に消去可能なセクタがあるので、
空きブロック作成中の予備領域のデータ移動中と判断で
きる。続いて、図31(p)に示すように、予備領域
(ブロック0)の論理セクタI,Jをブロック4に移動
して処理を終了する。 【0039】図32は本実施例における空き領域作成処
理を示すフローチャートであり、同図により、本実施例
の処理を説明する。ステップS1において、予備領域に
消去可能セクタが有るか否かを判別し、ある場合には、
ステップS11に行く。ない場合には、ステップS2に
行き、書き込みポインタを予備領域の先頭とし、ステッ
プS3において予備領域にデータがあるか否かを判別す
る。予備領域にデータがある場合には、ステップS10
に行き、ない場合にはステップS4に行き、退避領域を
予備領域とする。ステップS5において、書き込み領域
の各ブロックに消去可能セクタがない場合には、空き領
域を作成できないので処理を放棄(Abort )する。消去
可能セクタがある場合には、ステップS6に行き、消去
可能セクタの一番多いブロックを退避対象とし、ステッ
プS7において、退避対象のブロックからデータを予備
領域に移動する。 【0040】ステップS8において退避対象となるブロ
ックを消去し、ステップS9において、退避対象のブロ
ックを退避領域にする。ステップS10において、予
備領域のデータ数が退避領域以外の空きセクタ数より
多いか否か判別し、>の場合には、ステップS5に
戻り、上記処理を繰り返す。また、≦の場合には、
ステップS11に行き、書き込みポインタを退避領域の
次から書き込み方向に対して検索し、ステップS12に
おいて、空きセクタに予備領域からデータを移動する。
ステップS13において、予備領域を消去して終了す
る。本実施例においては、上記のように空き領域を作成
しているので、記憶媒体中に使用不可のブロックが発生
しても、救済措置により空き領域を作成することがで
き、記憶装置して使用不可能となることを避けることが
できる。また、処理途中で、本体側の電力不足などによ
り処理が中断しても、どの段階で処理が中断したかを容
易に判断することができ、処理中断における処理段階の
判断を単純化することが可能となる。 【0041】C.消去処理の効率化 フラッシュ・メモリは前記したように上書きをすること
ができず、消去した後でなければ書き込みを行うことが
できない。本実施例は、上記のようなフラッシュ・メモ
リにおいて、書き込み有無を示すフラグと、全空間消去
処理を実行中であることを示す実行中フラグを設けるこ
とにより、全記憶空間を消去する際の消去処理を効率良
く行うとともに、消去中に何らかの原因で処理が中断さ
れた場合においても、処理再開をすることができる実施
例を示している。次に図33、図34により本実施例の
処理を説明する。なお、本実施例においは、ブロック数
は6個とし、各ブロックに書き込みフラグを書き込む領
域を設け、ブロック6に全空間消去処理を実行中である
ことを示す実行中フラグを書き込む領域を設けている。
図33(a)において、ブロック1,2,4の書き込み
前に、ブロック1,2,4に書き込み有無フラグを書き
込む。ついで、全空間をクリアする初期化処理に当た
り、(b−1)に示すように、ブロック6に実行中フラ
グを書き込む。(b−2)において、書き込み有無フラ
グが書き込まれたブロック1を消去し、書き込む有無フ
ラグを消す。 【0042】図33(b−3)において、書き込み有無
フラグが書き込まれたブロック2を消去し、書き込む有
無フラグを消す。ここで、ブロック2の消去後、何らか
の原因により、ストップ・シーケンスに移り、その後立
ち上がった場合でも、ブロック6に実行中フラグが書き
込まれているので、直ちに初期化動作中と判断し、初期
化動作に移ることができる。(b−4)において、ブロ
ック1〜3には書き込み有無フラグに書き込まれていな
いため、ブロック4を消去し、書き込む有無フラグを消
す。(b−5)において、ブロック1〜5には書き込み
有無フラグに書き込まれていないため、ブロック6を消
去し、実行中フラグを消す。 【0043】図35は本実施例の処理を示すフローチャ
ートであり、同図により本実施例を説明する。ステップ
S1において、実行中フラグの書き込みがあるか否かを
判別し、有る場合には、ステップS3に行き、ない場合
にはステップS2において、最終処理ブロックに実行中
フラグを書き込む。ステップS3において、処理対象を
クリアし、ステップS4において、処理対象に書き込み
有無フラグがあるか否かを判別する。書き込み有無フラ
グがない場合には、ステップS6に行き、有る場合に
は、ステップS5において、処理対象を消去し、ステッ
プS6において、処理対象を次に進める。ステップS7
において、実行中フラグの書き込みかあるか否か判別
し、ある場合には、ステップS4に戻り上記処理を繰り
返す。また、実行中フラグがない場合には、終了する。
本実施例においては、上記のように書き込み有無フラグ
を設けているので、不要な消去を避けることができ、消
去時間を短縮することができるとともに、媒体の寿命を
延ばすことができる。また、初期化実行中であることを
示す実行中フラグを設けているので、不意の中断に対応
することができる。 【0044】D.書き込み速度の向上、および、不良セ
クタ発生時の予備領域の割り当て 前記したように、フラッシュ・メモリは上書きをするこ
とができず、消去した後でなければセクタの書き込みを
行うことができない。このため、前記したように、書き
込み時、同一のセクタがある場合には消去可能フラグを
立て、適宜の時点で消去可能フラグが立っているセクタ
を消去する必要があり、書込みの時間が掛かる。また、
前記したように、フラッシュ・メモリは、消去回数に制
限があり、所定回数以上消去を行うと消去が出来なくな
る。このため、不良セクタが発生した場合には、予備の
領域を割り当て救済措置を講ずる必要があり、以下に示
す実施例は、上書きができず、セクタ単位で消去可能な
メモリにおいて、上記した書き込み時のタイムラグをな
くし、書き込み速度を向上するとともに、不良セクタが
発生した場合に予備領域を割り当てる実施例を示してい
る。図36は本実施例のシステム構成を示す図であり、
図5に示したシステムに、EEPROM26が付加され
ており、その他の構成は図5に示したものと同一であ
る。EEPROM26にはアドレス変換を行うデコード
・テーブルが格納されており、上記EEPROM26に
よりアドレスのデコードが行われる。そして、フラッシ
ュ・メモリの一部が不良になったとき、EEPROM2
6を書き換えて、救済措置を行う。なお、図36には、
EEPROM26が例示されているが、デコード・テー
ブルを格納した記憶媒体としては、書き換えが可能な記
憶媒体であればよく、その他フラッシュ・メモリ等を用
いることができる。 【0045】(1)実施例1 図37、図38は本実施例の構成を示す図であり、図3
7において、261はEEPROM26(もしくはフラ
ッシュ・メモリ等の書き換え可能なROM)から構成さ
れるセクタ変換部である。25はフラッシュ・メモリで
あり、フラッシュ・メモリは第1の領域A、第2の領域
B、および予備領域Cが設けられ、第1の領域A、第2
の領域Bには、それぞれ、1〜4の4個のセクタが設け
られている。図37において、データをセクタ1に書き
込む場合には、第1の領域Aと第2の領域Bを見て、既
に第1の領域Aにデータが有る場合には、第2の領域B
にデータを書き込む。また、上記データを書き込んでい
る間に、第1の領域Aのセクタ1−Aを消去する。その
際、書き込みエラーが発生した場合には、予備領域Cを
代替セクタとして割り当てる。すなわち、第1の領域A
のセクタ1−Aに書き込みエラーが発生した場合には、
予備領域Cをセクタ1−Aの代替とするため、セクタ変
換部261のROMを書き換え、図38に示すように、
セクタ1−Aとして、予備領域Cを割り当てる。 【0046】以上のように、書き込みエラーが発生した
場合、予備がある限り予備領域のセクタを割り当て、予
備がなくなった場合には、データを全て図36に示した
SRAM23等の外部の領域に退避し、セクタ変換部2
61のROMを再編成し、データの空間と予備の空間に
分ける。また、その時、セクタは、システムの構成に応
じて、昇順、または、降順で初期状態と同様に割り当て
ていくが、不良セクタは除外する。本実施例において
は、上記のように、書き込みと同時に消去を行っている
ので、書き込み時のタイムラグをなくすことができ、書
き込み速度を向上させることができる。また、予備領域
を設け、不良セクタが発生した場合に、予備領域に代替
しているので、不良セクタが発生した際の救済を行うこ
とができる。 【0047】(2)実施例2 図39、図40は本実施例の構成を示す図であり、図3
9において、261はEEPROM、もしくは、フラッ
シュ・メモリ等の書き換え可能なROMから構成される
セクタ変換部、25はフラッシュ・メモリであり、フラ
ッシュ・メモリは第1の領域A、予備領域Cが設けら
れ、第1の領域Aには1〜4の4個のセクタが設けられ
ている。また、231は図36に示したSRAM23等
のデータの一次記憶媒体である。図39において、デー
タの書き込み時、一次媒体231にデータを転送してい
る間に、書き込むセクタを調べ、書き込むべきセクタに
データがあった場合には、そのセクタを消去する。な
お、転送が早く終了した場合には、消去終了までまち、
また、転送が遅い場合には、転送終了後、データを書き
込む。また、書き込みエラーが発生した場合には、セク
タ変換部261のROMの書き換えをおこなって、図4
0に示すように(セクタ1−Aにエラーが発生した場合
を示している)、予備領域Cにセクタ1−Aの書き込み
を行う。なお、通常のセクタがエラーにならない限り、
予備領域Cへの書き込みは行わない。本実施例において
は、上記のように、データを一次記憶媒体231に転送
している間に、書き込むべきセクタにデータがあった場
合、消去を行っているので、第1の実施例と同様、書き
込み時のタイムラグをなくすことができ、書き込み速度
を向上させることができる。また、予備領域を設け、不
良セクタが発生した場合に、予備領域に代替しているの
で、不良セクタが発生した際の救済を行うことができ
る。 【0048】(3)実施例3 図41、図42は本実施例の構成を示す図であり、図4
1において、261はEEPROM、もしくは、フラッ
シュ・メモリ等の書き換え可能なROMから構成される
セクタ変換部、25はフラッシュ・メモリであり、フラ
ッシュ・メモリはブロック1,ブロック2,予備ブロッ
ク1,予備ブロック2が設けられ、各ブロックには、ブ
ロック1,ブロック2には、セクタ1〜3A,1〜3
B,…,1〜3D、4〜6A,4〜6B,…,4〜6D
が設けられている。そして、セクタ1〜3A,1〜3
B,…,1〜3Dは物理アドレスとしてはそれぞれ1セ
クタであり、ここに論理アドレス1,2または3のデー
タを書き込むことができる。すなわち、論理アドレス
1,2または3のデータを書き込む領域がA〜Dの4セ
クタ分設けられており、データを書き込む場合には、A
〜Dの内の空いている領域に書き込む。同様に、セクタ
4〜6A,4〜6B,…,4〜6Dも上記と同様であ
り、論理アドレス4,5または6のデータを書き込む場
合には、A〜Dの内の空いている領域に書き込む。以上
のように、本実施例においては、n+1(この実施例に
おいてはn=3)セクタ単位でブロック化されており、
書き込む論理アドレスに対して、1セクタの空きが設け
られている。 【0049】図41において、データをセクタ1に書き
込む際、セクタ1〜3A,1〜3B,…,1〜3Dを見
て、これらの中にセクタ1が既に存在する場合には、そ
のセクタを消去する。また、セクタには必ず空いている
セクタが存在するので、上記した消去と同時に、空いて
いるセクタに書き込みを行う。書き込み時、書き込みエ
ラーが発生した場合には、代替ブロックとして予備ブロ
ックを割り当てる。例えば、セクタ1〜3Aが不良とな
った場合には、図42に示すように、予備ブロック1を
代替ブロックとして割り当てる。そして、セクタ変換部
261のROMを書き換えて、エラーのあったブロック
1を予備ブロック1に割り当てる代替処理を行う。これ
により予備ブロック1がブロック1となる。予備がある
限り上記のような処理を行い、予備がなくなった場合に
は、データを全て図36に示したSRAM23等の外部
の領域に退避し、セクタ変換部261のROMを再編成
し、データの空間と予備の空間に分ける。また、その
時、セクタは、システムの構成に応じて、昇順、また
は、降順で初期状態と同様に割り当てていくが、不良セ
クタは除外する。セクタ変換部261は、論理セクタか
ら物理セクタへの変換時、上記したように、n+1セク
タ単位でブロック化し、デコードするセクタ1に対し
て、書き込み可能なn+1のセクタが存在するように構
成する。そして、一部のセクタが不良となった場合に
は、上記セクタ変換部261のテーブルを書き換えるこ
とにより、書き込みブロックを移動して、常にn+1の
セクタのブロックを作成する。本実施例においては、上
記のように、n+1セクタ単位でブロック化し、1セク
タを空けておき、書き込みと同時に消去を行っているの
で、実施例1,2と同様、書き込み時のタイムラグをな
くすことができ、書き込み速度を向上させることができ
る。また、予備領域を設け、不良セクタが発生した場合
に、予備領域に代替しているので、不良セクタが発生し
た際の救済を行うことができる。 【0050】(4)実施例4 図43、図44は本実施例の構成を示す図であり、図4
3において、261はEEPROM、もしくは、フラッ
シュ・メモリ等の書き換え可能なROMから構成される
セクタ変換部、25はフラッシュ・メモリであり、フラ
ッシュ・メモリはブロック1,ブロック2,予備1A〜
1Dが設けられ、ブロック1,ブロック2には、それぞ
れ、セクタ1〜3A,1〜3B,…,1〜3D,4〜6
A,4〜6B,…,4〜6Dが設けられている。また、
本実施例においては、実施例3と同様、n+1(この実
施例においてはn=3)セクタ単位でブロック化し、1
セクタを空けておく。図43において、データをセクタ
1に書き込む際、セクタ1〜3A,1〜3B,…,1〜
3Dを見て、これらの中にセクタ1が既に存在する場合
には、そのセクタを消去する。また、セクタには必ず空
いているセクタが存在するので、上記した消去と同時
に、空いているセクタに書き込みを行う。書き込み時、
書き込みエラーが発生した場合には、代替セクタとして
予備1A〜1Dを割り当てる。例えば、セクタ1〜3A
が不良となった場合には、図44に示すように、予備1
A〜1Dがブロック1となり、セクタ1〜3Aに対して
予備1Aを割り当て、セクタ変換部261のROMを書
き換えて代替処理を行う。これにより予備セクタ1Aが
セクタ1〜3Aとなり、予備1B〜1Dはブロック1の
予備となる。 【0051】予備がある限り上記のような処理を行い、
予備がなくなった場合には、データを全て図36に示し
たSRAM23等の外部の領域に退避し、セクタ変換部
261のROMを再編成し、データの空間と予備の空間
に分ける。また、その時、セクタは、システムの構成に
応じて、昇順、または、降順で初期状態と同様に割り当
てていくが、不良セクタは除外する。セクタ変換部26
1は、論理セクタから物理セクタへの変換時、上記した
ように、n+1セクタ単位でブロック化し、デコード時
には、そのデコード・データよりアドレス変換するテー
ブルを設けセクタ1に対して書き込み可能なn+1のセ
クタが存在するように構成する。そして、一部のセクタ
が不良となった場合には、上記セクタ変換部261のテ
ーブルを書き換えることにより、常にn+1のセクタの
ブロックを作成する。本実施例においては、上記のよう
に、n+1セクタ単位でブロック化し、1セクタを空け
ておき、書き込みと同時に消去を行っているので、実施
例1,2,3と同様、書き込み時のタイムラグをなくす
ことができ、書き込み速度を向上させることができる。
また、予備領域を設け、不良セクタが発生した場合に、
予備領域に代替しているので、不良セクタが発生した際
の救済を行うことができる。 【0052】(5)実施例5 図45、図46は本実施例の構成を示す図であり、図4
5,46において、図37、図38に示したものと同一
のものには同一の符号が付されており、261はEEP
ROM、もしくは、フラッシュ・メモリ等の書き換え可
能なROMから構成されるセクタ変換部、25はフラッ
シュ・メモリであり、フラッシュ・メモリはブロック
1,ブロック2,予備ブロック1,予備ブロック2が設
けられ、ブロック1,ブロック2、セクタ1〜3A,1
〜3B,…,1〜3D,4〜6A,4〜6B,…,4〜
6Dが設けられている。また、本実施例においては、実
施例3と同様、n+1(この実施例においてはn=3)
セクタ単位でブロック化し、1セクタを空けておく。図
45において、データをセクタ1に書き込む際、セクタ
1〜3A,1〜3B,…,1〜3Dを見て、これらの中
にセクタ1が既に存在する場合には、そのセクタを消去
する。また、必ず空いているセクタが存在するので、上
記した消去と同時に、空いているセクタに書き込みを行
う。書き込み時、書き込みエラーが発生した場合には、
代替セクタとして予備セクタを割り当てる。例えば、セ
クタ1〜3Aが不良となった場合には、予備ブロック1
を割り当て、セクタ変換部261のROMを書き換え
て、代替処理を行う。これにより、図46に示すよう
に、予備ブロックのセクタ1,n,mAがセクタ1に置
き変わり、予備ブロックにセクタ1が存在することとな
り、元のブロックにはセクタ2,3がそのまま残る。 【0053】すなわち、この実施例においては、ブロッ
クの構成は続きセクタでなくてもよく、元のブロックの
構成数を変更する。予備がある限り上記のような処理を
行い、予備がなくなった場合には、データを全て図36
に示したSRAM23等の外部の領域に退避し、セクタ
変換部11のROMを再編成し、データの空間と予備の
空間に分ける。また、その時、セクタは、システムの構
成に応じて、昇順、または、降順で初期状態と同様に割
り当てていくが、不良セクタは除外する。本実施例にお
いては、上記のように、n+1セクタ単位でブロック化
し、1セクタを空けておき、書き込みと同時に消去を行
っているので、実施例1,2,3,4と同様、書き込み
時のタイムラグをなくすことができ、書き込み速度を向
上させることができる。また、予備領域を設け、不良セ
クタが発生した場合に、予備領域に代替しているので、
不良セクタが発生した際の救済を行うことができる。 【0054】図47〜図49は上記実施例における処理
を示すフローチャートであり、図36に示したシステム
における本実施例の処理を説明する。ステップS1にお
いて、本体からセクタデータの書き込み要求があると、
ステップS2において、CPU22はコントローラLS
I21からの通知によりデータの書き込み要求があるこ
とを認識する。なお、コントローラLSI21がCPU
22に割り込みをかけて、データの書き込み要求を通知
してもよい。ステップS3において、CPU22はEE
PROM26のデータを読み込み、その書き込み場所を
認識し、セクタデータが書かれているか否かをチェック
するため、フラッシュ・メモリ25−1,…,25−5
をアクセスし、ECCデータ、あるいは、フラッシュ・
メモリに格納された管理情報等を参照する。そして、ス
テップS5において、フラッシュ・メモリにデータが書
かれているか否かを判断し、データが書かれていない場
合には、図48のステップS8に行く。また、データが
書かれている場合には、ステップS6において、第2の
セクタにデータを書き込むための情報を読み込むため、
CPU22はEEPROM26をアクセスし、データを
得る。ついで、ステップS7において、フラッシュ・メ
モリのデータを消去し(効率を上げるためエラーチェッ
クは後で行う)、図48のステップS8に行く。 【0055】ステップS8において、本体よりデータを
SRAM23にデータを転送し、終了を待つ。ステップ
S9において、フラッシュ・メモリにデータを書き込む
ため、CPU22はコントローラLSI21に対してデ
ータの書き込みを通知し、コントローラLSI21はS
RAM23よりフラッシュ・メモリにデータを書き込
む。ついで、ステップS10において、CPU22はコ
ントローラLSI21よりデータ書き込み終了の通知を
受け、ステップS11において、データの書き込みエラ
ーがあったか否かを判断する。データの書き込みエラー
がなかった場合には終了し、書き込みエラーがあった場
合には、ステップS12において、代替用セクタが有る
か否かを判断し、代替用セクタがある場合には、ステッ
プS13に行き、セクタアドレスを変更するため、EE
PROM26をアクセスしてデータを変更し、ステップ
S9に戻る。また、代替用セクタがない場合には、図4
9のステップS14に行き、消去中のフラッシュ・メモ
リがあるか否かを判断し、消去中のフラッシュ・メモリ
がある場合には、ステップS15に行き、消去終了まで
待って、消去したセクタにデータを書き込み終了する。
ステップS14において、消去中のフラッシュ・メモリ
がないと判断された場合には、ステップS16におい
て、本体側にエラーを通知する。本体側では、ステップ
S17において、データを吸い上げEEPROM26を
再編成するコマンドを送る。記憶装置側では、本体側か
らのコマンドに応じて、EEPROM26を再編成し、
本体から送られる1論理セクタに対して、2セクタ以上
の選択ができるようにする。これにより、少し容量は減
るが記憶装置として使用可能となる。なお、上記処理に
おいては、SRAM23にデータを転送し、フラッシュ
・メモリにデータを書き込む場合について説明したが、
SRAM23を設けず、直接フラッシュ・メモリにデー
タを書き込むこともできる(この場合には、上記フロー
チャートのステップS8,S9は一処理となる)。 【0056】E.アドレス変換用デコード部の信頼性の
向上 以下、本発明の請求項1の発明の実施例について説明す
る。論理アドレスを物理アドレスに変換するための変換
テーブルとしてROMが使用されることがある。また、
ROMの代わりに、フラッシュEEPROM、EEPR
OM等を使用することも可能であるが、通常はデコード
部を可変にする必要がないため、使用されることが少な
い。一方、フラッシュ・メモリは、その媒体の性質上、
消去回数に制限があり、不良になると、不良になったア
ドレスが使用出来なくなる。そこで、前記したD.の実
施例(1)〜(5)に示すように、論理アドレスを物理
アドレスに変換するための変換テーブルとして、フラッ
シュEEPROM、EEPROMなどの書き換え可能な
デコード部を用い、不良のセクタが発生した場合、デコ
ード部を書き換え、不良アドレスがないように見せかけ
る方法が用いられる。しかしながら、変換テーブルとし
て、フラッシュEEPROM、EEPROMなどを用い
た場合、これらのフラッシュEEPROM、EEPRO
Mなどにも、消去回数に制限があり、所定回数以上消去
を行うと不良が発生する。本実施例は、上記のように、
デコード部としてフラッシュEEPROM、EEPRO
Mなどの書き換え可能な記憶媒体が使用されている場合
において、デコード部を2段化とすることにより、デコ
ード部の寿命を延ばし、アドレス変換用デコード部の信
頼性を向上させる実施例を示している。 【0057】図50は本実施例のデコード部の構成を示
す図であり、同図(a)は通常の場合、(b)はセクタ
が不良になった場合、(c)はデコード部が不良になっ
た場合を示しており、301は1次デコード部、302
は2次デコード部、303はフラッシュ・メモリのセク
タを示している。同図において、フラッシュ・メモリの
セクタが正常な場合には、(a)に示すように、1次デ
コード部301がセクタ0のアドレスのデコード値とし
てアドレス「0000h」を出力し、2次デコード部3
02が「0000h」のデコード値として物理アドレス
「5555h」を出力し、フラッシュ・メモリのセクタ
0の物理アドレスを指定している。ここで、フラッシュ
・メモリの消去回数が制限値を越えてセクタが不良とな
り、セクタ0の物理アドレスをアドレス8888hの予
備のセクタに切り替える場合には、同図(b)に示すよ
うに、2次デコード部302を書き換えて、「0000
h」のデコード値を「5555h」から「8888h」
に切り替える。これにより、セクタ0として物理アドレ
ス「8888h」が割り当てられる。上記のようにし
て、2次デコード部(もしくは1次デコード部)を何度
か書き換えることにより書き換え制限値以上になり、2
次デコード部不良になると、同図(c)に示すよう
に、一次デコード部301を書き換えてそのデコード値
をずらす。すなわち、2次デコード部302がデコード
値として「8888h」を出力する「2222h」をデ
コード値として出力するように一次デコード部301
書き換える。これにより、2次デコード部302が不良
になっても、物理アドレス「8888h」をデコード値
として出力することができる。 【0058】以上のように、デコード部を2段化し、一
方のデコード部が不良になった場合に、他方のデコード
部を書き換えることにより、デコード部の寿命を2乗化
することができる。例えば、セクタが不良になるまでの
回数をL回(書き換え制限値)、2次デコード部が不良
になるまでの回数をM回(書き換え制限値)、1次デコ
ード部が不良になるまでの回数をN回(書き換え制限
値)とすると、アドレスがエラーになるまでの回数はN
×M×L回となる。基本的に書き換え制限値はフラッシ
ュEEPROMで10万〜100万回、EEPROMで
1万回程度といわれているので、事実上、デコード部を
2段化するだけで、信頼性を十分確保することができ
る。 【0059】F.書き込み時間の推定処理 フラッシュ・メモリにおいては、データの書き込みに
際、退避処理等を行う必要があり、通常の半導体メモリ
の場合より書き込みに時間がかかる。本実施例は、フラ
ッシュ・メモリへの書き込み時間の推定を行い、消費電
力の推定、異常の検出等を行う実施例を示している。図
51に本実施例のシステム全体の概略構成を示す。1は
記憶装置、1aは上書きすることができず、また、セク
タ、ブロック等の所定の単位でしかデータを消去するこ
とができない、例えばフラッシュ・メモリ等から構成さ
れる記憶領域、1bはコントローラ、2は本体処理装置
である。次に本実施例について説明する。今、記憶装置
が図52に示すような状態になっている場合に、3セク
タのデータを書き込む場合を考える。まず、図51の本
体よりプロセッサ22に書き込むセクタ数を送る。書き
込むセクタ数がプロセッサ22に送られると、プロセッ
サは書き込むセクタ数により書き込み時間を求める。こ
こで、図52のように書き込むブロックが無い場合に
は、退避動作が行われるので、書き込み時間tは次のよ
うにして求められる。 t=〔1セクタの書き込みに掛かる時間〕×3+〔デー
タの退避時間〕(秒) プロセッサ22は上記のようにして書き込み時間を計算
し、本体へ返す。本体は、上記書き込み時間を元に、次
の式により書き込み動作時の消費電力W1を求める。 W1=t÷3600×〔書き込み動作の消費電力〕
(W) また、本体はその電源部から残りの電力W2を読み取
り、得られた書き込み電力と比較し、W2>W1ならデ
ータの書き込みを行う。一方、本体は上記のようにして
得た書き込み時間tと実際の書き込み時間を比較し、上
記書き込み時間tを越えても書き込みが終了しない場合
には、記憶装置の異常と判断し、例えば、ユーザに通知
したり、書き込み処理をストップ等の措置を行う。 【0060】図53は本実施例における本体の処理を示
すフローチャートであり、同図により本実施例を説明す
る。ステップS1において、これから書き込むデータの
サイズを記憶装置に送り、書き込みにかかる時間を得
る。ステップS2において、書き込みにかかる時間と、
時間当たりの消費電力をかけて書き込みにかかる電力を
得る。ステップS3において、残り電力と書き込みで使
用する電力を比較し、残り電力の方が少ない場合には、
異常処理を行う。また、残り電力の方が多い場合には、
ステップS4に行きデータを書き込み、ステップS5に
おいて、実際の書き込み時間が予想した時間より多いか
否か判別し、多い場合には、異常処理を行う。また、書
き込み時間が予想した時間以内の場合には、ステップS
6に行き、書き込み終了か否かを判別し、書き込み終了
でない場合にはステップS5に戻り、書き込み終了の場
合には、終了する。 【0061】以上のように、本実施例においては、書き
込み時間を求めることにより、書き込みに要する電力を
推定しているので、残り電力量で書き込みができるかど
うかの判断を行うことができる。このため、電池駆動等
のシステムにおいて、書き込み中に電力がなくなり書き
込みが途中で中断することを避けることができ、システ
ムの信頼性を向上させることができる。また、実際の書
き込み時間と推定した書き込み時間を比較することによ
り、記憶装置の異常を検出することができ、また、書き
込み時間を表示するなどしてユーザに知らせることによ
り、ユーザが記憶装置の異常を判断することが可能とな
る。 【0062】G.フラグ判定処理における信頼性の向上 フラグの判定は、通常、1ビットを1機能に割り当て判
定している場合が多い。しかしながら、フラッシュ・メ
モリは過剰消去により消去不能になるという、致命的不
良原因を構造的にもっており、これが発生したセルはハ
イレベルのままで、ローレベルに戻らない状態に陥る。
このため、フラッシュ・メモリ上のフラグを1ビット1
機能に対応させた場合には、そのビットが不良になった
とき、フラグの有効性がなくなってしまう。本実施例
は、前記図51に示したようにフラッシュ・メモリ上の
消去フラグ、不良フラグ、パリテイー等に対して、フラ
グを複数用意し論理積によりフラグ判定することによ
り、上記したフラッシュ・メモリの構造的欠点に対処
し、フラグ判定の信頼性を向上させた実施例を示してい
る。 【0063】(1)実施例1 図54は実施例1を示す図であり、同図(a)はフラグ
レジスタ、(b)は判定のための論理積回路、(c)は
真理値表を示している。本実施例においては、同図
(a)に示すように、一つの機能に対してフラグb0 ,
b4 を用意してフラグレジスタに格納する。そして、フ
ラグ判定を行う場合には、(b)に示すように、これら
のフラグの論理積を求めることにより、最終的な判定結
果を得る。上記のように判定しているので、同図(c)
の行番号2のようにビットb0 がハイレベルで固定にな
っても、その論理積結果としては、正しい結果を得るこ
とができる。同様に、行番号3のように、ビットb4 が
ハイレベルで固定になっても、その論理積結果として
は、正しい結果を得ることができる。 【0064】(2)実施例2 図55は実施例2を示す図であり、同図(a)は第1の
フラグレジスタ、(b)は第2のフラグレジスタ、
(c)はフラグ判定を行う論理積回路を示している。本
実施例は同一機能に対するフラグを別々のフラグレジス
タに格納するようにしたものであり、同図(a)に示す
第1のフラグレジスタのビットb0 にフラグを格納し、
同図(b)に示す第2のフラグレジスタのビットb0 と
ビットb2 に第1のフラグレジスタに格納したフラグと
同一の機能に対応するフラグを格納している。そして、
フラグを判定する場合には、同図(c)に示す論理積回
路により上記フラグの論理積を求める。本実施例におい
ても、実施例1と同様、フラグの一部がハイレベルで固
定しても、正しい判定結果を得ることができる。以上の
ように、本実施例においては、フラグの判定を複数ビッ
トで行うようにしているので、全てのビットが不良にな
らない限り、正しい判定値を常に出力することができ、
フラグ判定の信頼性を向上することができる。 【0065】H.管理テーブルの節約 本実施例は記憶装置が複数チップで構成され、各チップ
内に複数のブロックが設けられたフラッシュ・メモリ・
システムにおいて、管理テーブルを簡単化するととも
に、各ブロックを平均的に使用することができる実施例
を示している。以上示した実施例においては、データを
書き込むチップ、ブロックに制約がなく、データは全ブ
ロックのセクタに書き込むことができたため、全領域を
管理するテーブルを設ける必要があったが、本実施例に
おいては、各チップ内に書き込むデータを固定とし、チ
ップ内において書き込むブロックを移動して書き込んで
いくことにより、全領域を管理することなくデータの書
き込みができるようにし、フラッシュ・メモリの管理を
簡単化するとともに、各ブロックの使用を平均化してい
る。また、本実施例においては、チップ内に書き込まれ
るデータをチップの全容量より一定量少なくし、この一
定量のブロックをワークブロックと不良ブロック発生時
の救済ブロックに当てている。そして、ブロック内のデ
ータの並びは固定とし、データを書き換える場合、すで
に旧ブロックに有効なデータが存在している場合には、
そのデータを前記した図5のSRAM23に退避して、
新データと一緒にして空いている領域に書き込み、書き
込みが成功したら旧データのブロックを消去するように
している。 【0066】次に本実施例を説明する。図56は本実施
例におけるチップ、ブロック、セクタ内構成を示す図で
あり、同図に示すように、チップは2Mbyteであり、チッ
プ内は1ブロック4KbyteのNo.000〜No.511
の512個のブロックに分割され、各ブロック内には、
1セクタ528byte のNo.00〜No.07の8個のセ
クタが設けられている。なお、同図のブロックNo.お
よびセクタNo.は物理アドレスを示している。さら
に、セクタ内には、同図に示すように、256byte の実デ
ータ領域、Long命令用のECC領域、不良データフ
ラグ、不良ブロックフラグ、ブロックアドレス、256byt
e の実データ用領域ECC領域が設けられている。ブロ
ック・アドレスは、SRAM23に格納されているブロ
ック・ポインタのアドレス値を示し、ブロック・アドレ
スには、実データなしと判断したセクタも書き込むこと
としている。このようにすることにより、活線抜き差し
時、セクタアドレス数が多い物が正常データと判断する
ことができる。なお、セクタアドレス数が等しい場合は
ECC・チェックサムの正誤で判断する。不良ブロック
フラグは、ブロックのコンディションを示しており、F
Fhで正常ブロック、≠FFhで不良ブロックとしてい
る。不良データフラグは、データのコンディションを示
しており、FFhで正常データ、≠FFhで不良データ
としている。Long命令用のECC領域は最大4byte
である。ECC領域は、実データのコンディションを示
しており、この領域の値によりデータの訂正および誤り
検出を行う。 【0067】図57〜図61は本実施例における書き込
み処理を示す図であり、同図により本実施例を説明す
る。本実施例においては、チップがNo.00〜No.
04の5個で、各チップにワークブロックを4個設けた
場合の書き込みおよび管理方式を示している。図57は
全ブロックを消去した状態を示しており、同図に示すよ
うに、各チップにはワークブロックがwork01〜0
4の4個設けられており、データは上記ワークブロック
work01〜04に書き込まれる。書き込みはセクタ
単位で可能であるが、セクタ005の書き込み後にセク
タ004を書き込むなど、上位のセクタの書き込み後に
は下位のセクタの書き込みはできない。また、チップを
越えてデータが移動することはなく、ブロック内のセク
タの順番は不動である。さらに、例えば、論理ブロック
アドレス00にセクタ000〜005のみを書き込む場
合のように、書き込みデータが8セクタ全てを満たさな
い場合には、セクタ000〜005のデータを書き込み
後、セクタ006,007にブロックアドレスのみを書
き込む。なお、この場合、1ブロックが8セクタであ
り、また、チップが5個であるので、論理アドレスnの
データは、(論理アドレスn÷8)の商をさらに5で割
ったときに得られた余りのチップに書き込まれる。例え
ば、n=121の場合には、121÷8は15で余り1
であり、15÷5は5で余りが0なので、No.00の
チップに書き込まれる。 【0068】本実施例におけるデータの書き込み処理は
次のように行われる。まず、図57に示す全ブロックを
消去した状態からセクタNo.000〜039(論理ア
ドレス)の40セクタを連続書き込みすると、図58に
示すように各チップのwork01にデータが書き込ま
れる。すなわち、最初に書き込まれるセクタNo.00
0〜007は論理ブロックアドレスが00なので、本体
からSRAM23にセクタNo.000〜007のデー
タを転送して、チップNo.00の書き込みポインタが
指すwork01からデータを書き込む。なお、論理ブ
ロックアドレスはチップ単位で管理される。そして、こ
の場合には論理ブロックアドレス00が過去の存在しな
いので、チップNo.00のwork01はwork0
4の次の空き領域に移動する。8セクタ分の書き込みが
終了したら、書き込みポインタをチップNo.01のw
ork01に移動し、上記と同様にセクタNo.008
〜015のデータをwork01に書き込む。 【0069】以上のようにして、書き込みがチップN
o.04まで完了したら、書き込みポインタをチップN
o.00のwork02に移動する。次に、図58の状
態から、図59に示すようにセクタNo.120〜19
1(論理アドレス)の72セクタの連続書き込みをす
る。上記と同様、本体からSRAM23にセクタNo.
120〜127のデータを転送して、セクタNo.12
0〜127は論理ブロックアドレスが03なので、チッ
プNo.00の書き込みポインタが指すwork02か
らデータを書き込む。そして、上記と同様、チップN
o.00のwork02、work03はwork01
の次の空き領域に移動する。以下同様に、セクタNo.
128〜191のデータをチップNo.00〜No.0
4に書き込む。ここで、図59の状態から、セクタN
o.002〜003の2セクタを連続書き込みすると、
図60に示すようになる。まず、SRAM23にセクタ
No.002〜003のデータを転送する。この場合、
書き込みデータがセクタNo.002〜003なので、
論理ブロックアドレス00が指定され、これは過去に存
在するので、旧データの退避が必要と判断される。ま
た、書き込みデータがセクタNo.002〜003で、
論理ブロックアドレス00の最初から書き込まれないの
で、旧論理ブロックアドレス00のデータをSRAM2
3に退避する。なお、書き込みデータが論理ブロックア
ドレスの先頭より2セクタ分のときには、書き込みデー
タを先に処理した後に旧論理ブロックアドレスのデータ
の退避動作を行う。 【0070】次に、SRAM23に退避した旧データ0
00,001,004,005,006,007と新デ
ータ002,003を書き込みポインタが指すチップN
o.00のwork04に書き込む。その際、書き込み
は000,001,002,003,004,005,
006,007の順番に書き込む。ついで、論理ブロッ
クアドレス00がすでに存在しているので、旧論理ブロ
ックアドレスの消去を行う。また、work04を旧論
理ブロックアドレス00に移動する。上記のように2セ
クタ連続書き込みを行ったのち、電源がOFFになり、
再びONにすると、図61に示すように、ワークブロッ
クは使われているブロックの次より指定される。また、
上記のようにワークブロックを指定していき、チップの
最後まで検索してもワークブロックを全部指定できなく
なった場合には、チップの最初に戻り、ワークブロック
を指定する。上記の処理において、ブロック消去エラー
が発生した場合には、不良フラグに00hを設定し、そ
のブロックは書き込みおよび読み出し不可とする。すな
わち、ワークブロックを一つ潰すことにより対処し、ワ
ークブロックがなくなったら、そのシステムは書き込み
不可とする。また、データ退避途中にエラーが発生した
場合には、不良データフラグを立てたのちにデータを書
き込む。なお、読み出し動作ではそのブロックにエラー
が検出されても、そのブロックを不良ブロックとしては
扱わない。データ書き込みエラーが発生した場合には、
そのブロックを不良ブロックとする。不良フラグの立て
方は、一度書かれているデータを退避し、不良ブロック
フラグのみを立てて、再度書き込む。不良ブロックフラ
グも通常書き込みと同様、該当ブロック全てのセクタに
対して立てる。データ消去途中でエラーが検出された場
合には、そのブロックは不良ブロックとする。不良ブロ
ックフラグの立て方は、不良ブロックフラグのみを立て
るのではなく、実データを含め全てALL〔00〕を書
き込む。不良処理は該当ブロック全てのセクタに対して
行う。 【0071】以上のように、本実施例においては、各チ
ップ内に書き込むデータを固定とし、チップ内において
書き込むブロックを移動して書き込んでいくので、全領
域を管理する必要がない。このため、データを各チップ
内でのみ管理すればよく、管理テーブルを節約すること
ができ、また、書き込み動作の高速化を図ることができ
る。また、ワークブロックにデータを書き込み、ワーク
ブロックをチップ内で移動させるように構成したので、
各ブロックを平均的に使用することができる。 【0072】 【発明の効果】以上説明したように、本発明において
は、デコーダを2段設け、記憶装置の記憶領域の一部が
破壊したとき、もしくは、デコータの一部が破壊したと
き、2段のデコーダを書き換えることにより、破壊した
部分へのデコードが行われないようにしたので、デコー
ダとして、EEPROM、フラッシュメモリ等のその一
部が破壊する可能性のある記憶媒体を用いた場合におい
ても、アドレスがエラーとなる確率を著しく減少させる
ことができ、信頼性を確保することができる。
DETAILED DESCRIPTION OF THE INVENTION [0001] BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an external storage device for a personal computer.
Cannot overwrite flash memory used for
The present invention relates to a storage device control method. [0002] 2. Description of the Related Art Recently, external storage devices such as personal computers have been used.
External storage devices using flash memory
I'm afraid. Flash memory is non-volatile and
No need for backup power supply, electrically rewriting
And it is inexpensive, but has the following problems:
ing.   Write data only after erasing data
Cannot be erased, and the unit of erasure cannot be in bytes.
Yes, in units of sectors, blocks or chips. This
So, like normal memory, data is stored in bytes.
It cannot be rewritten, and
The write or erase speed is slow.   There is a limit on the number of erasures.
It is said that erasure becomes impossible after about one million times. this
Therefore, the number of erasures of a sector or block is averaged.
If not used, the part with the highest number of erases will be defective first
And the usable area decreases. Flash memory
Has the problems described above,
When using memory, use the data save area.
Save and manage data when rewriting data
A table was set up to manage data writing / erasing
In addition, when bad sectors, blocks, etc. occur,
It is necessary to take various measures such as taking remedies.
You. [0003] SUMMARY OF THE INVENTION Flash memory
Advantages such as being non-volatile and electrically rewritable
On the other hand, it has many problems as described above.
Of conventional DRAM, SRAM, etc.
Unlike conductor memory, it must be solved when using it.
There are many issues that must be addressed. The present invention addresses the above problems.
The purpose of the present invention is to
Overwriting cannot be performed as in memory, etc.
To improve the reliability of memory that cannot be erased
Is Rukoto. [0004] FIGS. 1 to 4 show the present invention.
FIG. 1 is a schematic diagram showing the overall configuration of the present invention.
2 to 4 are principle diagrams showing an outline of the present invention.
You. 1 to 4, reference numeral 1 denotes a storage device;
Cannot be written, and
Data can only be erased in certain units, for example
For example, a storage area composed of a flash memory or the like, 1b
Controls writing of data to the storage area 1a,
Control means for erasing the storage area 1a and the like, 1c is a storage area
1a temporarily stores data when writing data
To save the data in the storage area 1a.
The secondary storage media 1d and 1e store the address of the storage area 1a.
Decoding table for coding, 2 is main unit processing unit
It is. In order to solve the above problems, the present invention provides
The invention is readable and writable, as shown in FIGS.
In addition, a storage area where a part of the storage area may be destroyed
1a and the location where data in storage area 1a is stored
Storage device comprising a rewritable decoder 1d
, Two stages of decoders are provided, and a storage area of the storage device 1 is provided.
When part of 1a is destroyed, or when the decorator 1d,
When a part of 1e is destroyed, two-stage decoders 1d and 1e
By rewriting either one or both
And no longer decodes the destroyed part
Things. [0005] In FIG. 1, the main processing unit 2 to the storage device 1
When the write data is sent to the
The data is stored in the primary storage medium 1c. And decode
Decode the address with reference to the table 1d (1e)
The data stored in the primary storage medium 1c is stored in the storage area 1
Write to a new sector or block a. That
The same logical address as the logical address of the data to be written.
If the data of the source already exists in the storage area 1a,
Is the area where the data was erased or stored.
Set the erasable flag on the area. Also stored data
When the erasure flag is set in the area, the control means 1b
Primary storage of non-erasable data in specified units at fixed times
The storage area 1a is deleted by evacuating to the medium 1c, and the primary storage medium is deleted.
Such as writing back the data saved in the body 1c to the storage area 1a.
Processing is performed to create a free area. In addition, control hands
The stage 1b is used when a part of the storage area 1a becomes defective.
Rewrite the decoding table 1d (1e)
Then, the defective part is replaced with a spare area. The storage area 1a shown in FIG.
Lock 1a-1,..., 1a-N and the block
Block of written data consisting of
Storage device to be erased in units, storage area 1 shown in FIG.
Consists of multiple sectors that cannot be written to
Storage device that erases erased data in sector units,
Writing / erasing of data is performed as follows. (1) The storage area 1a includes a plurality of blocks 1a-1,.
-N and a sector that divides the block.
Storage device 1 for erasing written data in block units
In FIG. 2B, as shown in FIG.
1,..., 1a-N, the non-erasable data
When saving to another block, an erasable section
From blocks with a large number of data to m blocks, there is little erasability
N blocks (m and n are arbitrary integers)
Select the selected block and have free sectors at the same time.
Sectors are scattered in this block, and the blocks are uniformly saved.
With this, it is possible to create an empty block
As a result, sectors that are frequently rewritten in each block
Sectors with few replacements are mixed, and blocks
Can be averaged. (2) The storage area 1a includes a plurality of blocks 1 including a save area.
a-1,..., 1a-N and the written data
In a storage device for erasing data in block units, FIG.
Block 1 containing erasable data as shown in (c)
a-1,..., 1a-N, non-erasable data
After moving only the data to the save area,
And erased blocks as new save areas.
Thus, an empty area is created. This allows erasure
Data can be lost and this process must be performed in advance.
Thus, the writing time can be reduced. (3) On the opposite side of the save area with respect to the data write direction
Move only the non-erasable data of the block to the save area.
After that, erase the data in the above block and
Lock as a new evacuation area. This allows the writing area
Space between the write pointer indicating the location and the save area
Regions can be present. Therefore, during processing
Even if there is a disconnection, the data
Can be written, and the processing amount required after the processing is interrupted
Can be reduced. (4) The storage area 1 includes a plurality of blocks 1a including a spare area.
-1,..., 1a-N and written data
In a storage device for erasing data in blocks, FIG.
(A), a write point is reserved as shown in FIG.
Erases blocks that have been set in the storage area and in which data has been written
After moving unusable data to the spare area,
Repeat the process of erasing the data of the last
The number of free sectors in blocks other than the lock is in the spare area.
When it is equal to or larger than the number of sectors,
Blocks other than the block from which the data in the storage area was erased last.
Move to This allows you to create free space
it can. Also, when an empty block becomes unusable,
Recover unusable blocks to create empty blocks
Can be achieved. In addition, the data in the spare area is
Data to a block other than the last erased block.
The write point at the destination,
Search from the block after the deleted block
By erasing data at the end,
All free space between the multiplied block and the write pointer
Simplifies processing after processing is interrupted.
Can be Furthermore, after the processing is interrupted,
When resuming, check if there is any erasable data in the spare area,
Alternatively, depending on whether there is only unerasable data,
Can be determined at the time of
Can be simplified. (5) The storage area 1 has a plurality of blocks 1a-1,..., 1a-
N, and the written data is written in block units.
In the storage device 1 to be erased, the write
By providing a flag F1 indicating presence / absence, as shown in FIG.
Then, the written data is erased with reference to the flag F1.
I do. As a result, unnecessary erasure can be avoided, and
Not only shortening the time to leave, but also
Life can be extended. Also, the erasing process for all storage areas
Flag F2 indicating that the process is being executed is provided.
As a result, during the process of erasing all storage areas,
When interrupted, refer to the running flag and
It can be determined that the erasing process is in progress,
It is possible to respond to interruption of management. (6) Multiple bits corresponding to the same function in storage area 1a
Is recorded, and the flag is determined by the logical product of the flags.
Make settings. As a result, all bits become defective.
Unless it is necessary, the correct judgment value can always be output,
The reliability of the system can be improved. (7) As shown in FIG.
It consists of a number of sectors.
In a storage device that erases in sector units, the same sector
Prepare at least two sectors with the same number, and
If there is data in one of the attached sectors,
At the same time as writing data to the other sector,
Data of the data. This improves writing speed.
Can be up. (8) In the storage device shown in FIG.
Transfer data to the primary storage device 1c
The data in the above sector while
After erasure is completed or after data transfer is completed,
Write data to the data. This improves writing speed
can do. (9) Replace bad sectors in the storage device shown in Fig. 4.
Spare areas 1b-1 and 1b-2 to be written and write sectors
Rewritable decode table 1d for managing
If a bad sector occurs, the decode data
By rewriting the table 1d, the spare area 1b-
1, the write sector is changed to 1b-2, and the spare area 1 is changed.
When b-1 and 1b-2 are gone, decode table
To reconfigure the sector by rewriting the file 1d
Thus, it is possible to relieve when a defective sector occurs. (10) In the storage device shown in FIG.
N + 1 sectors are provided and N + 1
Each sector is shared by N sector numbers, and data is
When writing data to the N + 1 sectors,
Write to existing sector. This improves writing speed.
As well as the extra sectors
The number can be reduced, and the cost can be reduced.
it can. A spare area 1b for replacing a bad sector
-1 and 1b-2, when a bad sector occurs,
The decoding table 1d is rewritten, and the spare area 1b-
Change write block or sector to 1,1b-2
Or reorganize the decoding table 1d
You. As a result, it is possible to relieve when a bad sector occurs.
it can. (11) The storage area 1a is divided into a plurality of
Multiple blocks are provided in the chip,
When writing data to the block, the data is written to a new block.
If the written data already exists in the chip
If the data is erased in blocks,
In the storage device, write the chip to which data is written
Fix it corresponding to the data. Thereby, the control means 1
b needs to manage only the data in each chip, and the entire area
No need to manage. Therefore, in the control means 1b,
The management table can be simplified and the writing speed
Can be improved. Also, the data in each chip
To provide multiple work blocks for writing
When a defect occurs in a work block,
You can rescue lost work blocks. [0007] The invention of claim 1 of the present invention provides the above-described reading and writing system.
And the possibility of destroying part of the storage area
A certain storage area 1a and data in the storage area 1a are stored.
And a rewritable decoder 1d indicating the location where the
In the storage device obtained, as shown in FIG.
Provided that a part of the storage area 1a of the storage device 1 was destroyed.
ComeThe address of the secondary decode unit was rewritten and destroyed
Secondary decoding to prevent decoding to the part
When the unit is destroyed, rewrite the primary decoding unit,Destruction
Since decoding to the part that did
As a coder, such as EEPROM, flash memory, etc.
When using a storage medium that may destroy part of the
The probability of address errors is significantly reduced.
And reliability can be ensured. [0008] Next, embodiments of the present invention will be described. A. 1 illustrates a configuration of a storage device that is a premise of the present invention. FIG. 5 shows a case where a flash memory which is a premise of the present invention is used.
FIG. 2 is a block diagram showing a configuration of a storage device. Smell
20 is a storage device such as a memory card, and 21 is
Controls flash memory data rewriting, erasing, etc.
Controller LSI, 22 is a processor, 23 is various
You can store tables and data when writing data.
SRA used as buffer or save buffer
M and 24 are clock oscillators, 25-1 to 25-5 are flash oscillators.
Flash memory. In the figure, the SRA
The data transferred to M23 is stored in flash memory 25-
When writing to 1 to 25-5, flash as described above.
-Since the memory cannot be overwritten,
In this case, data is written to a new area. Also, the data
In the case of updating, measures such as setting an erasure flag on the old data
Take a place. The old data is flagged for erasure.
, An erasure flag is attached at a predetermined time.
Save only data that is not stored in SRAM 23 in predetermined units
To the area where the flash memory is to be written.
After erasing, rewrite the data to correct the data.
Work. FIG. 6 shows the contents of the SRAM 23 described above.
The SRM 23 has the following data as shown in FIG.
Data is stored. (1) Erase count table Hold the erase count of each block of flash memory
I have. (2) Erasable sector count table Total number of erasable sector flags in each block
Hold the value. (3) Write pointer Chip No. to start writing to flash memory,
Holds block No. and sector address No. (4) WORK-BLOCK-No. Indicates the current WORK-BLOCK-No. And the chip No.
 , Block No. are held. (5) Sort pointer Currently, the chip No., block No.
Data address No. is retained. (6) Rewrite Indicates whether the data to be written is new
You. (7) Write count Manages the number of times the device is written when organizing. (8) Save counter It manages the number of sectors in the evacuation operation during sorting. (9) Number of chips Holds the number of flash-chips mounted on the card. (10) Sector map table Chip No., Block No., and Cell No.
Holder address No. FIGS. 7 and 8 show the flash memory 25-1.
FIG. 25 is a diagram showing the contents of the flash memory.
Each sector has control information and data shown in the following (1) to (5).
Data etc. are stored. In this example,
126 sectors are provided, and each sector has (1)
The management information and data of (5) are stored, and the 126th security
The following management information (6) to (14) is stored after the
ing. (1) Bad flag Indicates the status of this sector.If it cannot be used, write it here.
Make a dent. (2) Erase flag Indicates the data status of this sector and is invalidated by rewriting, etc.
If this happens, write here. (3) Logical address Indicates the logical address of this sector. (4) Data Data written to this sector. (5) Checksum Checksum of written data (6) Bad sector memory Indicates a bad sector in the rearrangement target block. (7) Number of erasures of source Number of erases of the block to be pruned. (8) Evacuation block No. Chip No. and block No. for saving data (9) Erase Start Set when erasing the rearrangement target block is started. (10) Erase End Set when erasing of the rearrangement target block is completed. (11) All erase target Stands when it is determined to be erased during All Erase.
Te (12) Empty block Indicates whether there is data in the block, and if there is data
Is set up. (13) Block status Indicates the status of this block, and stands when it becomes unavailable.
Te FIGS. 9 to 13 show the flash memory 2.
Processor for writing data from 5-1 to 25-5
It is a flowchart which shows the process in 22.
The write operation will be described in detail with reference to FIG. FIG.
In step S1, the current writing of the SRAM 23 is
"Rewrite enabled" indicates whether the data to be updated is new or not.
"No" (see FIG. 6) is set to 0, and in step S2,
It is determined whether or not it is being rearranged. If you are not organizing
Goes to step S5, where the
Set “Number of Writes” to 0
Go to step S7. If you are organizing,
Go to S3, add 1 to the "number of writings", and
At 4, it is determined whether or not the number of writings is 6.
You. If the number of writings is 6, the process proceeds to step S6.
In this case, the number of times of writing is set to 1. In addition, the number of times of writing is 6
If not, go to step S7. After the above processing
As described above, when the number of writings is 2 to 5,
Operation is not performed.
Work to avoid frequent organizing operations.
By setting the number of writes as described above,
The sorting operation is performed once every five times. In step S7
The logical address of the data to be written
It is determined whether or not there is an error.
-Perform processing. When the logical address is not over
Goes to step S8 to determine whether or not there is old data.
That is, whether or not the data to be written is new data
If it is not new data, step S9
In the above, the “rewriting presence / absence” of the SRAM 23 is set to 1
To step S11. Also, for new data
In step S10, the "rewrite"
Is set to 0, and the process proceeds to step S11. Then
In step S11, the data is transferred from the main unit to the SRAM.
Transfer and whether or not there is a transfer error in step S12
Is determined. Error handling if there is a transfer error
Do. If there is no transfer error, step S in FIG.
13 and rewrite or not, that is, with new data
Determine if there is any data, and if it is not new data,
Since the data is updated, the old data is
The erasure bit is written in the sector having the address, and the step S15
go to. In step S15, the SRAM 23
"Number of writes" that manages the number of writes at the time of sorting is 1
Is determined, and if the “write count” is 1,
Is to organize the flash memory after step S16
Do. If the “write count” is not 1,
Go to step S46 of step 13, and after step S46,
Writes data in SRAM23 to flash memory
No. In step S16, when organizing on the SRAM 23,
To manage the number of sectors in the evacuation operation
Is set to 0, and in step S17,
"Arrangement pointer" indicating the sector address No.
(Sector address) is greater than 126 sectors.
Otherwise, if it is not smaller than 126, the sorting is finished
As a result, the procedure goes to step S38 in FIG. Also,
"Arrangement pointer" (sector address) is 126 sectors
If less, go to step S18 and
Determine whether the data pointer is 0, and the rearrangement pointer is not 0
In this case, the procedure goes to step S22. If the rearrangement pointer is 0, step S
In step 19, the number of erasures of each block and the erasable sector
The number is obtained from the table of the SRAM 23, and based on that,
And select the sort target. Then, in step S20
WORK-BLOCK on the flash memory
The chip number to be rearranged is set in the evacuation block number (see Fig. 8).
 And block No. are written. In step S21
To determine if there is a write error,
If there is an error, perform error processing and write error
If there is no, go to step S22. Step S2
In step 2, data to be saved is searched. That is,
Erase flag (see Fig. 7) in rush memory data
If so, go to the next sector. Also,
If there is no logical address, write the erase flag and
To the sector where the logical address is abnormal.
And write the bad flag and go to the next sector. Next, go to step S23 in FIG.
Determine whether there is a write error and write
If there is not, at step S24,
(Sector address) points to the 126th sector
And if the rearrangement pointer is 126,
Indicates that the sorting has been completed, and returns to step S3 in FIG.
Go to 8. If the sort pointer is not 126,
Go to step S25 and save the data to save
From the memory to the SRAM 23, and
And the generated checksum is stored in the flash memory.
Then, it is determined whether or not they match the checksum (see FIG. 7).
If they do not match, check in step S27.
It is determined whether or not the sum is FFh. And Choi
If the checksum is not FFh, the process proceeds to step S28.
And the checksum on the flash memory is FFh
Write the bad flag of the data save source sector
Go to step S29. In step S29, write
It is determined whether or not there is an error, and the process proceeds to step S30.
In step S26, the checksums match.
Or if the checksum is FFh in S27
Goes to step S30, where the write pointer indicates
Search for a writable sector from the
Then, it is determined whether or not there is a writable sector. book
If there is no writable sector, perform error processing,
If there is a writable sector, go to step S32.
To transfer the data on the SRAM 23 to the flash memory.
Moving. In step S33, a write error
To determine if there is a write error and if there is a write error
Returns to step S30. When there is no write error
Go to step S34 of FIG.
Write the sector erase flag. Then, step S3
At 5, it is determined whether or not there is a writing error, and
If there is no writing error, the process proceeds to step S36.
Rewrites the sector map table on the SRAM 23
At the same time, 1 is added to the evacuation counter. Then,
In step S38, the evacuation operation is performed a predetermined number of times.
Number (in this case, 60 times) is determined, and
If the evacuation operation reaches 60 times,
After arranging the memory, the process proceeds to step S38. Also retire
If the evacuation operation has not been performed 60 times, the operation shown in FIG.
Returning to step S22, the above processing is repeated. Whether the retraction counter is 60 or not
In step S17 of FIG.
If it is determined that it is not smaller than 126,
Go to S38, determine whether the evacuation counter is 0
You. When the evacuation counter is 0, that is,
If the logical pointer is not smaller than 126,
On the other hand, if the evacuation operation has not been performed, step S3
9 and in step S39 and subsequent steps,
Processing such as writing to the bad sector memory is performed. Sand
If the save counter is 0, the processing time is short.
Therefore, the information of the defective flag after S39 is stored in the defective section.
Process such as writing to the data memory, and save
If the data is not 0, the process proceeds to step S46 in FIG.
The data on the SRAM 23 to the flash memory.
It performs processing such as moving. In step S39, the evacuated block
Write the information of the defective flag of the disk to the write destination (write destination is WO
RK-BLOCK) bad sector memory (see FIG. 8)
And the number of erasures is displayed in the column of the number of erasures of the rearrangement source (FIG.
See). In step S40, write
Determine if there is an error and if there is no write error
If it is, go to step S41 and delete the arranged block.
Leave. In step S42, is there an erase error?
It is determined whether or not there is no erasure error.
Go to step S43 and write the bad sector memo to the erased block.
Return the defect flag information from the
Then, write the number of erases. Then, to step S44
In the table corresponding to the erased block
Add 1 to the number and set the number of erasable sectors to 0. Steps
In S45, the rearrangement pointer is set to WORK-BLOCK.
And the rearrangement pointer is set to 0. Next, the operation proceeds to step S46, where the write
Search for a writable sector from the sector indicated by the
In step S47, it is determined whether there is a writable sector.
Separate. If there is a writable sector, step
Go to S48 and flash the data on SRAM23.
Move to the memory, and in step S49, write
It is determined whether there is an error. When there is a writing error
In this case, the process returns to step S46, and there is no write error.
In this case, go to step S50. In step S50
Whether or not the rewrite is 1
Determine whether the data to be written is new, and
If the presence or absence is 1, the erase flag is written in step S51.
Erasable sector count table corresponding to the written sector
1 is added to the value of (see FIG. 6), and the procedure goes to step S52.
When the presence or absence of rewriting is 0 in step S50
In step 52, the sector map table
(See FIG. 6), and in step S53, the next
To write data to the sector indicated by the write pointer
Search for a writable sector and finish. B. Write / erase processing. As described above, flash memory has a limited number of erases.
In order to use all the memory effectively,
The number of departures needs to be averaged. Also, the flash menu
Mori cannot overwrite, rewrite data
Write the data to a new sector and
Take appropriate measures, such as setting an erasable flag on the
Erase sector with erasable flag set at time
There is a need. Therefore, the erasable data is erased and
When it is necessary to secure free space for writing data
In both cases, the above-mentioned empty area causes bad blocks, etc.
Take remedies when it becomes unusable due to
You need to create a free space. Below,
Erasure of erasure count (Example 1), erasure of erasable data
Create a free area to secure free space by deleting
2), relief for creating an empty area when a bad block occurs
Implementation of the present invention for area processing such as measures (Example 3)
Here is an example. (1) Embodiment 1 (Average of erase count) As described above, flash memory has a limited number of erases.
In order to use all the memory effectively,
The number of departures needs to be averaged. In this embodiment, each block
The number of erases without being aware of the number of erases
This embodiment shows an example in which the noise can be suppressed.
In addition, additional writing is performed in units of sectors, and
In the memory to be erased, the block is divided into sectors.
As shown below, blocks with many digestible sectors
And blocks with few erasable sectors
To write to a new block,
Averaged. Next, this embodiment will be described. FIG.
4 to 18 show the write processing in this embodiment.
It is a diagram showing, in the present embodiment, a 6-block having 6 sectors.
Write logical sectors A to O to flash memory
An example is shown. In the following description,
The number of empty sectors in the block is N (2 in this embodiment).
M blocks (2 in this embodiment)
), And an erasable sector
M blocks from the largest number (one block in this embodiment)
And n blocks from the smaller number of erasable sectors (this embodiment
In this case, one block is selected and saved at the same time. In addition,
When performing the evacuation operation, as described above, the erasable file
The sector which has no lag is read, and S shown in FIG.
Moved to RAM23, then moved to SRAM23
Write a sector to a new block. In FIG. 14A, the same sector is
There are no sectors A and B in blocks 1 and 2.
C, D, E, F, G, H, I in order from the first sector
Write to. In (b), write sectors C and D
No. In this case, since there are the same sectors C and D,
To the sector where C and D are written
Then, new sectors C and D are written. Next, FIG.
In (c), write sectors J, K, L, M, N, and O.
Get in. In this case, as in the case of FIG.
Since there are no sectors,
Write. In (d), sectors H, I, J, K,
Write M and N. The same sector has been written
To set an erasable flag and to set new sectors H, I, J,
Write K, M, N. In FIGS. 16 (e-1) and (e-2),
Write sectors C and D. At that time, the number of empty blocks
Since there are two, a retreat operation is performed. That is, the figure
In (d) of FIG. 15, the block having the largest number of erasable sectors
Lock 3 and block 4 with the fewest erasable sectors
Select and mix block 3 and block 4 sectors.
And the number of sectors in each block at the save destination becomes uniform.
Thus, the data is written into the empty blocks 5 and 6. As a result, FIG.
As shown in FIG. 6 (e-1), sectors O, I, K, M
Lock 5 and sectors H, J, L, and N block 6
And blocks 3 and 4 become empty blocks.
In this state, data is erased in block 2 in which C and D have already been written.
A flag indicating that the sector C and the sector D can be deleted is set as shown in FIG.
Write to block 5 as shown in FIG. In FIG. 17 (f-1), sectors H,
Write I and J. In this case, the same sector is already
Therefore, the erasable flag is set in blocks 5 and 6.
Then, sectors H and I are written in block 6,
At the time of writing J, there are two empty blocks.
The evacuation operation is performed as described above. That is, as shown in (f-2)
Block 2 having the largest number of erasable sectors,
Select block 6 with the least erasable sector and block
The sector of block 2 and the sector of block 6 are mixed and saved.
Make sure that the number of sectors in each block is
Write to blocks 3 and 4. Next, shown in (f-3)
Is written in sector J. Also in this case, the same sector
The sector of block 4 already written
Set the erasable flag to and write sector J to block 3.
Put in. In FIG. 18 (g), sectors E, F, G
Write. In this case, too, there is the same sector.
An erasable file is written in the written sectors 1 and 3.
Rag, write sectors E, F, and G in blocks 3 and 4.
Put in. FIG. 19 is a flowchart showing the processing of this embodiment.
The processing of this embodiment will be described with reference to FIG. S
In step S1, when data is received from the main unit,
In step S2, the number of blocks with empty sectors is N
It is determined whether or not: Block with empty sectors
If the number is not less than N, the procedure goes to step S7. Free
If the number of blocks with sectors is N or less, step
In S3, m
The block is set as a save target, and erased in step S4.
Save n blocks from blocks with few possible sectors
Elephants. In step S5, the block to be saved
Move data from to the empty block. Write at that time
The method is to change the write block each time data is moved.
Well, after writing to M blocks,
Return to lock. Next, in step S6, the evacuation pair
Erase an elephant block. In step S7, the same
If there is a logical sector, the physical sector that has already been written
Is set to an erasable flag, and in step S8,
Writes the data received from the flash memory
No. By the way, in general, a sector includes a system
Data that is hardly rewritten like a program
Stores stored sectors and data that is constantly rewritten.
There is a sector that has been stored,
In this case, sectors that are hardly rewritten
A large number of blocks has a small number of erases. Therefore, on
As described above, blocks with many erasable sectors
Blocks with many sectors to be replaced) and erasable
Block with few sectors (rewrite is hardly performed)
Block with many sectors).
Writing to each block results in rewriting to each block.
Sectors with a large number of sectors and sectors with a small number of rewrites
And the number of erased blocks can be averaged.
You. In this embodiment, writing is performed based on the above-described principle.
Since the writing process has been performed, the erase
It is possible to reduce the variation in the number of erases without being aware of the number.
And the erasure count is finite like flash memory
It is possible to extend the life of the memory. Also erase
Suppress variations in erase count without counting
Area for counting the number of erases.
It is also possible to manage memory without setting up area
Become. (2) Embodiment 2 (for erasing erasable data)
Creating free space by As mentioned above, flash memory can be overwritten.
Can not be written and write only after erasing
Can not. Therefore, when writing, the same sector is
Set an erasable flag when the
It is necessary to erase the sector where the function flag is set. Book
In the embodiment, as described above, the erasure flag is set.
Area processing to eliminate possible data from storage media
The area processing according to the present embodiment indicates the free time of processing.
Area that can be written to by writing in advance
And the writing time can be shortened. FIGS. 20 to 23 show the writing in this embodiment.
FIG. 9 is a diagram showing write / erase processing, and FIG.
explain. In this embodiment, the following points are assumed.
are doing.   There are six blocks, and six blocks per block.
Read / write is performed in sector units and erased
Is performed in block units.   The write method is a write-once write method, and the same
When writing a logical sector without
An erasable flag is set for the physical sector stored.   Write area 5 blocks + save area for additional writing
One block (block 1 to block 6).   If the write area is exhausted, the erasable
Block with the largest number of physical sectors
Move the data of the available physical sector to the save area, and
Erase block. And evacuate the block
Area, and the existing save area is used as the write area.
(This series of operations is called an evacuation operation).   The address of the sector sent from the main unit is A to P
And   When there is m or more erasable data in a block,
It is a target of the area processing in the present embodiment (see FIG. 20 to FIG.
In the example of 23, m = 1.) Note that FIG.
The arrow from 0 to the right of the block in FIG.
This is the position of the write pointer indicating the location. In FIG. 20A, logical sectors A to G
Write. In this case, the logical sector of the same address
Since there is no
Get in. In (b), logical sectors A and D to G are written.
Put in. In this case, the logical sector (A,
D, E, F, G), so the erasable flag was set.
Later, writing is performed in the same manner as (a). In (c), the logic
Write sectors H to N. In this case, the same address
Since there is no logical sector, the data is written as it is. FIG.
In (d), A, G to L are written. In this case
Are the logical sectors (A, G, H, I, J,
K, L), write after setting the erasable flag.
Put in. In (e), A, H to J are written. This place
In each case, the logical sector of the same address (A, H, I, J,)
Therefore, write after setting the erasable flag.
In (f-1), when writing A, I to L
However, since there is no write area, a save operation is performed. You
That is, the physical sector with the erasable flag set is the highest.
The data of many blocks (block 3) is saved in the save area (block
Block 6), and erases the source block. So
And use that block (block 3) as a save area.
And save the previous save area (block 6) to the write area
And As a result, it becomes like (f-1). Next, as shown in FIG.
A, I to L are written. In this case, the same address
After setting the erasable flag, A,
Write I to L. At this time, the write pointer is saved
It is at the beginning of the area (block 6). Write as above
As a result, the erasable data has been increased.
Region processing is performed. That is, the save area (block
As seen from 3), the block in the direction opposite to the writing direction
With lock (block 2) as the processing target, block 2 and
At 3, the evacuation operation is performed. As a result, as shown in FIG.
Block 2 becomes a save area, and block 3
The non-erasable data of block 2 is moved. Then with the above
Similarly, a retreat operation is performed in blocks 1 and 2. So
As shown in the result (g-2) of FIG.
And the non-erasable data of block 1 is stored in block 2.
Moved. Then, similarly to the above, the blocks 5 and 1 return.
Perform the evacuation operation. As a result, as shown in FIG.
Block 5 becomes the evacuation area, and block 1
The non-erasable data in step 5 is transferred. Block 6
Since there is no erasable data in
Absent. Similarly, the retreat operation is performed in blocks 4 and 5. The result
As a result, as shown in (g-4), the block 4 becomes the save area.
The non-erasable data in block 4 is moved to block 5.
Is done. Then, the evacuation before the processing of the position of the evacuation area is performed
Since the position of the area has been reached, the area processing ends. That's all
By performing such processing, erasable data can be stored on a storage medium.
Disappear from above. Next, as shown in (h), A, H to J
Write. Also in this case, the logical sector of the same address is
Because there is, write after setting the erasable flag. FIG. 24 is a flowchart showing the processing of this embodiment.
The processing of this embodiment will be described with reference to FIG. S
In step S1, the block number of the current save area is
In step S2, the evacuation area is set as a processing target.
I do. In step S3, the processing target is set in the writing direction.
Step forward in the opposite direction. In step S4,
Target and the saved block N saved in step S1
o. are compared, and if they are the same, the process ends. Processing object
If the stored block number is different from the stored block number, go to step S5.
To compare the number of erasable sectors to be processed with a predetermined value m
If the number of erasable sectors is equal to or less than m, step S
3 and the above process is repeated. Number of erasable sectors is m
If it is larger, the process goes to step S6 and the processing target is
In step S7, the write
To the beginning of the save area. In step S8
Move data from the block to be saved. Step
In step S9, the block to be saved is erased, and the
In step S10, the block to be saved is designated as a save area.
Then, the process returns to step S3 to repeat the above processing. In this embodiment, the area is allocated as described above.
Erasable data can be eliminated by performing area processing
It is possible to perform the area processing of this embodiment in advance.
Thus, the writing time can be reduced. Also,
Opposite the writing direction for the block targeted for area processing
As you are proceeding in the direction, the writing indicating the writing location
All free areas exist between the embedded pointer and the save area.
Can be made. As a result, in any case
Even if an interruption occurs, data is not deleted from the position indicated by the write pointer.
Data can be written,
Process can be reduced, and
Even if you do not have, there is no problem. (3) Embodiment 3 (for creating an empty area)
Remedies) As described above, flash memory is used for writing data.
Therefore, it is necessary to secure free space in the memory
However, in the present embodiment, the above-mentioned empty area has a bad block.
If you cannot use it for any reason,
An embodiment is shown in which a new free area is created.
FIG. 25 to FIG. 31 show a process of creating a free area according to the present embodiment.
This embodiment will be described with reference to FIG. The book
The following points are assumed in the embodiment.   There are seven blocks, and six blocks per block.
Read / write is performed in sector units and erased
Is performed in block units.   The write method is a write-once write method, and the same
When writing a logical sector without
An erasable flag is set for the physical sector stored.   One block of spare area (block
0) is secured, and 5 blocks are written for additional writing
+ One save area (block 1 to block 6)
You.   If the write area is exhausted, the erasable
Block with the largest number of physical sectors
Move the data of the available physical sector to the save area, and
Erase block. And evacuate the block
Area, and the existing save area is used as the write area.
(This series of operations is called an evacuation operation).   The address of the sector sent from the main unit is A to P
And In FIG. 25A, sectors A to G are written.
Get in. In this case, there is no same logical sector.
Write from block 1 as is. In (b),
Write the parameters A, D to G. In this case, sector A,
Since there is the same logical sector as DG, the same logical sector
Write after setting the erasable flag to (C) smell
Then, sectors H to N are written. In this case, the same logic
Since there is no sector, write as it is. In FIG. 26 (d)
Then, sectors A and G to L are written. In this case,
Since there is the same logical sector as the data A, GL, the same logical
Writes after setting an erasable flag in the sector. (E)
, Sectors A, H to J are written. In this case,
Since the same logical sector exists as the sectors A and H to J,
Writes after setting an erasable flag in the physical sector. In FIG. 27 (f-1), sectors A and I
To L are written, in this case, there is no write area
Therefore, the write process is performed after the save operation is performed. Sand
The block with the most data with the erasable flag set
Save area for non-erasable data in block (block 3)
Move to (Block 6) and delete the source block
You. Then, the block (block 3) is defined as a save area.
And use the save area up to now as a write area.
Then, in (f-2), sectors A, I to L are written.
The data is written to the block 6 which has become the embedding area. Next, (g)
In the above, A, M, and N are written.
Since there is no write area, the evacuation operation is performed first.
U. That is, the data with the erasable flag set
Non-erasable data in blocks with many (block 5)
Move to the evacuation area (block 3), and
Clear the lock. And that block (block 5)
Used as a save area and write the save area up to now
Area. Here, block 5 becomes unusable due to erasure failure.
If it becomes possible, there will be no evacuation area, so relief measures will be taken.
I do. Therefore, as shown in FIG.
The evacuation operation is performed using block 0 as a temporary evacuation area. sand
In other words, in FIG.
Non-erasable data of the most blocks (block 1)
Data to the temporary save area (block 0)
Erase a block. And the block (block
1) is used as a save area. Then, as shown in (i)
In the spare block (block 0).
U. That is, the spare area (block) used as the temporary save area
Move logical sectors B and C of lock 0) to block 3
You. Now that the spare area and save area have been created,
In (j), logical sectors A, M, and N are stored in block 3.
Write. Next, write sectors A, G, H, O, and P
However, since there is no writing area, FIG.
The evacuation operation is performed as shown in 1). That is, erasable
Of the block with the most data (block 4) can be erased
Data that is not in the backup area (block 1)
Erase the original block. Then, the block
The lock 4) is used as a save area. Then, (k-
Write sectors A, G, H, O, P as shown in 2)
However, the sectors A, G, and H have the same logical address.
Since there is a sector, block 1 after setting the erase flag
And for sectors O and P,
Put in. Next, in (l), sector A is written.
However, since there is no write area, the evacuation operation is performed.
U. As a result, block 2 becomes a save area, and block 2
The sectors D, E, and F that were in 2 move to block 4.
Here, it is assumed that block 2 has become unusable due to a loss failure.
Then, there is no evacuation area, so a rescue measure is taken. sand
In other words, the block (block
Move the data of 3) to the temporary save area (block 0)
To erase the source block. And that block
(Block 3) is used as a save area. The result
As a result, the result is as shown in FIG. This state
The processing was temporarily stopped due to power shortage, etc.
Then, when processing is resumed, the device erases to the spare area
Creates free space because there is no possible sector and there is data
It can be judged as medium. Next, rescue measures to create free space
And sector I and J of block 6 are set in the spare area (block
Move to block 0) and block sectors K and L in block 6.
Move to step 3. As a result, as shown in FIG.
You. Here, the free space excluding the save area sector is used.
Is less than the number of data in the spare area (block 0).
Because it is above, search the write point from the back of the save area
Then, data is transferred from the spare area (block 0) to the vacant area.
Move data. At that time, as shown in FIG.
Move sectors B, C, M, and N in the spare area (block 0)
At this stage, the main unit temporarily stops processing due to power shortage, etc.
Suppose you put on your laptop. In this case, when processing is resumed
On the device side, there is an erasable sector in the spare area,
Judging that data is being moved to the spare area while creating an empty block
Wear. Subsequently, as shown in FIG.
Move logical sectors I and J of (block 0) to block 4
And terminate the processing. FIG. 32 shows a free space creation process in this embodiment.
FIG. 4 is a flowchart showing the processing according to the present embodiment.
Will be described. In step S1, the spare area
It is determined whether or not there is an erasable sector.
Go to step S11. If not, go to step S2.
And set the write pointer to the start of the spare area
In step S3, it is determined whether or not there is data in the spare area.
You. If there is data in the spare area, step S10
If not, go to step S4 and set the save area
This is a spare area. In step S5, the writing area
If there is no erasable sector in each block of
Abort the process because the area cannot be created. Erase
If there is a possible sector, go to step S6 and erase
The block with the largest number of possible sectors is targeted for evacuation, and the
In step S7, data is reserved from the block to be saved.
Move to the area. In step S8, the block to be evacuated is
The block to be evacuated in step S9.
Make the lock a save area. In step S10,
Number of data in the storage area is larger than the number of free sectors other than the save area
It is determined whether the number is large or not.
Return and repeat the above process. If ≤,
Go to step S11, and move the write pointer to the save area.
The search is performed in the writing direction from next, and the process proceeds to step S12.
In this case, data is moved from the spare area to a free sector.
In step S13, the spare area is erased and the processing ends.
You. In this embodiment, an empty area is created as described above.
Unusable blocks occur in the storage medium
Even if remedies can be used to create free space,
To prevent the storage device from becoming unusable.
it can. Also, during the process, the power
Even if the processing is interrupted, it indicates at what stage the processing was interrupted.
Can be easily determined, and
The judgment can be simplified. C. Efficient erasing process Flash memory should be overwritten as described above
Can not be written and can be written only after erasing
Can not. In this embodiment, the flash memory as described above is used.
A flag indicating the presence or absence of writing, and
An in-flight flag indicating that the process is being executed should be provided.
Efficient erasing process when erasing all storage space
And the process was interrupted for some reason during the erase.
Process can be restarted even if
An example is shown. Next, referring to FIG. 33 and FIG.
The processing will be described. In this embodiment, the number of blocks
Are six, and the area for writing the write flag to each block is
Area is provided, and the entire space erasing process is being performed in block 6.
An area for writing an in-execution flag indicating that the operation is in progress is provided.
In FIG. 33 (a), writing of blocks 1, 2, 4
Before writing the write presence / absence flag in blocks 1, 2, 4
Put in. Next, the initialization process to clear the entire space
As shown in FIG.
Write In (b-2), the writing presence / absence flag
Erases block 1 to which data has been written, and writes
Remove the lag. In FIG. 33 (b-3), the presence or absence of writing
Block 2 to which the flag has been written is erased and written.
Turn off the no flag. Here, after erasing block 2,
To the stop sequence due to the cause of
Even if it rises, the running flag is written in block 6.
Immediately, it is determined that initialization is in progress.
Operation can be started. (B-4)
No write is made to the write presence / absence flag in
Therefore, block 4 is erased and the write flag is erased.
You. In (b-5), writing to blocks 1 to 5 is performed.
Block 6 is erased because it is not written in the presence flag
And clear the running flag. FIG. 35 is a flowchart showing the processing of this embodiment.
This embodiment will be described with reference to FIG. Steps
In S1, it is determined whether or not the execution flag is written.
Determine, if yes, go to step S3, if no
Is being executed in the final processing block in step S2
Write the flag. In step S3, the processing target is
Cleared and written to the processing target in step S4
It is determined whether or not there is an existence flag. Write presence flag
If there is no log, go to step S6.
Deletes the processing target in step S5, and
In step S6, the processing target is advanced to the next. Step S7
To determine whether the running flag has been written
If there is, return to step S4 and repeat the above processing.
return. If there is no running flag, the process ends.
In the present embodiment, as described above,
Is provided, unnecessary erasure can be avoided, and
The time required for the media
Can be extended. Also, confirm that initialization is in progress.
The following running flag is provided to cope with unexpected interruption.
can do. D. Improve writing speed and
Allocation of spare area when As mentioned above, flash memory can be overwritten.
Can not be written and write the sector only after erasing.
Can't do it. Therefore, as described above,
At the same time, if there is the same sector,
Sectors with an erasable flag set at the appropriate time
Need to be erased, and it takes time to write. Also,
As described above, flash memory has a limited number of erases.
If you erase more than a specified number of times,
You. Therefore, when a bad sector occurs, a spare
Areas need to be allocated and remedies taken, as shown below.
In this embodiment, it is not possible to overwrite,
In the memory, the time lag at the time of writing
In addition to improving the write speed,
Shows an example of allocating a spare area in the event of occurrence.
You. FIG. 36 is a diagram showing a system configuration of the present embodiment,
An EEPROM 26 is added to the system shown in FIG.
Other configurations are the same as those shown in FIG.
You. Decoding for performing address conversion is performed in the EEPROM 26.
A table is stored in the EEPROM 26
Further address decoding is performed. And flash
When a part of the memory becomes defective, the EEPROM 2
6 is rewritten and remedy is performed. In FIG. 36,
Although the EEPROM 26 is illustrated, the decoding data
Rewritable storage media
Storage media, flash memory, etc.
Can be. (1) Embodiment 1 FIGS. 37 and 38 are diagrams showing the configuration of the present embodiment.
7, 261 is the EEPROM 26 (or FLASH).
Rewritable ROM such as flash memory)
This is a sector conversion unit. 25 is a flash memory
And the flash memory has a first area A, a second area
B and a spare area C are provided, and the first area A, the second area
Area 4 is provided with four sectors 1 to 4 respectively.
Have been. In FIG. 37, data is written to sector 1.
In the case where the first area A and the second area B are
If there is data in the first area A, the second area B
Write data to Also, writing the above data
In the meantime, the sector 1-A in the first area A is erased. That
When a write error occurs, the spare area C is
Assign as an alternate sector. That is, the first area A
If a write error occurs in sector 1-A of
To make the spare area C a substitute for the sector 1-A,
The ROM of the conversion unit 261 is rewritten, and as shown in FIG.
The spare area C is allocated as the sector 1-A. As described above, a write error has occurred.
In this case, a spare area sector is allocated as long as there is a spare area.
In the case of lack of equipment, all data are shown in FIG.
The data is saved in an external area such as the SRAM 23 and the sector conversion unit 2
Reorganized 61 ROMs to provide data space and spare space
Separate. At that time, the sector depends on the system configuration.
Assigned in ascending or descending order
But exclude bad sectors. In this embodiment
Is erasing at the same time as writing, as described above
Therefore, the time lag at the time of writing can be eliminated,
Implanting speed can be improved. Also, the spare area
To be replaced with a spare area when a bad sector occurs.
Remedy when a bad sector occurs.
Can be. (2) Embodiment 2 FIG. 39 and FIG. 40 are views showing the configuration of the present embodiment.
9, 261 is an EEPROM or flash
It consists of rewritable ROM such as flash memory
The sector conversion unit 25 is a flash memory,
The flash memory has a first area A and a spare area C.
In the first area A, four sectors 1 to 4 are provided.
ing. Reference numeral 231 denotes the SRAM 23 shown in FIG.
Is a primary storage medium for the data. In FIG.
When writing data, data is transferred to the primary medium 231.
The sector to be written, and
If there is data, the sector is erased. What
Please note that if the transfer is completed early,
If the transfer is slow, write the data after the transfer is complete.
Put in. If a write error occurs, the section
By rewriting the ROM of the data converter 261, FIG.
0 (when an error occurs in sector 1-A)
Is written in the spare area C.
I do. Unless a normal sector fails,
Writing to the spare area C is not performed. In this embodiment
Transfers the data to the primary storage medium 231 as described above.
While there is data in the sector to be written
In this case, since erasing is performed, writing is performed in the same manner as in the first embodiment.
Time lag at the time of writing
Can be improved. Also, a spare area is provided,
When a good sector occurs, it is replaced with a spare area.
In the event of a bad sector, relief can be performed
You. (3) Embodiment 3 FIGS. 41 and 42 are diagrams showing the configuration of the present embodiment.
1, 261 is an EEPROM or flash
It consists of rewritable ROM such as flash memory
The sector conversion unit 25 is a flash memory,
Flash memory consists of block 1, block 2, and spare block.
Block 1 and spare block 2 are provided.
Lock 1 and block 2 have sectors 1-3A, 1-3
B, ..., 1-3D, 4-6A, 4-6B, ..., 4-6D
Is provided. Then, sectors 1-3A, 1-3
B,..., 1 to 3D each have one physical address.
Where the data of logical addresses 1, 2 or 3 are stored.
Data can be written. That is, the logical address
The area for writing 1, 2, or 3 data has four areas A to D.
When writing data, A
DD is written in an empty area. Similarly, sectors
4-6A, 4-6B,..., 4-6D are the same as above.
When writing data at logical addresses 4, 5 or 6.
In this case, the data is written in an empty area of A to D. that's all
As described above, in the present embodiment, n + 1 (in this embodiment,
In this case, n = 3) is divided into sectors, and
One sector space is provided for the logical address to be written.
Have been. Referring to FIG. 41, data is written in sector 1.
, See sectors 1-3A, 1-3B, ..., 1-3D
If sector 1 already exists in these,
Erase sector. Also, it is always empty in the sector
Since there are sectors, empty
Write to existing sector. When writing, write
If an error occurs, a spare block
Assign a lock. For example, sectors 1 to 3A are defective.
42, the spare block 1 is replaced as shown in FIG.
Assign as a replacement block. And the sector conversion unit
261 ROM was rewritten and the block with the error
1 is assigned to the spare block 1. this
Thus, the spare block 1 becomes the block 1. There is a spare
As long as the above processing is done, and there is no spare
Indicates that data is stored in an external device such as the SRAM 23 shown in FIG.
And reorganize the ROM of the sector conversion unit 261
Then, it is divided into data space and spare space. Also,
At times, sectors are ordered in ascending order or depending on system configuration.
Are assigned in descending order in the same way as in the initial state.
Kuta is excluded. Whether the sector conversion unit 261 is a logical sector
When converting from a physical sector to a physical sector, as described above,
Data for each sector 1
So that there are n + 1 writable sectors.
To achieve. And if some sectors are bad
Can rewrite the table of the sector conversion unit 261.
By moving the write block, the (n + 1)
Create a block of sectors. In this embodiment,
As described above, it is divided into n + 1
Data is erased while writing.
Thus, similarly to the first and second embodiments, a time lag at the time of writing is reduced.
Can improve writing speed
You. Also, if a spare area is provided and a bad sector occurs
In the meantime, since a spare area is used, bad sectors
Can be relieved. (4) Embodiment 4 FIGS. 43 and 44 are views showing the configuration of the present embodiment.
In step 3, 261 is an EEPROM or flash
It consists of rewritable ROM such as flash memory
The sector conversion unit 25 is a flash memory,
Flash memory is block 1, block 2, spare 1A ~
1D is provided, and block 1 and block 2
, Sectors 1-3A, 1-3B, ..., 1-3D, 4-6
A, 4 to 6B,..., 4 to 6D are provided. Also,
In the present embodiment, n + 1 (this actual
In the embodiment, n = 3) a block is formed in sector units, and 1
Leave a sector empty. Referring to FIG.
When writing to sector 1, sectors 1-3A, 1-3B,.
Looking at 3D, if sector 1 already exists in these
, The sector is erased. Also, the sector must be empty
Because there is a sector that is
Then, writing is performed to an empty sector. When writing,
If a write error has occurred,
Reserves 1A to 1D are allocated. For example, sectors 1-3A
Becomes defective, as shown in FIG.
A to 1D become block 1, and for sectors 1 to 3A
Allocate spare 1A and write ROM of sector conversion unit 261
In other words, the alternative processing is performed. As a result, the spare sector 1A
Sectors 1 to 3A are provided, and spares 1B to 1D are blocks 1
Become a spare. The above processing is performed as long as there is a spare,
If there is no spare, all data is shown in FIG.
To an external area such as the SRAM 23,
261 ROM, reorganize data space and spare space
Divided into Also, at that time, the sector depends on the system configuration.
Assign ascending or descending order in the same way as the initial state.
However, bad sectors are excluded. Sector conversion unit 26
1 indicates the above when converting from a logical sector to a physical sector.
As shown in FIG.
In the table, there is a table for address conversion based on the decoded data.
N + 1 cells that can be written to sector 1
Are configured to be present. And some sectors
If the data is defective, the data of the sector
By rewriting the table, the
Create a block. In the present embodiment,
Is divided into n + 1 sector units and one sector is left
Beforehand, since erasing is performed at the same time as writing,
Eliminates the time lag at the time of writing as in Examples 1, 2 and 3.
Writing speed can be improved.
Also, a spare area is provided, and when a bad sector occurs,
Since a spare area is used, when a bad sector occurs
Relief can be done. (5) Embodiment 5 FIGS. 45 and 46 are diagrams showing the configuration of the present embodiment.
5 and 46, the same as those shown in FIGS. 37 and 38
Are denoted by the same reference numerals, and 261 is an EEP
Rewriting of ROM or flash memory is possible
Sector conversion unit composed of functional ROM,
Flash memory, and flash memory is a block
1, block 2, spare block 1, spare block 2
Block 1, block 2, sectors 1-3A, 1
... 3B, ..., 1-3D, 4-6A, 4-6B, ..., 4-
6D is provided. In this embodiment, the actual
As in the third embodiment, n + 1 (n = 3 in this embodiment)
It is divided into sectors, and one sector is left. Figure
45, when data is written to sector 1, the sector
Look at 1-3A, 1-3B, ..., 1-3D
If sector 1 already exists, erase that sector
I do. Also, since there are always empty sectors,
At the same time as the erasure described above, writing is performed
U. When writing, if a writing error occurs,
A spare sector is assigned as a substitute sector. For example,
In the case where the first to third members have failed, the spare block 1
And rewrite the ROM of the sector conversion unit 261
And perform an alternative process. Thereby, as shown in FIG.
And the spare block sectors 1, n, and mA are placed in sector 1.
This means that sector 1 exists in the spare block.
Therefore, sectors 2 and 3 remain in the original block. That is, in this embodiment, the block
The structure of the block does not need to be a contiguous sector.
Change the number of configurations. As long as there is a spare,
When there are no more spares, all data is
Is saved in an external area such as the SRAM 23 shown in FIG.
The ROM of the conversion unit 11 is reorganized so that the data space and the spare
Divide into spaces. At that time, the sector is
Ascending or descending order, as in the initial state, depending on the configuration.
However, bad sectors are excluded. In this embodiment,
In addition, as described above, blocks are formed in units of n + 1 sectors.
One sector is left empty and erased simultaneously with writing.
Writing, as in the first, second, third and fourth embodiments.
Time lag can be eliminated and writing speed can be improved.
Can be up. Also, a spare area is provided to
In the event of a stag, it is replaced with a spare area,
Relief when a bad sector occurs can be performed. FIGS. 47 to 49 show processing in the above embodiment.
FIG. 37 is a flowchart showing the system shown in FIG.
Of the present embodiment will be described. In step S1
When there is a write request for sector data from the main unit,
In step S2, the CPU 22 determines whether the controller LS
Check that there is a data write request due to the notification from I21.
And recognize. Note that the controller LSI 21 has a CPU
Notify the data write request by interrupting 22
May be. In step S3, the CPU 22 executes EE
Reads the data in PROM 26 and sets the write location
Recognize and check if sector data is written
, 25-5,.
To access the ECC data or flash
Reference is made to management information and the like stored in the memory. And
In step S5, data is written to the flash memory.
Judge whether or not data is written.
In this case, the procedure goes to step S8 in FIG. Also, the data
If it is written, in step S6, the second
To read information for writing data to the sector,
The CPU 22 accesses the EEPROM 26 and stores the data.
obtain. Then, in step S7, the flash
Erase memory data (error checking to increase efficiency)
Will be performed later), and the process will proceed to step S8 in FIG. In step S8, data is sent from the main unit.
The data is transferred to the SRAM 23, and waits for the end. Steps
At S9, write data to the flash memory
Therefore, the CPU 22 transmits data to the controller LSI 21.
Data is written, and the controller LSI 21
Write data from RAM 23 to flash memory
No. Next, in step S10, the CPU 22
Notification of end of data writing from controller LSI 21
Then, in step S11, a data write error occurs.
It is determined whether or not there was. Data write error
If there is no write, the process ends.
In step S12, there is an alternative sector in step S12.
Judge whether or not there is a replacement sector, and
Go to step S13, and change the sector address.
Change the data by accessing the PROM 26,
It returns to S9. When there is no replacement sector, FIG.
Go to step S14 of step 9 to erase the flash memo being erased.
Flash memory that is being erased
If there is, go to step S15 until the erase is completed.
After waiting, the data writing to the erased sector is completed.
In step S14, the flash memory being erased
If it is determined that there is no
Error to the main unit. On the main unit,
In S17, the data is downloaded and the EEPROM 26 is
Send a command to reorganize. On the storage device side,
In response to these commands, the EEPROM 26 is reorganized,
Two or more sectors for one logical sector sent from the main unit
To be able to choose. This reduces the capacity slightly.
However, it can be used as a storage device. Note that the above processing
Transfer the data to the SRAM 23 and flash
・ Writing data to memory has been explained,
Without providing the SRAM 23, the data is directly stored in the flash memory.
Data can also be written (in this case,
Steps S8 and S9 of the chart are one process). E. Reliability of decoding part for address translation
Improvement Hereinafter, an embodiment of the first aspect of the present invention will be described.
You. Translation to translate logical address to physical address
ROM may be used as a table. Also,
Flash EEPROM, EEPROM instead of ROM
Although it is possible to use OM or the like,
Because it is not necessary to make the part variable,
No. On the other hand, flash memory, due to the nature of its medium,
There is a limit to the number of erases.
The dress cannot be used. Therefore, the above-mentioned D.I. Fruit
As shown in Examples (1) to (5), the logical address is
As a conversion table for converting to addresses,
Rewriteable EEPROM, EEPROM, etc.
If a bad sector occurs using the decoding unit,
Rewrite the code part and make it look like there is no bad address
Is used. However, as a conversion table
Using flash EEPROM, EEPROM, etc.
If these flash EEPROM, EEPROM
M also has a limit on the number of erasures, and erases more than a predetermined
When doing so, a defect occurs. This embodiment, as described above,
Flash EEPROM, EEPROM as decoding unit
When a rewritable storage medium such as M is used
, The decoding section is made into two stages,
Extend the life of the code section, and improve the
The example which improves reliability is shown. FIG. 50 shows the structure of the decoding unit of this embodiment.
FIG. 5A shows a normal case, and FIG.
(C), the decoding unit becomes defective
301, a primary decoding unit, 302
Is a secondary decoding unit, and 303 is a flash memory section.
Data. In the figure, the flash memory
If the sector is normal, as shown in FIG.
The code part 301 is used as the decoded value of the address of the sector 0.
And outputs the address "0000h" to the secondary decoding unit 3.
02 is the physical address as the decoded value of “0000h”
"5555h" is output and the sector of the flash memory is output.
0 physical address is specified. Where the flash
・ The number of erasures of the memory exceeds the limit and the sector becomes defective.
The physical address of sector 0 is reserved for address 8888h.
When switching to a ready sector, as shown in FIG.
As described above, the secondary decoding unit 302 is rewritten to “0000”
h ”from“ 5555h ”to“ 8888h ”
Switch to As a result, the physical address is set as sector 0.
"8888h" is assigned. As above
And how many times the secondary decoding unit (or primary decoding unit)
Overwriting limit value by rewriting,
Next decoding unitButWhen it becomes defective, as shown in FIG.
The primary decoding section 301 is rewritten and its decoded value
Stagger. That is,Secondary decoding section 302 decodes
"2222h" which outputs "8888h" as the value is
Output as code valuePrimary decoding section 301To
rewrite. As a result, the secondary decoding unit 302 is defective.
The physical address "8888h"
Can be output as As described above, the decoding unit is divided into two stages,
If one of the decoding units becomes defective, the other decoding unit
Rewrite the section to square the life of the decoding section
can do. For example, until a sector becomes bad
Number of times L (rewrite limit value), secondary decoding unit is defective
The number of times until it becomes M (rewrite limit value), primary deco
The number of times until the card part becomes defective is N times (rewrite limit
Value), the number of times until the address becomes an error is N
× M × L times. Basically, the rewrite limit is flash
100,000 to 1,000,000 times in EEPROM, and in EEPROM
It is said to be about 10,000 times, so the decoding part is actually
Just by two stages, sufficient reliability can be secured
You. F. Write time estimation process In flash memory, writing data
When saving, it is necessary to perform evacuation processing, etc.
It takes longer to write than in the case of. In this embodiment,
The write time to the flash memory and estimate the power consumption.
An embodiment is shown in which force estimation, abnormality detection, and the like are performed. Figure
51 shows a schematic configuration of the entire system of the present embodiment. 1 is
The storage device 1a cannot be overwritten and
Data can only be erased in predetermined units, such as
Cannot be configured, such as a flash memory
Storage area, 1b is a controller, 2 is a main processor
It is. Next, this embodiment will be described. Now storage
Is in the state shown in FIG.
Let us consider the case of writing data in the data. First, the book in FIG.
The number of sectors to be written is sent to the processor 22 from the body. Writing
When the number of sectors to be included is sent to the processor 22, the processor
Then, the write time is obtained from the number of sectors to be written. This
Here, when there is no block to be written as shown in FIG.
Since the save operation is performed, the write time t is
I will be asked. t = [time required for writing one sector] × 3 + [data
Evacuation time] (seconds) Processor 22 calculates the write time as described above
And return it to the main unit. The main unit uses the writing time
The power consumption W1 at the time of the write operation is obtained by the following equation. W1 = t ÷ 3600 × [power consumption of write operation]
(W) The main body reads the remaining power W2 from the power supply.
Compared with the obtained write power, and if W2> W1,
Write data. On the other hand, the body is
The obtained writing time t is compared with the actual writing time.
When the writing is not completed even after the writing time t
Determines that the storage device is abnormal, and notifies the user, for example.
Or take measures such as stopping the writing process. FIG. 53 shows the processing of the main body in this embodiment.
This flowchart is used to explain the present embodiment.
You. In step S1, the data to be written
Send the size to storage and get time to write
You. In step S2, the time required for writing,
Power consumption per hour by writing power
obtain. In step S3, the remaining power and
Compare the power used, and if the remaining power is less,
Perform error processing. If the remaining power is more,
Go to step S4 and write data, go to step S5
The actual writing time is longer than expected
It is determined whether or not it is, and if there is more, an abnormal process is performed. Also, calligraphy
If the recording time is within the expected time, step S
6 to determine whether or not the writing is completed,
If not, the process returns to step S5, and when writing is completed.
If so, the process ends. As described above, in this embodiment, the writing
The power required for writing
Since it is estimated, whether writing can be done with the remaining power
Can be determined. For this reason, battery drive
Power is lost during writing
Can be prevented from being interrupted on the way.
System reliability can be improved. Also, the actual book
By comparing the writing time with the estimated writing time,
Can detect abnormalities in the storage device,
By notifying the user by displaying the
This allows the user to determine the abnormality of the storage device.
You. G. Improvement of reliability in flag judgment processing Normally, a flag is determined by assigning one bit to one function.
It is often specified. However, the flash menu
A fatal accident that the memory cannot be erased due to over-erasure
It has a good cause structurally.
It falls into a state where it does not return to the low level while staying at the low level.
Therefore, the flag on the flash memory is set to 1 bit 1 bit.
If the function was supported, the bit became defective.
Sometimes, the validity of the flag is lost. This embodiment
Is on the flash memory as shown in FIG.
Flags for erase flags, bad flags, parity, etc.
Multiple flags and determine the flag by logical product.
Address the structural disadvantages of flash memory described above
And shows an embodiment in which the reliability of flag determination is improved.
You. (1) Embodiment 1 FIG. 54 is a diagram showing the first embodiment, and FIG.
Register, (b) is an AND circuit for determination, (c) is
4 shows a truth table. In this embodiment, FIG.
As shown in (a), the flag b0,
Prepare b4 and store it in the flag register. And
When performing the lag determination, as shown in FIG.
By determining the logical product of the flags of
Get fruit. Since the determination is made as described above, FIG.
Bit b0 is fixed at a high level as in row number 2 of
However, as a result of the logical product, a correct result can be obtained.
Can be. Similarly, as in row number 3, bit b4 is
Even if it is fixed at a high level,
Can get the correct result. (2) Embodiment 2 FIG. 55 shows a second embodiment, and FIG. 55 (a) shows the first embodiment.
A flag register, (b) is a second flag register,
(C) shows an AND circuit for performing flag determination. Book
Embodiments use different flag registers for flags for the same function.
The data is stored in the data as shown in FIG.
The flag is stored in bit b0 of the first flag register,
Bit b0 of the second flag register shown in FIG.
The bit stored in the first flag register in bit b2 is
The flags corresponding to the same function are stored. And
When the flag is determined, the logical multiplication shown in FIG.
The logical product of the flags is obtained by the path. In this embodiment
However, as in the first embodiment, some of the flags are fixed at a high level.
Even if it is determined, a correct determination result can be obtained. More than
As described above, in the present embodiment, the determination of the flag is performed by a plurality of bits.
All bits are defective.
Unless it is necessary, the correct judgment value can always be output,
The reliability of the flag determination can be improved. H. Management table savings In this embodiment, the storage device is composed of a plurality of chips, and each chip
Flash memory with multiple blocks inside
In the system, the management table is simplified and
Example where each block can be used on average
Is shown. In the embodiment described above, data is
There are no restrictions on the chips and blocks to be written, and data is
Because the lock sector could be written, the entire area was
Although it was necessary to provide a table to manage,
The data to be written in each chip is fixed,
Move the block to be written in the
Data writing without having to manage the entire area.
Flash memory management
It simplifies and averages the use of each block.
You. Also, in the present embodiment, the
Data is smaller than the total capacity of the chip by a certain amount.
Quantitative blocks when work blocks and bad blocks occur
Relief block. And the data in the block
The sequence of data is fixed, and when rewriting data,
If there is valid data in the old block in
The data is saved in the SRAM 23 shown in FIG.
Write to the empty area along with the new data and write
Erase old data block if successful
are doing. Next, this embodiment will be described. FIG. 56 shows the present embodiment.
FIG. 7 is a diagram showing a configuration in a chip, a block, and a sector in an example.
Yes, as shown in the figure, the chip is 2 Mbytes,
No. of 4Kbyte per block. 000-No. 511
Is divided into 512 blocks, and in each block,
No. of 528 bytes in one sector. 00-No. 07 8
Is provided. The block No. in FIG. You
And sector No. Indicates a physical address. Further
In the sector, as shown in the figure, the actual data of 256 bytes
Data area, ECC area for Long instruction, defective data file
Lag, bad block flag, block address, 256byt
e is provided with an actual data area ECC area. Bro
Block address stored in the SRAM 23.
Indicates the address value of the block pointer and the block address.
Sectors that have been determined to have no actual data to be written.
And In this way, hot-line insertion and removal
When the number of sector addresses is large, it is determined that the data is normal
be able to. If the number of sector addresses is equal,
Judgment is made based on the correctness of ECC and checksum. Bad block
The flag indicates the condition of the block.
Fh: normal block, $ FFh: bad block
You. Bad data flag indicates data condition
Normal data at FFh, bad data at FFh
And ECC area for Long instruction is up to 4 bytes
It is. The ECC area indicates the condition of the actual data.
Data correction and error
Perform detection. FIGS. 57 to 61 show the writing in this embodiment.
FIG. 9 is a diagram showing only processing, and the present embodiment will be described with reference to FIG.
You. In this embodiment, the chip is No. 00-No.
04, 5 pieces each with 4 work blocks
The writing and management method in the case is shown. FIG.
This shows the state where all blocks have been erased.
Thus, each chip has a work block of work 01 to 0
4 are provided, and the data is the above work block
It is written to work01-04. Write is sector
This is possible in units, but after writing sector 005,
After writing the upper sector, such as writing data 004
Cannot write to the lower sector. Also, insert the tip
Data does not move beyond
The order of the data is fixed. Further, for example, logical blocks
Write only sectors 000-005 to address 00
Write data does not fill all eight sectors
Write data in sectors 000-005
Then, only the block address is written in sectors 006 and 007.
Get in. In this case, one block is composed of eight sectors.
Also, since there are five chips, the logical address n
The data is obtained by dividing the quotient of (logical address n ÷ 8) by 5.
Is written to the remaining chips obtained when example
For example, when n = 121, 121 ÷ 8 is 15 and the remainder is 1
15 ÷ 5 is 5 and the remainder is 0. 00 of
Written to the chip. The data write processing in this embodiment is
It is performed as follows. First, all the blocks shown in FIG.
From the erased state, the sector No. 000-039 (Logical
FIG. 58 shows the result of continuous writing of 40 sectors
Data is written to work01 of each chip as shown
It is. That is, the sector No. to be written first. 00
Since the logical block address of 00 to 007 is 00, the main body
From the SRAM 23 to the SRAM 23. 000-007 days
Transfer the chip No. 00 write pointer
Data is written from the indicated work01. Note that the logical block
Lock addresses are managed in chip units. And this
In the case of, the logical block address 00 does not exist in the past.
Therefore, chip No. Work01 of 00 is work0
Move to the free area next to 4. 8 sector write
Upon completion, the write pointer is set to the chip No. 01 w
ork01, and sector No. 008
Write the data of .about.015 to work01. As described above, writing is performed on chip N
o. 04, the write pointer is set to chip N
o. It moves to work02 of 00. Next, as shown in FIG.
From the state, as shown in FIG. 120-19
Continuous writing of 72 sectors of 1 (logical address)
You. In the same manner as described above, the sector number is stored in the SRAM 23 from the main unit.
The data of the sector Nos. 12
Since 0 to 127 have a logical block address of 03,
No. Is work02 pointed to by the 00 write pointer?
Write the data. Then, as described above, the chip N
o. 00 work02 and work03 work01
Move to the next free space. Similarly, the sector No.
The data of 128 to 191 is stored in the chip No. 00-No. 0
Write to 4. Here, from the state of FIG.
o. When two sectors 002 to 003 are continuously written,
As shown in FIG. First, the sector is stored in the SRAM 23.
No. 002 to 003 are transferred. in this case,
If the write data is a sector No. Since it is 002-003,
Logical block address 00 is specified, which is
Therefore, it is determined that the old data needs to be saved. Ma
If the write data is a sector No. 002-003,
Not written from the beginning of logical block address 00
The data of the old logical block address 00 is stored in the SRAM2
Evacuate to 3. Note that the write data is
When two sectors from the beginning of the address
Data of the old logical block address after processing the data first
Is performed. Next, the old data 0 saved in the SRAM 23
00, 001, 004, 005, 006, 007 and new data
Data 002, 003 and the chip N indicated by the write pointer
o. Write to work04 of 00. At that time, write
Is 000,001,002,003,004,005,
Write in the order of 006 and 007. Next, the logical block
Since address 00 already exists, the old logical block
Erases the block address. In addition, old work04
Move to logical block address 00. As mentioned above,
Power is turned off after continuous writing
When turned ON again, as shown in FIG.
The block is specified after the used block. Also,
Specify the work block as described above,
Unable to specify all work blocks even when searching to the end
If it does, return to the beginning of the chip and
Is specified. In the above process, a block erase error
When the error occurs, 00h is set to the defect flag and
Block cannot be written or read. sand
In other words, by coping with one work block,
When there are no more work blocks, the system will write
Not allowed. Also, an error occurred during data backup
In this case, write the data after setting the bad data flag.
Get in. In the read operation, an error occurs in that block.
Is detected, the block is regarded as a bad block.
Do not treat. If a data write error occurs,
The block is regarded as a bad block. Setting a bad flag
Save the data that has been written once,
Set the flag only and write again. Bad block hula
In the same way as normal writing, write
Stand up against. If an error is detected during data deletion
In that case, the block is regarded as a bad block. Bad bro
How to set the check flag, set only the bad block flag.
Instead, write ALL [00] including actual data.
Get in. Defect processing is performed on all sectors of the block.
Do. As described above, in this embodiment, each channel
The data to be written in the chip is fixed,
Since the block to be written is moved and written,
There is no need to manage the area. For this reason, the data is
Only need to be managed within the server, saving management tables
And the speed of the write operation can be increased.
You. Also, write data to the work block,
Since the block is configured to move within the chip,
Each block can be used on average. [0072] As described above, according to the present invention,
Has two stages of decoders, and a part of the storage area of the storage device is
When destroyed or when part of the decorator was destroyed
Two-stage decodingDaDestroyed by rewriting
Since decoding to parts is not performed, decoding
One such as EEPROM, flash memory, etc.
When using a storage medium that may cause
Even reduce the probability of address errors
And reliability can be ensured.

【図面の簡単な説明】 【図1】本発明の全体の概略構成を示す原理図である。 【図2】本発明の概要を示す原理図(1)である。 【図3】本発明の概要を示す原理図(2)である。 【図4】本発明の概要を示す原理図(3)である。 【図5】本発明の前提となる記憶装置の構成を示すブロ
ック図である。 【図6】記憶装置におけるSRAMの内容を示す図であ
る。 【図7】記憶装置におけるフラッシュ・メモリの内容を
示す図である。 【図8】記憶装置におけるフラッシュ・メモリの内容を
示す図(続き)である。 【図9】記憶装置における書き込み時の処理を示すフロ
ーチャートである。 【図10】記憶装置における書き込み時の処理を示すフ
ローチャート(続き)である。 【図11】記憶装置における書き込み時の処理を示すフ
ローチャート(続き)である。 【図12】記憶装置における書き込み時の処理を示すフ
ローチャート(続き)である。 【図13】記憶装置における書き込み時の処理を示すフ
ローチャート(続き)である。 【図14】消去回数のバラツキを抑える実施例を示す図
である。 【図15】消去回数のバラツキを抑える実施例を示す図
(続き)である。 【図16】消去回数のバラツキを抑える実施例を示す図
(続き)である。 【図17】消去回数のバラツキを抑える実施例を示す図
(続き)である。 【図18】消去回数のバラツキを抑える実施例を示す図
(続き)である。 【図19】消去回数のバラツキを抑える実施例の処理を
示すフローチャートである。 【図20】消去可能データをなくす処理の実施例を示す
図である。 【図21】消去可能データをなくす処理の実施例を示す
図(続き)である。 【図22】消去可能データをなくす処理の実施例を示す
図(続き)である。 【図23】消去可能データをなくす処理の実施例を示す
図(続き)である。 【図24】消去可能データをなくす処理の実施例を示す
フローチャートである。 【図25】空き領域の作成処理の実施例を示す図であ
る。 【図26】空き領域の作成処理の実施例を示す図(続
き)である。 【図27】空き領域の作成処理の実施例を示す図(続
き)である。 【図28】空き領域の作成処理の実施例を示す図(続
き)である。 【図29】空き領域の作成処理の実施例を示す図(続
き)である。 【図30】空き領域の作成処理の実施例を示す図(続
き)である。 【図31】空き領域の作成処理の実施例を示す図(続
き)である。 【図32】空き領域の作成処理の実施例のフローチャー
トである。 【図33】消去処理の実施例を示す図である。 【図34】消去処理の実施例を示す図(続き)である。 【図35】消去処理の実施例のフローチャートである。 【図36】書き込み速度の向上を図る実施例のシステム
構成を示す図である。 【図37】書き込み速度の向上を図る第1の実施例を示
す図である。 【図38】書き込み速度の向上を図る第1の実施例を示
す図(続き)である。 【図39】書き込み速度の向上を図る第2の実施例を示
す図である。 【図40】書き込み速度の向上を図る第2の実施例を示
す図(続き)である。 【図41】書き込み速度の向上を図る第3の実施例を示
す図である。 【図42】書き込み速度の向上を図る第3の実施例を示
す図(続き)である。 【図43】書き込み速度の向上を図る第4の実施例を示
す図である。 【図44】書き込み速度の向上を図る第4の実施例を示
す図(続き)である。 【図45】書き込み速度の向上を図る第5の実施例を示
す図である。 【図46】書き込み速度の向上を図る第5の実施例を示
す図(続き)である。 【図47】書き込み速度の向上を図る実施例のフローチ
ャートである。 【図48】書き込み速度の向上を図る実施例のフローチ
ャート(続き)である。 【図49】書き込み速度の向上を図る実施例のフローチ
ャート(続き)である。 【図50】アドレス変換用デコード部を2段とした実施
例を示す図である。 【図51】書き込み時間の推定処理を行うシステム全体
の概略構成を示す図である。 【図52】書き込み時間推定処理の実施例における記憶
領域の状態を示す図である。 【図53】書き込み時間推定処理の実施例のフローチャ
ートである。 【図54】フラグ判定処理の第1の実施例を示す図であ
る。 【図55】フラグ判定処理の第2の実施例を示す図であ
る。 【図56】管理テーブルを節約する実施例における記憶
領域の構成を示す図である。 【図57】管理テーブルを節約する実施例を示す図であ
る。 【図58】管理テーブルを節約する実施例を示す図(続
き)である。 【図59】管理テーブルを節約する実施例を示す図(続
き)である。 【図60】管理テーブルを節約する実施例を示す図(続
き)である。 【図61】管理テーブルを節約する実施例を示す図(続
き)である。 【符号の説明】 1,20 記憶装置 1a 記憶領域 1b 一次記憶媒体 1c 制御手段 1d,1e デコード・テーブル 2 本体処理装置 21 コントローラLSI 22 プロセッサ 23 SRAM 24 クロック発振器 25−1〜25−5 フラッシュ・メモリ 26 EEPROM 261 セクタ変換部 301 1次デコード部 302 2次デコード部
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a principle diagram showing an overall schematic configuration of the present invention. FIG. 2 is a principle diagram (1) showing an outline of the present invention. FIG. 3 is a principle diagram (2) showing an outline of the present invention. FIG. 4 is a principle view (3) showing an outline of the present invention. FIG. 5 is a block diagram showing a configuration of a storage device as a premise of the present invention. FIG. 6 is a diagram showing the contents of an SRAM in the storage device. FIG. 7 is a diagram showing the contents of a flash memory in a storage device. FIG. 8 is a diagram (continued) showing the contents of the flash memory in the storage device. FIG. 9 is a flowchart illustrating a writing process in the storage device. FIG. 10 is a flowchart (continued) showing a write process in the storage device. FIG. 11 is a flowchart (continued) showing processing at the time of writing in the storage device. FIG. 12 is a flowchart (continued) showing processing at the time of writing in the storage device. FIG. 13 is a flowchart (continued) showing processing at the time of writing in the storage device. FIG. 14 is a diagram showing an embodiment for suppressing variation in the number of times of erasing. FIG. 15 is a diagram (continued) showing an embodiment for suppressing variation in the number of erasures. FIG. 16 is a diagram (continued) showing an embodiment for suppressing variation in the number of erasures. FIG. 17 is a diagram (continued) showing an embodiment for suppressing variations in the number of erasures. FIG. 18 is a diagram (continued) showing an embodiment for suppressing variation in the number of erasures. FIG. 19 is a flowchart illustrating a process according to an embodiment for suppressing variation in the number of erasures. FIG. 20 is a diagram showing an embodiment of a process for eliminating erasable data. FIG. 21 is a diagram (continued) showing an embodiment of a process for eliminating erasable data. FIG. 22 is a diagram (continued) illustrating an embodiment of a process for eliminating erasable data. FIG. 23 is a diagram (continued) showing an embodiment of a process for eliminating erasable data. FIG. 24 is a flowchart showing an embodiment of a process for eliminating erasable data. FIG. 25 is a diagram showing an embodiment of a free area creation process. FIG. 26 is a diagram (continued) illustrating an embodiment of a process of creating a free area; FIG. 27 is a diagram (continued) illustrating an embodiment of a process of creating a free area; FIG. 28 is a diagram (continued) illustrating an embodiment of a process of creating a free area; FIG. 29 is a diagram (continued) illustrating an embodiment of a process of creating a free area; FIG. 30 is a diagram (continued) illustrating an embodiment of a process of creating a free area; FIG. 31 is a diagram (continued) illustrating an embodiment of a process of creating a free area; FIG. 32 is a flowchart of an embodiment of a process of creating a free area. FIG. 33 is a diagram illustrating an example of an erasing process. FIG. 34 is a diagram (continued) illustrating an example of an erasing process. FIG. 35 is a flowchart of an embodiment of an erasing process. FIG. 36 is a diagram showing a system configuration of an embodiment for improving a writing speed. FIG. 37 is a diagram showing a first embodiment for improving the writing speed. FIG. 38 is a diagram (continued) showing the first embodiment for improving the writing speed. FIG. 39 is a diagram showing a second embodiment for improving the writing speed. FIG. 40 is a diagram (continued) showing a second embodiment for improving the writing speed. FIG. 41 is a diagram showing a third embodiment for improving the writing speed. FIG. 42 is a diagram (continued) showing a third embodiment for improving the writing speed. FIG. 43 is a diagram showing a fourth embodiment for improving the writing speed. FIG. 44 is a diagram (continued) showing a fourth embodiment for improving the writing speed. FIG. 45 is a diagram showing a fifth embodiment for improving the writing speed. FIG. 46 is a diagram (continued) showing a fifth embodiment for improving the writing speed. FIG. 47 is a flowchart of an embodiment for improving the writing speed. FIG. 48 is a flowchart (continued) of the embodiment for improving the writing speed. FIG. 49 is a flowchart (continued) of the embodiment for improving the writing speed. FIG. 50 is a diagram showing an embodiment in which the address conversion decoding unit has two stages. FIG. 51 is a diagram showing a schematic configuration of an entire system for performing a writing time estimation process. FIG. 52 is a diagram illustrating a state of a storage area in the embodiment of the writing time estimation processing. FIG. 53 is a flowchart of an example of a writing time estimation process. FIG. 54 is a diagram illustrating a first example of a flag determination process. FIG. 55 is a diagram illustrating a second example of the flag determination process. FIG. 56 is a diagram showing a configuration of a storage area in an embodiment for saving a management table. FIG. 57 is a diagram showing an embodiment for saving the management table. FIG. 58 is a diagram (continued) showing an embodiment for saving the management table; FIG. 59 is a diagram (continued) showing an embodiment for saving the management table; FIG. 60 is a diagram (continued) showing an embodiment for saving the management table. FIG. 61 is a diagram (continued) showing an embodiment for saving the management table. [Description of Signs] 1,20 Storage device 1a Storage area 1b Primary storage medium 1c Control means 1d, 1e Decoding table 2 Main body processing device 21 Controller LSI 22 Processor 23 SRAM 24 Clock oscillator 25-1 to 25-5 Flash memory 26 EEPROM 261 Sector converter 301 Primary decoder 302 Secondary decoder

───────────────────────────────────────────────────── フロントページの続き (72)発明者 林 朋弘 神奈川県横浜市中区本町4丁目36番地 株式会社富士通コンピュータテクノロジ 内 (72)発明者 柴崎 省吾 神奈川県横浜市中区本町4丁目36番地 株式会社富士通コンピュータテクノロジ 内 (72)発明者 伊藤 裕之 神奈川県横浜市中区本町4丁目36番地 株式会社富士通コンピュータテクノロジ 内 (72)発明者 竹原 勝 神奈川県横浜市中区本町4丁目36番地 株式会社富士通コンピュータテクノロジ 内 (56)参考文献 特開 平5−233470(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 12/16 G11C 16/06 G11C 29/00 ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Tomohiro Hayashi 4-36, Honcho, Naka-ku, Yokohama-shi, Kanagawa Prefecture Within Fujitsu Computer Technology Co., Ltd. (72) Inventor Shogo Shibasaki 4-36, Honcho, Naka-ku, Yokohama-shi, Kanagawa Prefecture Shares (72) Inventor Hiroyuki Ito 4-36 Honcho, Naka-ku, Yokohama-shi, Kanagawa Prefecture Fujitsu Computer Technology Co., Ltd. Masaru Takehara 4-36, Honcho, Naka-ku, Yokohama-shi, Kanagawa Prefecture Fujitsu Computer Ltd. (56) References JP-A-5-233470 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 12/16 G11C 16/06 G11C 29/00

Claims (1)

(57)【特許請求の範囲】 【請求項1】 読み書きが可能で、かつ、記憶領域の一
部が破壊する可能性のある記憶領域と、記憶領域中のデ
ータが記憶されている場所を示す書き換え可能なデコー
ダとを備えた記憶装置の制御方法であって、上記 デコーダとして、上記記憶領域のアドレスを出力す
る2次デコード部と、2次デコード部のアドレスを出力
する1次デコード部を設け、 記憶装置の記憶領域の一部が破壊したとき、上記2次デ
コード部のアドレスを書き換えて、破壊した部分へのデ
コードを行われないようにし、 上記2次デコード部が破壊したとき、1次デコード部を
書き換えて、 破壊した部分へのデコードを行われないよ
うにしたことを特徴とする記憶装置の制御方法。
(57) [Claims 1] A storage area that is readable and writable and that may partially destroy the storage area, and a place where data in the storage area is stored a method of controlling a memory device having a rewritable decoder, as the decoder, to output the address of the storage area
Output the secondary decoding unit and the address of the secondary decoding unit
A primary decoding unit is provided that performs the above-mentioned secondary decoding when a part of the storage area of the storage device is destroyed.
Rewrite the address in the code section to
Code is not executed, and when the secondary decoding unit is destroyed, the primary decoding unit is
A method for controlling a storage device, wherein rewriting is performed so that decoding of a destroyed portion is not performed.
JP2000347526A 2000-11-15 2000-11-15 Method of controlling storage device Expired - Lifetime JP3390740B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000347526A JP3390740B2 (en) 2000-11-15 2000-11-15 Method of controlling storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000347526A JP3390740B2 (en) 2000-11-15 2000-11-15 Method of controlling storage device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP24654793A Division JP3215237B2 (en) 1993-10-01 1993-10-01 Storage device and method for writing / erasing storage device

Publications (2)

Publication Number Publication Date
JP2001188712A JP2001188712A (en) 2001-07-10
JP3390740B2 true JP3390740B2 (en) 2003-03-31

Family

ID=18821239

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000347526A Expired - Lifetime JP3390740B2 (en) 2000-11-15 2000-11-15 Method of controlling storage device

Country Status (1)

Country Link
JP (1) JP3390740B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004227723A (en) 2003-01-27 2004-08-12 Renesas Technology Corp Nonvolatile semiconductor storage device

Also Published As

Publication number Publication date
JP2001188712A (en) 2001-07-10

Similar Documents

Publication Publication Date Title
JP3215237B2 (en) Storage device and method for writing / erasing storage device
US8312204B2 (en) System and method for wear leveling in a data storage device
JP3078946B2 (en) Managing method of batch erase nonvolatile memory and semiconductor disk device
US7191306B2 (en) Flash memory, and flash memory access method and apparatus
JP4058322B2 (en) Memory card
EP2162822B1 (en) Emerging bad block detection
CN110175001B (en) NOR-FLASH data storage method, computer equipment and storage medium
US6865658B2 (en) Nonvolatile data management system using data segments and link information
JP2005301591A (en) Device with nonvolatile memory, and memory controller
US7802072B2 (en) Data storage device, memory management method and program for updating data recorded in each of a plurality of physically partitioned memory areas
US8527733B2 (en) Memory system
US20070005929A1 (en) Method, system, and article of manufacture for sector mapping in a flash device
CN111124294B (en) Sector mapping information management method and device, storage medium and equipment
JP3390740B2 (en) Method of controlling storage device
JP2002014776A (en) Disk control system and data rearranging method
EP2267725A1 (en) Memory device for managing the recovery of a non volatile memory
JP3573706B2 (en) Method for writing / erasing storage device
CN111324549A (en) Memory and control method and device thereof
JP3362031B2 (en) Method for writing / erasing storage device
JP2001188711A (en) Method for judging flag of storage device
US7330955B2 (en) Recovery record for updating a system configuration
JP2001188713A (en) Method for managing storage device
JP2008112455A (en) Memory card
JP2009217754A (en) Memory system
JP4637524B2 (en) Memory card

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20030107

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

Free format text: PAYMENT UNTIL: 20080117

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090117

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100117

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110117

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110117

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120117

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20130117

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130117

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20140117

Year of fee payment: 11

EXPY Cancellation because of completion of term