JP3070539B2 - External storage device, data processing device, and data processing method - Google Patents

External storage device, data processing device, and data processing method

Info

Publication number
JP3070539B2
JP3070539B2 JP9267178A JP26717897A JP3070539B2 JP 3070539 B2 JP3070539 B2 JP 3070539B2 JP 9267178 A JP9267178 A JP 9267178A JP 26717897 A JP26717897 A JP 26717897A JP 3070539 B2 JP3070539 B2 JP 3070539B2
Authority
JP
Japan
Prior art keywords
data
block
processing device
logical address
management information
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 - Fee Related
Application number
JP9267178A
Other languages
Japanese (ja)
Other versions
JPH11110300A (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.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP9267178A priority Critical patent/JP3070539B2/en
Publication of JPH11110300A publication Critical patent/JPH11110300A/en
Priority to JP34682699A priority patent/JP3640154B2/en
Application granted granted Critical
Publication of JP3070539B2 publication Critical patent/JP3070539B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、記憶領域が複数の
ブロックに分割されてなる外部記憶装置に関する。ま
た、本発明は、記憶領域が複数のブロックに分割されて
なる外部記憶装置にデータを格納するデータ処理装置に
関する。また、本発明は、記憶領域が複数のブロックに
分割されてなる外部記憶装置にデータを格納する際のデ
ータ処理方法に関する。
The present invention relates to an external storage device in which a storage area is divided into a plurality of blocks. The present invention also relates to a data processing device that stores data in an external storage device in which a storage area is divided into a plurality of blocks. The present invention also relates to a data processing method for storing data in an external storage device in which a storage area is divided into a plurality of blocks.

【0002】[0002]

【従来の技術】パーソナルコンピュータやデジタルスチ
ルカメラ等のようなデータ処理装置に用いられる外部記
憶装置として、フラッシュメモリを備えた外部記憶装置
がある。
2. Description of the Related Art As an external storage device used for a data processing device such as a personal computer or a digital still camera, there is an external storage device having a flash memory.

【0003】フラッシュメモリを備えた外部記憶装置
は、記憶領域を複数のブロックに分割し、データ領域の
管理をブロック単位で行う。ここで、各ブロックはデー
タ消去の単位となる。すなわち、データを消去する際
は、当該データを含むブロック全体に対して初期化処理
を施す。これにより、当該ブロックに格納されているデ
ータが一括して消去される。
An external storage device provided with a flash memory divides a storage area into a plurality of blocks, and manages a data area in units of blocks. Here, each block is a unit of data erasure. That is, when erasing data, an initialization process is performed on the entire block including the data. Thereby, the data stored in the block is erased collectively.

【0004】このような外部記憶装置では、データをブ
ロックに格納するときに、それらのブロックに対してユ
ニークな論理アドレスが設定される。そして、各ブロッ
クは、この論理アドレスを用いて管理される。
In such an external storage device, when data is stored in blocks, unique logical addresses are set for those blocks. Each block is managed using this logical address.

【0005】また、外部記憶装置に格納されるデータ
は、通常、ファイル単位で外部記憶装置に格納される
が、一つのファイルが複数のブロックにわたる場合に
は、それらのブロックの連結情報が必要となる。そこ
で、一つのファイルが複数のブロックにわたる場合に
は、当該ファイルを格納しているブロックのそれぞれ
に、次のブロックの論理アドレス(以下、連結アドレス
と称する。)が格納される。
[0005] Data stored in the external storage device is usually stored in the external storage device in file units. However, when one file covers a plurality of blocks, connection information of those blocks is required. Become. Therefore, when one file extends over a plurality of blocks, the logical address of the next block (hereinafter, referred to as a concatenated address) is stored in each of the blocks storing the file.

【0006】[0006]

【発明が解決しようとする課題】従来、このような外部
記憶装置では、記憶領域内にエラーがあるか否かを検査
する処理や、エラーがあった場合に当該エラーの修復を
試みる処理を、外部記憶装置の起動時に毎回実行するよ
うにしていた。なお、以下の説明では、このような処理
のことを、エラー検出訂正処理と称する。通常、このよ
うなエラー検出訂正処理は、比較的に負荷が大きく処理
に時間を要する処理である。したがって、従来の外部記
憶装置は、エラー検出訂正処理のために、速やかに起動
することができないという問題があった。
Conventionally, in such an external storage device, processing for checking whether or not there is an error in a storage area, and processing for trying to repair the error when there is an error, have been proposed. It is executed every time the external storage device is started. In the following description, such processing is referred to as error detection and correction processing. Usually, such an error detection and correction process is a process that requires a relatively large load and takes a long time. Therefore, there has been a problem that the conventional external storage device cannot be started immediately due to the error detection and correction processing.

【0007】また、データ領域の管理をブロック単位で
行うような外部記憶装置では、ブロックにデータを新規
に書き込んでいるときや、ブロックに格納されているデ
ータを更新しているときなどに、いきなり電源が遮断さ
れたり、データ処理装置から外部記憶装置が強制的に取
り外されたりしたような場合に、同じ論理アドレスを持
つ複数のブロックが同時に存在するような状態(以下、
論理アドレスエラーと称する。)となったり、連結アド
レスで指し示されたブロックが存在しないような状態
(以下、連結アドレスエラーと称する。)となったりす
る可能性がある。当然の事ながら、このような状態にな
ると、ファイルが予期せぬブロックに連結されてしまっ
たりして、外部記憶装置を正常に使用することができな
くなってしまう。
In an external storage device in which data area management is performed in block units, when data is newly written to a block or when data stored in a block is updated, the data is suddenly stored. When the power supply is cut off or the external storage device is forcibly removed from the data processing device, a state in which a plurality of blocks having the same logical address exist at the same time (hereinafter, referred to as a “block”).
This is called a logical address error. ) Or a state in which the block indicated by the link address does not exist (hereinafter, referred to as a link address error). Naturally, in such a state, the file is linked to an unexpected block, and the external storage device cannot be used normally.

【0008】しかしながら、従来の外部記憶装置は、論
理アドレスエラーや連結アドレスエラーを検出して適切
に修復するような機能を備えていなかった。そのため、
従来は、いきなり電源が遮断されたり、データ処理装置
から外部記憶装置が強制的に取り外されたりしたような
場合に、その後、外部記憶装置を正常に使用することが
できなくなってしまうことがあった。
However, the conventional external storage device does not have a function of detecting a logical address error or a linked address error and appropriately recovering the error. for that reason,
Conventionally, when the power supply was suddenly cut off or the external storage device was forcibly removed from the data processing device, the external storage device could not be used normally thereafter. .

【0009】本発明は、以上のような従来の実情に鑑み
て提案されたものであり、外部記憶装置に論理アドレス
エラーや連結アドレスエラーが生じても、それらのエラ
ーを検出し適切に修復できるようにすることを目的とし
ている。
The present invention has been proposed in view of the above-described conventional circumstances. Even if a logical address error or a concatenated address error occurs in an external storage device, the error can be detected and appropriately corrected. It is intended to be.

【0010】[0010]

【課題を解決するための手段】本発明に係る外部記憶装
置は、データ処理装置に着脱可能に接続され、データ処
理装置からのデータを記憶する外部記憶装置であって、
データ処理装置とシリアルデータをやり取りするための
シリアルインターフェースと、データを格納する不揮発
性メモリとを備える。そして、不揮発性メモリは、一括
消去可能な複数のブロックに分割され、ブロックには、
論理アドレスと、ブロックに格納されたデータの新旧を
示す識別番号が格納され、同じ論理アドレスを持つ複数
のブロックが存在する場合には、識別番号に基づいて、
それらのブロックに格納されているデータの新旧が判別
され、新しい方のデータは無効なデータとされ、古い方
のデータが有効なデータとされる。
An external storage device according to the present invention is an external storage device that is detachably connected to a data processing device and stores data from the data processing device.
It has a serial interface for exchanging serial data with the data processing device, and a non-volatile memory for storing data. Then, the nonvolatile memory is divided into a plurality of blocks that can be erased at once, and the blocks include:
A logical address and an identification number indicating the new or old of the data stored in the block are stored. If there are a plurality of blocks having the same logical address, based on the identification number,
It is determined whether the data stored in these blocks is new or old, the newer data is invalid, and the old data is valid.

【0011】[0011]

【0012】また、本発明に係るデータ処理装置は、シ
リアルデータをやり取りするためのシリアルインターフ
ェースと、一括消去可能な複数のブロックに分割され、
ブロックにデータを格納する不揮発性メモリとを備える
外部記憶装置が着脱されるデータ処理装置であって、外
部記憶装置にデータを格納する際に、不揮発性メモリの
ブロックに、論理アドレスと、ブロックに格納されたデ
ータの新旧を示す識別番号を格納し、外部記憶装置から
データを読み出す際に、同じ論理アドレスを持つ複数の
ブロックが存在する場合には、識別番号に基づいて、そ
れらのブロックに格納されているデータの新旧を判別
し、新しい方のデータは無効なデータとし、古い方のデ
ータを有効なデータとする。
Further, the data processing device according to the present invention is divided into a serial interface for exchanging serial data, and a plurality of blocks which can be erased at once,
A data processing device to which an external storage device having a nonvolatile memory for storing data in a block is attached and detached. When storing data in the external storage device, a logical address and a logical address are stored in a block of the nonvolatile memory. Stores identification numbers indicating the old and new of the stored data, and when reading data from the external storage device, if there are multiple blocks with the same logical address, stores them in those blocks based on the identification numbers The old and new data is determined as invalid data, and the old data is determined as valid data.

【0013】[0013]

【0014】更に、本発明に係るデータ処理方法は、一
括消去可能な複数のブロックに分割された不揮発性メモ
リを有する外部記憶装置にデータを格納する際に、不揮
発性メモリのブロックに、論理アドレスと、ブロックに
格納されたデータの新旧を示す識別番号を格納し、外部
記憶装置からデータを読み出す際に、同じ論理アドレス
を持つ複数のブロックが存在する場合には、識別番号に
基づいて、それらのブロックに格納されているデータの
新旧を判別し、新しい方のデータは無効なデータとし、
古い方のデータを有効なデータとする。
Further, according to the data processing method of the present invention, when storing data in an external storage device having a nonvolatile memory divided into a plurality of blocks that can be erased at once, a logical address is stored in a block of the nonvolatile memory. And an identification number indicating the old and new of the data stored in the block, and when reading data from the external storage device, when there are a plurality of blocks having the same logical address, based on the identification number, The old and new data stored in the block is determined, and the newer data is regarded as invalid data.
The older data is regarded as valid data.

【0015】[0015]

【0016】[0016]

【発明の実施の形態】以下、本発明の実施の形態につい
て、図面を参照しながら詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0017】1.システムの全体構成 本発明が適用されるシステムの一例について、その全体
構成を図1に示す。このシステムは、ホスト側システム
となるデータ処理装置1と、シリアルインターフェース
を介してデータ処理装置1に接続される外部記憶装置で
あるメモリカード2とから構成される。
[0017] 1. Overall Configuration of System FIG. 1 shows the overall configuration of an example of a system to which the present invention is applied. This system includes a data processing device 1 serving as a host-side system, and a memory card 2 serving as an external storage device connected to the data processing device 1 via a serial interface.

【0018】[0018]

【0019】データ処理装置1は、演算処理装置(CP
U)3と、内部メモリ4と、補助記憶装置5と、シリア
ルインターフェース回路6とを備え、これらがバス7に
よって相互に接続されてなる。このデータ処理装置1
は、例えば、補助記憶装置5に格納されているプログラ
ムを読み出して、当該プログラムを、内部メモリ4をワ
ークエリアとして使用して、CPU3により実行する。
このとき、必要に応じて、シリアルインターフェース回
路6を介してメモリカード2との間でデータのやり取り
を行う。
The data processing device 1 includes an arithmetic processing device (CP
U) 3, an internal memory 4, an auxiliary storage device 5, and a serial interface circuit 6, which are interconnected by a bus 7. This data processing device 1
For example, the CPU 3 reads a program stored in the auxiliary storage device 5 and executes the program by using the internal memory 4 as a work area.
At this time, data is exchanged with the memory card 2 via the serial interface circuit 6 as necessary.

【0020】なお、本発明が適用されるシステムに使用
されるデータ処理装置1は、外部記憶装置との間でデー
タのやり取りが可能なものであるならば特に限定される
ものではなく、本発明は、パーソナルコンピュータ、デ
ジタルスチルカメラ、デジタルビデオカメラ等、種々の
データ処理装置に適用可能である。
The data processing device 1 used in the system to which the present invention is applied is not particularly limited as long as it can exchange data with an external storage device. Is applicable to various data processing devices such as a personal computer, a digital still camera, and a digital video camera.

【0021】データ処理装置1とメモリカード2とは、
シリアルインターフェースによって接続されており、具
体的には、少なくとも3本のデータ線SCLK,Sta
te,DIOによって接続される。すなわち、データ処
理装置1とメモリカード2とは、少なくとも、データ伝
送時にクロック信号を伝送する第1のデータ線SCLK
と、データ伝送時に必要なステータス信号を伝送する第
2のデータ線Stateと、メモリカード2に書き込む
データ又はメモリカード2から読み出すデータ等をシリ
アルに伝送する第3のデータ線DIOとによって接続さ
れ、これらを介して、データ処理装置1とメモリカード
2との間でのデータのやり取りを行う。
The data processing device 1 and the memory card 2
They are connected by a serial interface. Specifically, at least three data lines SCLK and Sta
te, DIO. That is, the data processing device 1 and the memory card 2 are connected to at least the first data line SCLK for transmitting a clock signal during data transmission.
And a second data line State for transmitting a status signal required for data transmission, and a third data line DIO for serially transmitting data to be written to the memory card 2 or data to be read from the memory card 2, Through these, data is exchanged between the data processing device 1 and the memory card 2.

【0022】データ処理装置1とメモリカード2との間
でのデータのやり取りは、通常、ヘッダーと実データと
から構成されるファイル単位で行われる。なお、ファイ
ルのヘッダーには、例えば、ファイルにアクセスするた
めの情報や、データ処理装置1で実行されるプログラム
で必要とされる情報等が格納される。
Data exchange between the data processing device 1 and the memory card 2 is usually performed in units of a file composed of a header and actual data. In the header of the file, for example, information for accessing the file, information required by a program executed by the data processing device 1, and the like are stored.

【0023】2.メモリカードの構成 メモリカード2は、図2に示すように、いわゆるコント
ロールICからなるコントローラ11と、コントローラ
11によって管理されるフラッシュメモリ12とを備え
ている。
[0023] 2. 2. Configuration of Memory Card As shown in FIG. 2, the memory card 2 includes a controller 11 composed of a so-called control IC and a flash memory 12 managed by the controller 11.

【0024】コントローラ11は、シリアル/パラレル
変換やパラレル/シリアル変換等を行うシリアル/パラ
レル・パラレル/シリアル・インターフェース・シーケ
ンサ13(以下、S/P&P/S・インターフェース・
シーケンサ13と称する。)と、フラッシュメモリ12
へのインターフェースを司るフラッシュメモリ・インタ
ーフェース・シーケンサ14と、S/P&P/S・イン
ターフェース・シーケンサ13とフラッシュメモリ・イ
ンターフェース・シーケンサ14との間でやり取りされ
るデータを一時的に記憶するページバッファ15と、エ
ラー訂正の処理を行うエラー訂正回路16と、フラッシ
ュメモリ12へのアクセスを制御する制御コマンドの生
成等を行うコマンドジェネレータ17と、このメモリカ
ード2のバージョン情報や各種属性情報等が格納されて
いるコンフィグレーションROM18と、各回路に対し
てそれらの動作に必要なクロック信号を供給する発振器
19とを備えている。
The controller 11 has a serial / parallel / parallel / serial interface sequencer 13 (hereinafter referred to as an S / P & P / S interface) for performing serial / parallel conversion, parallel / serial conversion, and the like.
Called sequencer 13. ) And the flash memory 12
And a page buffer 15 for temporarily storing data exchanged between the S / P & P / S interface sequencer 13 and the flash memory interface sequencer 14. An error correction circuit 16 for performing error correction processing, a command generator 17 for generating a control command for controlling access to the flash memory 12, etc., and version information and various attribute information of the memory card 2 are stored. A configuration ROM 18 and an oscillator 19 for supplying a clock signal necessary for the operation of each circuit.

【0025】S/P&P/S・インターフェース・シー
ケンサ13は、少なくとも上述した3本のデータ線SC
LK,State,DIOを介して、データ処理装置1
のシリアルインターフェース回路6に接続され、これら
のデータ線SCLK,State,DIOを介して、デ
ータ処理装置1との間でデータのやり取りを行う。すな
わち、S/P&P/S・インターフェース・シーケンサ
13は、ページバッファ15から送られてきたパラレル
データをシリアルデータに変換して、データ処理装置1
のシリアルインターフェース回路6へ送出する。また、
S/P&P/S・インターフェース・シーケンサ13
は、データ処理装置1のシリアルインターフェース回路
6から送られてきたシリアルデータをパラレルデータに
変換して、ページバッファ15へ送出する。
The S / P & P / S interface sequencer 13 includes at least the three data lines SC described above.
Data processing device 1 via LK, State, DIO
, And exchanges data with the data processing device 1 via these data lines SCLK, State, and DIO. That is, the S / P & P / S interface sequencer 13 converts the parallel data sent from the page buffer 15 into serial data, and
To the serial interface circuit 6. Also,
S / P & P / S interface sequencer 13
Converts the serial data sent from the serial interface circuit 6 of the data processing device 1 into parallel data and sends it to the page buffer 15.

【0026】このS/P&P/S・インターフェース・
シーケンサ13とデータ処理装置1との間でのシリアル
データの伝送は、第1のデータ線SCLKによってデー
タ処理装置1から送られてくるクロック信号によって同
期を取りながら、第3のデータ線DIOによって行われ
る。このとき、第3のデータ線DIOによってやり取り
されるシリアルデータのデータ種別は、第2のデータ線
Stateによって伝送されるステータス信号によって
判別される。ここで、シリアルデータの種別には、例え
ば、フラッシュメモリ12に書き込むべきデータ、フラ
ッシュメモリ12から読み出されたデータ、又はこのメ
モリカード2の動作を制御するための制御データ等があ
る。なお、ステータス信号は、メモリカード2の状態を
示すためにも使用される。ステータス信号によって示さ
れるメモリカード2の状態には、例えば、メモリカード
2が何らかの処理の最中でデータ処理装置1からのデー
タ入力を受け付けない状態や、メモリカード2の側での
処理が終了してデータ処理装置1からのデータ入力を待
っている状態等がある。
This S / P & P / S interface
Transmission of serial data between the sequencer 13 and the data processing device 1 is performed by the third data line DIO while synchronizing with the clock signal sent from the data processing device 1 by the first data line SCLK. Will be At this time, the data type of the serial data exchanged by the third data line DIO is determined by the status signal transmitted by the second data line State. Here, the types of serial data include, for example, data to be written to the flash memory 12, data read from the flash memory 12, control data for controlling the operation of the memory card 2, and the like. Note that the status signal is also used to indicate the state of the memory card 2. The state of the memory card 2 indicated by the status signal includes, for example, a state in which the memory card 2 is not accepting data input from the data processing device 1 during some processing, or a state in which the processing on the memory card 2 is completed. Waiting for data input from the data processing apparatus 1.

【0027】また、S/P&P/S・インターフェース
・シーケンサ13は、データ処理装置1から送られてき
たデータがメモリカード2の動作を制御するための制御
データである場合には、当該制御データをコマンドジェ
ネレータ17に送出する。
If the data sent from the data processing device 1 is control data for controlling the operation of the memory card 2, the S / P & P / S interface sequencer 13 transmits the control data The command is sent to the command generator 17.

【0028】コマンドジェネレータ17は、データ処理
装置1からS/P&P/S・インターフェース・シーケ
ンサ13を介して送られてきた制御データに基づいて、
フラッシュメモリ12へのアクセスを制御する制御コマ
ンドを生成し、当該制御コマンドをフラッシュメモリ・
インターフェース・シーケンサ14へ送出する。フラッ
シュメモリ・インターフェース・シーケンサ14は、後
述するように、この制御コマンドに基づいて、フラッシ
ュメモリ12にデータを書き込んだり、フラッシュメモ
リ12からデータを読み出したりする。
The command generator 17 is based on control data sent from the data processing device 1 via the S / P & P / S interface sequencer 13.
A control command for controlling access to the flash memory 12 is generated.
Send it to the interface sequencer 14. The flash memory interface sequencer 14 writes data to the flash memory 12 and reads data from the flash memory 12 based on the control command, as described later.

【0029】なお、このコマンドジェネレータ17に
は、誤消去防止スイッチ20が接続されている。そし
て、この誤消去防止スイッチ20がオンになっていると
きには、フラッシュメモリ12に書かれているデータを
消去するように指示する制御データがデータ処理装置1
から送られてきたとしても、コマンドジェネレータ17
は、フラッシュメモリ12に書かれているデータを消去
するような制御コマンドを生成しない。すなわち、この
メモリカード2は、誤消去防止スイッチ20によって、
フラッシュメモリ12に保存されているデータの消去が
行えない状態と、フラッシュメモリ12に保存されてい
るデータの消去が行える状態とを切り換えることが可能
となっている。
An erroneous erasure prevention switch 20 is connected to the command generator 17. When the erroneous erasure prevention switch 20 is turned on, control data instructing to erase data written in the flash memory 12 is transmitted to the data processing device 1.
Command generator 17
Does not generate a control command for erasing data written in the flash memory 12. In other words, this memory card 2 is
It is possible to switch between a state in which data stored in the flash memory 12 cannot be erased and a state in which data stored in the flash memory 12 can be erased.

【0030】S/P&P/S・インターフェース・シー
ケンサ13とフラッシュメモリ・インターフェース・シ
ーケンサ14との間に配されたページバッファ15は、
いわゆるバッファメモリであり、S/P&P/S・イン
ターフェース・シーケンサ13とフラッシュメモリ・イ
ンターフェース・シーケンサ14との間でやり取りされ
るデータを一時的に記憶する。
The page buffer 15 disposed between the S / P & P / S interface sequencer 13 and the flash memory interface sequencer 14
This is a so-called buffer memory, which temporarily stores data exchanged between the S / P & P / S interface sequencer 13 and the flash memory interface sequencer 14.

【0031】すなわち、S/P&P/S・インターフェ
ース・シーケンサ13からフラッシュメモリ・インター
フェース・シーケンサ14へ送られるデータは、先ず、
S/P&P/S・インターフェース・シーケンサ13か
らページバッファ15に送られて、このページバッファ
15によって一時的に記憶される。このとき、ページバ
ッファ15に記憶されたデータは、エラー訂正回路16
によってエラー訂正符号が付けられる。そして、エラー
訂正符号が付けられたデータは、ページバッファ15か
ら所定のページ単位毎(例えば1ページ=512バイト
とされる。)に、フラッシュメモリ・インターフェース
・シーケンサ14へと送られる。
That is, data sent from the S / P & P / S interface sequencer 13 to the flash memory interface sequencer 14 first
The data is sent from the S / P & P / S interface sequencer 13 to the page buffer 15 and is temporarily stored by the page buffer 15. At this time, the data stored in the page buffer 15 is transferred to the error correction circuit 16.
To add an error correction code. The data with the error correction code is sent from the page buffer 15 to the flash memory interface sequencer 14 for each predetermined page unit (for example, one page = 512 bytes).

【0032】或いは、フラッシュメモリ・インターフェ
ース・シーケンサ14からS/P&P/S・インターフ
ェース・シーケンサ13へ送られるデータは、先ず、フ
ラッシュメモリ・インターフェース・シーケンサ14か
らページバッファ15に送られて、このページバッファ
15によって一時的に記憶される。このとき、ページバ
ッファ15に記憶されたデータは、エラー訂正回路16
によってエラー訂正処理が施される。そして、エラー訂
正処理が施されたデータは、ページバッファ15から所
定のページ単位毎に、S/P&P/S・インターフェー
ス・シーケンサ13へと送られる。
Alternatively, data sent from the flash memory interface sequencer 14 to the S / P & P / S interface sequencer 13 is first sent from the flash memory interface sequencer 14 to the page buffer 15, and the page buffer 15 temporarily stored. At this time, the data stored in the page buffer 15 is transferred to the error correction circuit 16.
Performs an error correction process. The data subjected to the error correction processing is sent from the page buffer 15 to the S / P & P / S interface sequencer 13 for each predetermined page unit.

【0033】フラッシュメモリ・インターフェース・シ
ーケンサ14は、コマンドジェネレータ17からの制御
コマンドに基づいて、フラッシュメモリ12へのデータ
の書き込みや、フラッシュメモリ12からのデータの読
み出し等を行う。すなわち、フラッシュメモリ・インタ
ーフェース・シーケンサ14は、コマンドジェネレータ
17からの制御コマンドに基づいて、フラッシュメモリ
12からデータを読み出して、当該データを上述のよう
にページバッファ15を介して、S/P&P/S・イン
ターフェース・シーケンサ13へと送出する。或いは、
フラッシュメモリ・インターフェース・シーケンサ14
は、コマンドジェネレータ17からの制御コマンドに基
づいて、S/P&P/S・インターフェース・シーケン
サ13からのデータを、上述のようにページバッファ1
5を介して受け取り、当該データをフラッシュメモリ1
2に書き込む。
The flash memory interface sequencer 14 writes data to the flash memory 12 and reads data from the flash memory 12 based on a control command from the command generator 17. That is, the flash memory interface sequencer 14 reads data from the flash memory 12 based on a control command from the command generator 17, and transfers the data to the S / P & P / S via the page buffer 15 as described above.・ Send to the interface sequencer 13. Or,
Flash memory interface sequencer 14
Transmits the data from the S / P & P / S interface sequencer 13 based on the control command from the command generator 17 to the page buffer 1 as described above.
5 and the data is stored in the flash memory 1
Write to 2.

【0034】コンフィグレーションROM18には、こ
のメモリカード2のバージョン情報や各種属性情報等が
格納されている。コンフィグレーションROM18に格
納された情報は、必要に応じて、S/P&P/S・イン
ターフェース・シーケンサ13を介してコマンドジェネ
レータ17によって読み出されて使用される。すなわ
ち、コマンドジェネレータ17は、必要に応じて、コン
フィグレーションROM18に格納されている情報を読
み出し、この情報に基づいてメモリカード2に関する各
種設定を行う。
The configuration ROM 18 stores version information and various attribute information of the memory card 2. The information stored in the configuration ROM 18 is read and used by the command generator 17 via the S / P & P / S interface sequencer 13 as needed. That is, the command generator 17 reads information stored in the configuration ROM 18 as necessary, and performs various settings relating to the memory card 2 based on the information.

【0035】以上のようなメモリカード2に対して、フ
ラッシュメモリ12に書き込まれるデータが、上述した
3本のデータ線SCLK,State,DIOを介し
て、データ処理装置1からシリアルデータとして送られ
てくると、先ず、S/P&P/S・インターフェース・
シーケンサ13は、当該シリアルデータをパラレルデー
タに変換し、当該パラレルデータをページバッファ15
へ送出する。ページバッファ15は、S/P&P/S・
インターフェース・シーケンサ13から送られてきたデ
ータを一時的に記憶する。このとき、ページバッファ1
5に記憶されたデータには、エラー訂正回路16によっ
てエラー訂正符号が付けられる。そして、エラー訂正符
号が付けられたデータは、所定のページ単位毎にフラッ
シュメモリ・インターフェース・シーケンサ14に送出
される。そして、フラッシュメモリ・インターフェース
・シーケンサ14は、ページバッファ15から送られて
きたデータを、コマンドジェネレータ17からの制御コ
マンドに基づいて、フラッシュメモリ12に書き込む。
以上の処理により、データ処理装置1から送られてきた
データが、フラッシュメモリ12に書き込まれる。
The data to be written to the flash memory 12 is sent to the memory card 2 as serial data from the data processor 1 via the three data lines SCLK, State, and DIO described above. First, S / P & P / S interface
The sequencer 13 converts the serial data into parallel data, and converts the parallel data into a page buffer 15.
Send to The page buffer 15 is S / P & P / S.
The data sent from the interface sequencer 13 is temporarily stored. At this time, page buffer 1
The data stored in 5 is subjected to an error correction code by an error correction circuit 16. Then, the data with the error correction code is sent to the flash memory interface sequencer 14 for each predetermined page unit. Then, the flash memory interface sequencer 14 writes the data sent from the page buffer 15 to the flash memory 12 based on a control command from the command generator 17.
By the above processing, the data sent from the data processing device 1 is written to the flash memory 12.

【0036】また、以上のようなメモリカード2からデ
ータを読み出す際は、先ず、コマンドジェネレータ17
からの制御コマンドに基づいて、フラッシュメモリ・イ
ンターフェース・シーケンサ14によって、フラッシュ
メモリ12からデータが読み出される。そして、フラッ
シュメモリ・インターフェース・シーケンサ14は、フ
ラッシュメモリ12から読み出したデータをページバッ
ファ15に送出する。ページバッファ15は、フラッシ
ュメモリ・インターフェース・シーケンサ14から送ら
れてきたデータを一時的に記憶する。このとき、ページ
バッファ15に記憶されたデータには、エラー訂正回路
16によってエラー訂正処理が施される。そして、エラ
ー訂正処理が施されたデータは、所定のページ単位毎に
S/P&P/S・インターフェース・シーケンサ13に
送出される。そして、S/P&P/S・インターフェー
ス・シーケンサ13は、ページバッファ15から送られ
てきたデータを、シリアルデータに変換した上で、上述
した3本のデータ線SCLK,State,DIOを介
して、データ処理装置1へと送出する。以上の処理によ
り、フラッシュメモリ12から読み出されたデータが、
データ処理装置1へと送出される。
When reading data from the memory card 2 as described above, first, the command generator 17
, Data is read from the flash memory 12 by the flash memory interface sequencer 14. Then, the flash memory interface sequencer 14 sends the data read from the flash memory 12 to the page buffer 15. The page buffer 15 temporarily stores data sent from the flash memory interface sequencer 14. At this time, the data stored in the page buffer 15 is subjected to error correction processing by the error correction circuit 16. The data subjected to the error correction processing is sent to the S / P & P / S interface sequencer 13 for each predetermined page unit. Then, the S / P & P / S interface sequencer 13 converts the data sent from the page buffer 15 into serial data, and then converts the data through the three data lines SCLK, State, and DIO described above. It is sent to the processing device 1. By the above processing, the data read from the flash memory 12 is
The data is sent to the data processing device 1.

【0037】なお、データの書き込みや読み出しを行う
際は、フラッシュメモリ12に書き込まれるデータやフ
ラッシュメモリ12から読み出されたデータのやり取り
が行われるだけでなく、そのやり取りを制御するための
制御データも、データ処理装置1からメモリカード2の
S/P&P/S・インターフェース・シーケンサ13へ
送られる。この制御データは、S/P&P/S・インタ
ーフェース・シーケンサ13からコマンドジェネレータ
17に送られる。そして、コマンドジェネレータ17
は、S/P&P/S・インターフェース・シーケンサ1
3から送られてきた制御データに基づいて、フラッシュ
メモリ12へのアクセスを制御する制御コマンドを生成
する。そして、この制御コマンドは、フラッシュメモリ
・インターフェース・シーケンサ14に送られ、フラッ
シュメモリ・インターフェース・シーケンサ14は、こ
の制御コマンドに基づいてフラッシュメモリ12にアク
セスして、データの書き込みやデータの読み出しを行
う。
When data is written or read, not only is data exchanged with the flash memory 12 and data read from the flash memory 12 performed, but also control data for controlling the exchange is performed. Is sent from the data processing device 1 to the S / P & P / S interface sequencer 13 of the memory card 2. This control data is sent from the S / P & P / S interface sequencer 13 to the command generator 17. And the command generator 17
Is the S / P & P / S interface sequencer 1
3 to generate a control command for controlling access to the flash memory 12. Then, the control command is sent to the flash memory interface sequencer 14, and the flash memory interface sequencer 14 accesses the flash memory 12 based on the control command to perform data writing and data reading. .

【0038】なお、メモリカード2は、上述した3本の
データ線SCLK,State,DIOを備えるだけで
なく、その他に、電圧供給用の配線や、通常は使用しな
いリザーブの配線等を備えていてもよい。例えば、図2
並びに後掲する図3では、上述した3本のデータ線SC
LK,State,DIOの他に、4本の電源用の配線
VSS1,VSS2,VCC,INTと、3本のリザー
ブの配線RSV1,RSV2,RSV3とをメモリカー
ド2に設けた例を挙げている。
The memory card 2 includes not only the above-mentioned three data lines SCLK, State, and DIO, but also includes a wiring for supplying a voltage and a wiring for a reserve which is not normally used. Is also good. For example, FIG.
In FIG. 3 described later, the three data lines SC described above are used.
In addition to LK, State, and DIO, the memory card 2 is provided with four power supply wirings VSS1, VSS2, VCC, and INT and three reserve wirings RSV1, RSV2, and RSV3.

【0039】3.メモリカードの外観 つぎに、以上のようなメモリカード2の具体的な外形に
ついて、図3を参照して説明する。
[0039] 3. Appearance of the memory card Next, a specific profile of the memory card 2 as described above will be described with reference to FIG.

【0040】メモリカード2は、合成樹脂等からなり平
面形状が長方形とされる薄肉のカード状のケース21
に、上述したコントローラ11やフラッシュメモリ12
等が内蔵されてなる。そして、このメモリカード2は、
当該メモリカード2を装着する装着機構を備えたデータ
処理装置1に装着されて使用される。
The memory card 2 is a thin card-shaped case 21 made of synthetic resin or the like and having a rectangular planar shape.
The controller 11 and the flash memory 12
Etc. are built-in. And this memory card 2
The memory card 2 is used by being mounted on the data processing apparatus 1 having a mounting mechanism for mounting the memory card 2.

【0041】このメモリカード2のケース21の前端部
には、斜めに切り欠かれた切り欠き部22が形成されて
おり、更に当該切り欠き部22が形成された部分に、1
0個の凹状部23が形成されている。そして、これらの
凹状部23の内部には、メモリカード2がデータ処理装
置1の装着装置に装着されたときに、データ処理装置1
の接続端子に接続される外部接続用端子が、それぞれ配
されている。すなわち、このメモリカード2は、外部接
続用端子として10本の端子24a,24b,24c,
24d,24e,24f,24g,24h,24i,2
4jを備えている。これらの外部接続用端子の内訳は、
3本のデータ線用の端子24b,24d,24h、4本
の電源用端子24a,24f,24i,24j、及び3
本のリザーブ端子24c,24e,24gである。
At the front end of the case 21 of the memory card 2, there is formed a notch 22 which is cut obliquely.
Zero concave portions 23 are formed. When the memory card 2 is mounted on the mounting device of the data processing device 1, the data processing device 1
The external connection terminals connected to the connection terminals are arranged. That is, this memory card 2 has ten terminals 24a, 24b, 24c,
24d, 24e, 24f, 24g, 24h, 24i, 2
4j. The breakdown of these external connection terminals is
Three data line terminals 24b, 24d, 24h, four power supply terminals 24a, 24f, 24i, 24j, and 3
These are the reserve terminals 24c, 24e and 24g of the book.

【0042】また、このメモリカード2のケース21の
上面には、誤消去防止部材25が取り付けられている。
誤消去防止部材25は、ケース21の内部に収納された
上記誤消去防止スイッチ20に係合されており、この誤
消去防止部材25をスライド操作することにより、誤消
去防止スイッチ20のオン/オフの切り換えを行えるよ
うになっている。
An erroneous erasure prevention member 25 is attached to the upper surface of the case 21 of the memory card 2.
The erroneous erasure prevention member 25 is engaged with the erroneous erasure prevention switch 20 housed inside the case 21, and by sliding the erroneous erasure prevention member 25, the on / off of the erroneous erasure prevention switch 20 is performed. Can be switched.

【0043】このメモリカード2には、データ処理装置
1の装着装置に装着された際にメモリカード2がデータ
処理装置1から脱落しないようにするため、ケース20
の側面の一方に円弧状の第1のロック用切欠部26が形
成され、ケース20の側面の他方に矩形状の第2のロッ
ク用切欠部27が形成されている。そして、このメモリ
カード2がデータ処理装置1の装着装置に装着される
と、メモリカード2が脱落しないように、これらのロッ
ク用切欠部26,27が、データ処理装置1の装着装置
に係合される。
The memory card 2 has a case 20 for preventing the memory card 2 from dropping out of the data processing device 1 when the memory card 2 is mounted on the mounting device of the data processing device 1.
An arc-shaped first lock notch 26 is formed on one of the side surfaces of the case 20, and a rectangular second lock notch 27 is formed on the other side of the case 20. When the memory card 2 is mounted on the mounting device of the data processing device 1, the locking notches 26 and 27 are engaged with the mounting device of the data processing device 1 so that the memory card 2 does not fall off. Is done.

【0044】なお、図3に示したメモリカード2は、本
発明が適用される外部記憶装置の一例に過ぎない。すな
わち、本発明は、外部記憶装置の外形に依存することな
く、どんな外形の外部記憶装置にも適用可能である。
The memory card 2 shown in FIG. 3 is merely an example of an external storage device to which the present invention is applied. That is, the present invention is applicable to any external storage device without depending on the external shape of the external storage device.

【0045】4.記憶領域の構造 つぎに、以上のようなメモリカード2に搭載されるフラ
ッシュメモリ12の記憶領域の構造について説明する。
[0045] 4. Next, the structure of the storage area of the flash memory 12 mounted on the memory card 2 as described above will be described.

【0046】このフラッシュメモリ12の記憶領域は、
図4(a)に示すように、データ消去の単位となる複数
のブロックに分割されてなる。なお、これらのブロック
には、このメモリカード2が起動されたときにデータ処
理装置1によって最初に読み込まれるデータであるブー
トデータが格納されるブートブロックと、任意のデータ
が書き込まれるデータブロックとがある。各ブロックに
は、それぞれ固有の物理アドレスが付けられている。こ
れらのブロックは、データ消去の単位であると同時に、
ファイル管理上の最小単位でもある。すなわち、ファイ
ルは1つ又は複数のブロックに格納され、1つのブロッ
クを複数のファイルで利用することはできない。
The storage area of the flash memory 12 is
As shown in FIG. 4A, the data is divided into a plurality of blocks which are data erasing units. Note that these blocks include a boot block in which boot data, which is data read first by the data processing device 1 when the memory card 2 is started, is stored, and a data block in which arbitrary data is written. is there. Each block has a unique physical address. These blocks are the unit of data erasure,
It is also the minimum unit for file management. That is, a file is stored in one or more blocks, and one block cannot be used in a plurality of files.

【0047】そして、各ブロックは、「1」又は「0」
を示す2つの状態を取りうる複数のビットからなり、初
期状態では、全てのビットが「1」とされており、ビッ
ト単位での変更は「1」から「0」へだけが可能となっ
ている。すなわち、「1」及び「0」からなるデータを
書き込む際、「1」については該当するビットをそのま
ま保持し、「0」については該当するビットを「1」か
ら「0」に変更する。
Each block is "1" or "0".
, And in the initial state, all bits are set to “1”, and a change in bit units can be made only from “1” to “0”. I have. That is, when writing data consisting of “1” and “0”, the corresponding bit is held as it is for “1”, and the corresponding bit is changed from “1” to “0” for “0”.

【0048】そして、一度書き込んだデータを消去する
際は、ブロック単位で一括して初期化処理を行い、当該
ブロックの全ビットを「1」とする。これにより、当該
ブロックに書き込まれたデータが一括して消去され、そ
のブロックは再びデータの書き込みが可能な状態とな
る。
When data once written is erased, initialization processing is performed collectively for each block, and all bits of the block are set to "1". As a result, the data written in the block is collectively erased, and the block becomes ready for data writing again.

【0049】なお、「0」から「1」への変更を行うに
は、ブロック単位で一括して初期化処理を行い、当該ブ
ロックの全ビットを「1」にする必要があるが、「1」
から「0」への変更は、ブロック単位で一括して初期化
処理を行わなくて可能である。以下の説明では、ブロッ
ク単位で一括して初期化処理を行うことなく「1」から
「0」へ変更することを、オーバーライトと称する。
In order to change from "0" to "1", it is necessary to perform initialization processing collectively for each block and set all bits of the block to "1". "
Can be changed from “0” to “0” without performing the initialization process collectively in block units. In the following description, changing from "1" to "0" without performing the initialization process collectively for each block is referred to as overwriting.

【0050】なお、本発明は、上述のように各ビットが
2つの状態だけを取りうるフラッシュメモリ(いわゆる
2値型のフラッシュメモリ)だけでなく、各ビットが3
つ以上の状態を取りうるフラッシュメモリ(いわゆる多
値型のフラッシュメモリ)にも適用可能である。
It is to be noted that the present invention is not limited to a flash memory in which each bit can take only two states as described above (a so-called binary flash memory).
The present invention is also applicable to a flash memory that can take one or more states (a so-called multi-level flash memory).

【0051】上記フラッシュメモリ12の各ブロック
は、図4(b)に示すように、データの書き込みや読み
出しの単位となる複数のページから構成される。すなわ
ち、このフラッシュメモリ12にデータを書き込む際
は、上述したように、ページ単位にてページバッファ1
5から送られてきたデータが、フラッシュメモリ・イン
ターフェース・シーケンサ14によってページ単位にて
フラッシュメモリ12に書き込まれる。また、このフラ
ッシュメモリ12からデータを読み出す際は、フラッシ
ュメモリ・インターフェース・シーケンサ14によって
ページ単位毎にデータが読み出されて、ページバッファ
15へと送られる。
As shown in FIG. 4B, each block of the flash memory 12 is composed of a plurality of pages serving as a unit for writing and reading data. That is, when writing data to the flash memory 12, as described above, the page buffer 1
5 is written to the flash memory 12 by the flash memory interface sequencer 14 in page units. When data is read from the flash memory 12, the data is read for each page by the flash memory interface sequencer 14 and sent to the page buffer 15.

【0052】各ページは、データエリアと、冗長エリア
とを有している。データエリアは、任意のデータが書き
込まれる領域である。冗長エリアは、データエリアに書
き込まれるデータの管理に必要な情報が格納される領域
である。
Each page has a data area and a redundant area. The data area is an area where arbitrary data is written. The redundant area is an area in which information necessary for managing data written in the data area is stored.

【0053】具体的には、図4(c)に示すように、ブ
ロックの先頭ページの冗長エリアには、当該ブロックを
管理するために必要な情報として、いわゆる分散管理情
報が格納される。また、ブロックの2ページ目以降の各
ページの冗長エリアにも、予備の分散管理情報として、
先頭ページの冗長エリアに格納された分散管理情報と同
じものが格納される。ただし、最終ページの冗長エリア
には、分散管理情報ではなく、分散管理情報だけでは管
理しきれない追加情報として、いわゆる追加管理情報が
格納される。
Specifically, as shown in FIG. 4C, so-called distributed management information is stored in the redundant area of the first page of a block as information necessary for managing the block. In addition, the redundant area of each page after the second page of the block is also provided as spare distributed management information.
The same distributed management information stored in the redundant area of the first page is stored. However, in the redundant area of the last page, not so-called distributed management information, but so-called additional management information is stored as additional information that cannot be managed only by the distributed management information.

【0054】このように、このフラッシュメモリ12で
は、各ブロック内の冗長エリアに分散管理情報が格納さ
れる。分散管理情報は、当該分散管理情報が格納された
ブロックを管理するための情報である。この分散管理情
報により、例えば、当該ブロックがファイルの先頭とな
るブロックであるか否かについての情報や、複数のブロ
ックからファイルが構成される場合にはそれらのブロッ
クの繋がりを示す情報等を得ることができる。なお、こ
の分散管理情報については、後で詳細に説明する。
As described above, in the flash memory 12, the distribution management information is stored in the redundant area in each block. The distribution management information is information for managing a block in which the distribution management information is stored. From the distributed management information, for example, information as to whether or not the block is the first block of the file, or information indicating the connection of the blocks when the file is composed of a plurality of blocks is obtained. be able to. The distribution management information will be described later in detail.

【0055】そして、このメモリカード2では、各ブロ
ックの分散管理情報を集めることにより、フラッシュメ
モリ全体を管理するための情報として、いわゆる集合管
理情報を作成して、この集合管理情報をファイルとして
フラッシュメモリ12に格納しておくようにする。
The memory card 2 collects distributed management information of each block to create so-called collective management information as information for managing the entire flash memory, and flashes the collective management information as a file. It is stored in the memory 12.

【0056】そして、通常は、集合管理情報によって、
各ブロックにアクセスするために必要な情報を得るよう
にする。すなわち、データ処理装置1とメモリカード2
との間でデータのやり取りを行う際、データ処理装置1
は、集合管理情報をメモリカード2から読み出して内部
メモリ4に管理テーブルを作成し、この管理テーブルに
基づいてメモリカード2にアクセスする。これにより、
データアクセスの都度、個々のブロックに格納された分
散管理情報にアクセスするような必要がなくなり、より
高速なデータアクセスが可能となる。
Then, usually, according to the set management information,
Get the information needed to access each block. That is, the data processing device 1 and the memory card 2
When exchanging data with the data processing device 1
Reads the group management information from the memory card 2, creates a management table in the internal memory 4, and accesses the memory card 2 based on the management table. This allows
It is not necessary to access the distributed management information stored in each block every time data is accessed, so that higher-speed data access is possible.

【0057】5.分散管理情報 つぎに、分散管理情報について詳細に説明する。[0057] 5. Distributed management information will now be described in detail distributed management information.

【0058】分散管理情報は、当該分散管理情報が格納
されたブロックを管理するための情報であり、16バイ
トの冗長エリアに書き込まれてなる。具体的には、図5
に示すように、1バイトの可/不可フラグと、1バイト
のブロックフラグと、4ビットの最終フラグと、4ビッ
トの参照フラグと、1バイトの管理フラグと、2バイト
の論理アドレスと、2バイトの連結アドレスと、3バイ
トのリザーブ領域と、2バイトの分散管理情報用エラー
訂正符号と、3バイトのデータ用エラー訂正符号とから
なる。
The distribution management information is information for managing a block in which the distribution management information is stored, and is written in a 16-byte redundant area. Specifically, FIG.
, A 1-byte enable / disable flag, a 1-byte block flag, a 4-bit final flag, a 4-bit reference flag, a 1-byte management flag, a 2-byte logical address, It consists of a byte concatenated address, a 3-byte reserved area, a 2-byte error management code for distributed management information, and a 3-byte data error correction code.

【0059】可/不可フラグは、ブロックが使用可能状
態か使用不可能状態かを示すフラグであり、具体的に
は、「使用可」と「使用不可」の2つの状態を示す。
「使用可」は、当該ブロックが使用可能な状態を示し、
「使用不可」は、当該ブロックが使用不可能な状態であ
ることを示す。例えば、ブロック内に回復不能なエラー
が生じたようなときに、この可/不可フラグが「使用不
可」に設定され、当該ブロックが使用不可とされる。
The enable / disable flag is a flag indicating whether the block is in a usable state or an unusable state, and specifically indicates two states of "usable" and "unusable".
"Available" indicates that the block is usable,
"Unusable" indicates that the block is unusable. For example, when an unrecoverable error occurs in a block, the enable / disable flag is set to “unavailable”, and the block is disabled.

【0060】ブロックフラグは、ブロックの状態を示す
フラグであり、具体的には、「未使用」「先頭使用」
「使用」「未消去」の4つの状態を示す。「未使用」
は、当該ブロックが未使用又は消去済みで、初期状態
(全ビットが「1」の状態)とされており、直ぐにデー
タの書き込みが可能な状態を示す。「先頭使用」は、当
該ブロックがファイルの先頭で使用されている状態を示
す。なお、ブートデータが格納されたブートブロックに
おいて、ブロックフラグは「先頭使用」とされる。「使
用」は、当該ブロックがファイルの先頭以外で使用され
ている状態を示す。ブロックフラグが「使用」のとき、
当該ブロックは、他のブロックから連結されていること
となる。「未消去」は、当該ブロックに書かれていたデ
ータが無効となった状態を示す。例えば、データの消去
を行うときに、取りあえずブロックフラグを「未消去」
にしておき、処理時間に余裕があるときに、ブロックフ
ラグが「未消去」になっているブロックを消去するよう
にする。これにより、消去処理をより効率良く行うこと
が可能となる。
The block flag is a flag indicating the state of the block, and specifically, “unused”, “head used”
The four states of “used” and “not erased” are shown. "unused"
Indicates that the block is unused or has been erased, is in an initial state (a state in which all bits are “1”), and in which data can be written immediately. “Top use” indicates a state in which the block is used at the beginning of the file. In the boot block in which the boot data is stored, the block flag is set to “used at the beginning”. “Use” indicates a state in which the block is used at a position other than the beginning of the file. When the block flag is "use",
This block is connected from another block. “Unerased” indicates a state in which data written in the block has become invalid. For example, when erasing data, first set the block flag to "not erased".
When there is enough processing time, a block whose block flag is set to “unerased” is erased. Thus, the erasing process can be performed more efficiently.

【0061】最終フラグは、ファイルが終わっているか
否かを示すフラグであり、具体的には、「ブロック連
続」「ブロック最終」の2つの状態を示す。「ブロック
連続」は、次のブロックへの連結があることを示す。す
なわち、「ブロック連続」は、当該ブロックに格納され
たファイルにはまだ続きがあり、当該ファイルが他のブ
ロックに続いていることを示す。「ブロック最終」は、
最終ブロックであることを示す。すなわち、「ブロック
最終」は、当該ブロックに格納されたファイルが、この
ブロックで終了していることを示す。
The last flag is a flag indicating whether or not the file has ended, and specifically indicates two states of “block continuation” and “block end”. “Block continuation” indicates that there is a connection to the next block. That is, "block continuation" indicates that the file stored in the block still continues, and the file continues in another block. "Block end"
Indicates the last block. That is, “block end” indicates that the file stored in the block ends with this block.

【0062】参照フラグは、追加管理情報の参照を指定
するためのフラグであり、具体的には、「参照情報な
し」「参照情報あり」の2つの状態を示す。「参照情報
なし」は、ブロックの最終ページの冗長領域に、有効な
追加管理情報が存在しないことを示す。「参照情報あ
り」は、ブロックの最終ページの冗長領域に、有効な追
加管理情報が存在していることを示す。
The reference flag is a flag for designating the reference of the additional management information, and specifically shows two states of “without reference information” and “with reference information”. "No reference information" indicates that there is no valid additional management information in the redundant area of the last page of the block. “With reference information” indicates that valid additional management information exists in the redundant area on the last page of the block.

【0063】管理フラグは、ブロックの属性等を示すフ
ラグである。例えば、この管理フラグによって、当該ブ
ロックが読み出し専用ブロックか、或いは書き込みも可
能なブロックであるかが示される。また、例えば、この
管理フラグによって、当該ブロックがブートブロックで
あるか、或いはデータブロックであるかが示される。
The management flag is a flag indicating a block attribute or the like. For example, the management flag indicates whether the block is a read-only block or a writable block. Further, for example, the management flag indicates whether the block is a boot block or a data block.

【0064】論理アドレスは、文字通りそのブロックの
論理アドレスを示す。この論理アドレスの値は、データ
の書き換えを行うときなどに必要に応じて更新される。
なお、論理アドレスの値は、正常に処理が行われている
限り、同じ論理アドレスの値を同時に複数のブロックが
持つことがないように設定される。
The logical address literally indicates the logical address of the block. The value of the logical address is updated as necessary, for example, when rewriting data.
The value of the logical address is set so that a plurality of blocks do not have the same logical address value at the same time as long as the processing is performed normally.

【0065】ところで、フラッシュメモリの場合、同一
ブロック内でデータを書き換えるには、上述したよう
に、先ずブロック消去を行う必要がある。しかしなが
ら、保証されている消去可能回数には上限があり、ブロ
ック消去の回数は出来るだけ少なくすることが要求され
る。そこで、ブロックのデータを更新する際は、同一の
ブロックを使って新たなデータに書き換えるのではな
く、他のブロックに新たなデータを書き込むようにす
る。このとき、先にデータが格納されていたブロック
は、当該ブロックに格納されていたデータが無効になっ
たことを示すように、ブロックフラグを「未消去」にす
る。そして、このメモリカード2では、このようにデー
タを更新した場合でも、当該データが格納されているブ
ロックを示すアドレスが同じとなるように、各ブロック
に対して予め設定されている物理アドレスとは別に、動
的に変更が可能な論理アドレスを各ブロックに割り当て
て、この論理アドレスでデータが格納されているブロッ
クを表すようにする。
Incidentally, in the case of a flash memory, as described above, it is necessary to first erase a block in order to rewrite data in the same block. However, the guaranteed number of erasable operations has an upper limit, and it is required that the number of block erase operations be as small as possible. Therefore, when updating data in a block, new data is written in another block instead of using the same block to rewrite new data. At this time, the block flag of the block in which the data is stored first is set to “not erased” so as to indicate that the data stored in the block has become invalid. In the memory card 2, even if the data is updated in this manner, the physical address set in advance for each block is such that the address indicating the block in which the data is stored is the same. Separately, a dynamically changeable logical address is assigned to each block so that the logical address represents a block in which data is stored.

【0066】連結アドレスは、当該ブロックに連結する
ブロックの論理アドレスを示す。すなわち、ブロックに
格納されたファイルにはまだ続きがあり、当該ファイル
が他のブロックに続いている場合、連結アドレスには、
そのファイルの続きが格納された次のブロックの論理ア
ドレスの値が設定される。
The link address indicates a logical address of a block linked to the block. In other words, if the file stored in the block has a continuation, and the file continues to another block, the link address indicates
The value of the logical address of the next block in which the continuation of the file is stored is set.

【0067】分散管理情報用エラー訂正符号は、分散管
理情報のうち、管理フラグ、論理アドレス、連結アドレ
ス及びリザーブ領域に書き込まれデータを対象としたエ
ラー訂正符号である。なお、可/不可フラグ、ブロック
フラグ、最終フラグ及び参照フラグは、分散管理情報用
エラー訂正符号によるエラー訂正の対象となっていな
い。したがって、可/不可フラグ、ブロックフラグ、最
終フラグ及び参照フラグは、分散管理情報用エラー訂正
符号を更新することなく書き換えることが可能となって
いる。
The error correction code for distributed management information is an error correction code for data written in the management flag, the logical address, the link address, and the reserved area in the distributed management information. The enable / disable flag, block flag, last flag, and reference flag are not subject to error correction by the error management code for distributed management information. Therefore, the enable / disable flag, block flag, last flag, and reference flag can be rewritten without updating the error correction code for distributed management information.

【0068】データ用エラー訂正符号は、当該データ用
エラー訂正符号が格納されているページのデータエリア
に書き込まれたデータを対象としたエラー訂正符号であ
る。
The data error correction code is an error correction code for data written in the data area of the page in which the data error correction code is stored.

【0069】なお、分散管理情報用エラー訂正符号やデ
ータ用エラー訂正符号は、メモリカード2の内部に配さ
れたエラー訂正回路16によって使用される。したがっ
て、これらのエラー訂正符号を用いてのエラー訂正は、
データ処理装置1に依存することなく、メモリカード2
に依存した任意の手法を使用することができる。
The error correction code for distributed management information and the error correction code for data are used by the error correction circuit 16 arranged inside the memory card 2. Therefore, error correction using these error correction codes is
Without depending on the data processing device 1, the memory card 2
Can be used.

【0070】6.追加管理情報 つぎに、追加管理情報について詳細に説明する。[0070] 6. Additional management information will be described in detail for additional management information.

【0071】追加管理情報は、ブロックの最終ページの
16バイトの冗長エリアに格納される情報であり、分散
管理情報だけでは管理しきれない追加情報を含んでい
る。
The additional management information is information stored in the 16-byte redundant area of the last page of the block, and includes additional information that cannot be managed only by the distributed management information.

【0072】具体的には、追加管理情報は、図6に示す
ように、1バイトの可/不可フラグと、1バイトのブロ
ックフラグと、4ビットの最終フラグと、4ビットの参
照フラグと、1バイトの識別番号と、2バイトの有効デ
ータサイズと、5バイトのリザーブ領域と、2バイトの
追加管理情報用エラー訂正符号と、3バイトのデータ用
エラー訂正符号とからなる。
Specifically, as shown in FIG. 6, the additional management information includes a 1-byte enable / disable flag, a 1-byte block flag, a 4-bit final flag, a 4-bit reference flag, It consists of a 1-byte identification number, a 2-byte effective data size, a 5-byte reserved area, a 2-byte error correction code for additional management information, and a 3-byte data error correction code.

【0073】ここで、可/不可フラグ、ブロックフラ
グ、最終フラグ、参照フラグ、リザーブ領域及びデータ
用エラー訂正符号については、分散管理情報の場合と同
様である。また、追加管理情報用エラー訂正符号は、分
散管理情報における分散管理情報用エラー訂正符号に相
当するものであり、追加管理情報のうち、識別番号、有
効データサイズ及びリザーブ領域に書き込まれデータを
対象としたエラー訂正符号である。
Here, the enable / disable flag, block flag, last flag, reference flag, reserved area, and data error correction code are the same as in the case of the distribution management information. Further, the error correction code for additional management information is equivalent to the error correction code for distributed management information in the distributed management information. Among the additional management information, the identification number, the effective data size, and the data written in the reserved area are targeted. This is the error correction code.

【0074】そして、識別番号及び有効データサイズと
が、分散管理情報だけでは管理しきれない追加情報とし
て、追加管理情報に含まれている。
The identification number and the effective data size are included in the additional management information as additional information that cannot be managed only by the distributed management information.

【0075】識別番号は、エラー処理用の情報であり、
ブロックのデータを書き換える度に、この識別番号の値
がインクリメントされる。この識別番号は、何らかのエ
ラーが発生して、同じ論理アドレスを持つブロックが複
数存在するようになってしまった場合に、それらのブロ
ックに書き込まれたデータの新旧を識別するために使用
される。なお、識別番号には1バイトの領域が使用さ
れ、その値の範囲は「0」から「255」までであり、
その初期値は「0」とされる。なお、識別番号が「25
5」を越えたときには「0」に戻される。そして、同じ
論理アドレスを持つデータブロックが複数存在する場合
には、この識別番号の値が小さい方のデータブロックを
有効とする。ただし、ブートブロックについては、ブー
トブロックの予備がある場合、正常時にはそれらのブー
トブロックの識別番号は同じ値とされる。何らかの異常
により、それらのブートブロックの識別番号が異なるよ
うな状態となった場合には、識別番号の値が大きい方の
ブートブロックを有効とする。
The identification number is information for error processing.
Each time the data of the block is rewritten, the value of this identification number is incremented. This identification number is used to identify the old and new of the data written in those blocks when some error occurs and a plurality of blocks having the same logical address exist. A 1-byte area is used for the identification number, and its value ranges from "0" to "255".
Its initial value is "0". Note that the identification number is "25
When it exceeds "5", it is returned to "0". When there are a plurality of data blocks having the same logical address, the data block having the smaller value of the identification number is valid. However, if there are spare boot blocks, the identification numbers of the boot blocks have the same value in a normal state. In the case where the identification numbers of the boot blocks are different due to some abnormality, the boot block with the larger value of the identification number is validated.

【0076】また、有効データサイズは、ブロック内の
有効なデータのサイズを示す。すなわち、当該ブロック
のデータエリアに空きがある場合、有効データサイズに
は、当該データエリアに書き込まれたデータのサイズを
示す値が設定される。このとき、分散管理情報の参照フ
ラグは「参照情報あり」に設定される。なお、ブロック
のデータエリアに空きがない場合、有効データサイズに
は、当該データエリアに空きがないことを示す値とし
て、「0xffff」が設定される。
The valid data size indicates the size of valid data in the block. That is, when there is a free space in the data area of the block, a value indicating the size of the data written in the data area is set in the effective data size. At this time, the reference flag of the distributed management information is set to “with reference information”. If there is no free space in the data area of the block, “0xffff” is set in the effective data size as a value indicating that there is no free space in the data area.

【0077】なお、以上のような分散管理情報及び追加
管理情報は、ブロック内のデータが更新される毎に、常
に最新情報となるように更新される。
The above-described distributed management information and additional management information are updated so that they are always the latest information every time data in a block is updated.

【0078】7.集合管理情報 つぎに、集合管理情報について詳細に説明する。[0078] 7. Set management information Next, set management information will be described in detail.

【0079】集合管理情報は、上述したように、各ブロ
ックの分散管理情報を集めて作成されてなる情報であ
り、ファイルとしてフラッシュメモリ12に格納され
る。すなわち、図7に示すように、各ブロックの分散管
理情報から、全ブロックをまとめて管理するための情報
である集合管理情報のファイルが作成され、この集合管
理情報が所定のブロックのデータエリアに格納される。
なお、集合管理情報は、1つのブロックに格納されるも
のであっても、複数のブロックにわたって格納されるも
のであってもよい。そして、データ処理装置1は、通常
は、この集合管理情報によって、各ブロックにアクセス
するために必要な情報を得るようにする。
As described above, the collective management information is information created by collecting distributed management information of each block, and is stored in the flash memory 12 as a file. That is, as shown in FIG. 7, a file of set management information, which is information for managing all blocks collectively, is created from the distributed management information of each block, and this set management information is stored in the data area of a predetermined block. Is stored.
The set management information may be stored in one block or may be stored over a plurality of blocks. Then, the data processing device 1 normally obtains information necessary for accessing each block by using the set management information.

【0080】すなわち、メモリカード2に有効な集合管
理情報がファイルとして格納されている場合、データ処
理装置1は、その集合管理情報のファイルを読み出して
内部メモリ4に展開し、メモリカード2を管理するため
の管理テーブルを作成する。なお、集合管理情報のファ
イルの先頭が格納されているブロックの物理アドレス
は、ブートデータに含まれており、データ処理装置1
は、この物理アドレスに基づいて集合管理情報のファイ
ルにアクセスする。
That is, when the effective collective management information is stored as a file in the memory card 2, the data processing device 1 reads out the collective control information file and develops it on the internal memory 4 to manage the memory card 2. Create a management table for Note that the physical address of the block in which the head of the file of the set management information is stored is included in the boot data, and the data processing device 1
Accesses the set management information file based on the physical address.

【0081】この集合管理情報は、図8に示すように、
この集合管理情報のヘッダーと、各ブロックの状態を示
すビットマップテーブルと、ブロックにアクセスすると
きに、指定された論理アドレスから物理アドレスへの変
換を行うための変換テーブルと、あるブロックの次のブ
ロックを示す連結テーブルとを有する。
As shown in FIG. 8, this set management information
A header of the set management information, a bitmap table indicating the state of each block, a conversion table for performing conversion from a specified logical address to a physical address when accessing the block, And a connection table indicating blocks.

【0082】ビットマップテーブルには、各ブロックの
分散管理情報から抽出された、可/不可フラグ、ブロッ
クフラグ、最終フラグ、参照フラグ及び管理フラグ等の
情報が格納される。
The bitmap table stores information such as a valid / invalid flag, a block flag, a final flag, a reference flag, and a management flag extracted from the distribution management information of each block.

【0083】変換テーブルは、図9に示すように、論理
アドレスに対応する物理アドレスが記述されたテーブル
であり、物理アドレスが格納される領域は、1エントリ
あたり2バイトとされる。この変換テーブルを分散管理
情報から作成するときは、対象となるブロックの分散管
理情報に書かれている論理アドレスを調べ、テーブルの
対応位置にそのブロックの物理アドレスを登録する。な
お、論理アドレスを使用していない場合、対応する物理
アドレスには「0xffff」を設定しておく。
As shown in FIG. 9, the conversion table is a table in which physical addresses corresponding to logical addresses are described. The area where the physical address is stored is 2 bytes per entry. When the conversion table is created from the distribution management information, the logical address written in the distribution management information of the target block is checked, and the physical address of the block is registered at a corresponding position in the table. If a logical address is not used, “0xffff” is set to the corresponding physical address.

【0084】連結テーブルは、図10に示すように、論
理アドレスに対応する連結アドレスが記述されたテーブ
ルであり、連結アドレスが格納される領域は、1エント
リあたり2バイトとされる。この連結テーブルを分散管
理情報から作成するときは、対象となるブロックの分散
管理情報に書かれている連結アドレスを調べ、テーブル
の対応位置にそのブロックの連結アドレスを登録する。
As shown in FIG. 10, the concatenation table is a table in which a concatenation address corresponding to a logical address is described. The area where the concatenation address is stored is 2 bytes per entry. When creating this connection table from the distribution management information, the connection address written in the distribution management information of the target block is checked, and the connection address of the block is registered at a corresponding position in the table.

【0085】8.メモリカード起動時の手順 つぎに、メモリカード2の起動時の手順について、図1
1のフローチャートを参照して説明する。
[0085] 8. Procedure when the memory card starts Next, a procedure of startup of the memory card 2, FIG. 1
This will be described with reference to the flowchart of FIG.

【0086】このメモリカード2を起動する際は、図1
1に示すように、先ず、ステップS1において、データ
処理装置1は、メモリカード2のブートブロックからブ
ートデータを読み込む。次に、ステップS2へ進む。
When starting up the memory card 2, FIG.
As shown in FIG. 1, first, in step S1, the data processing device 1 reads boot data from a boot block of the memory card 2. Next, the process proceeds to step S2.

【0087】ステップS2において、データ処理装置1
は、ブートブロックからのブートデータの読み込みが正
常に行われたかを確認する。正常に読み込まれたなら
ば、ステップS3へ進み、正常に読み込まれなかったな
らば、ステップS8へ進む。
In step S2, the data processing device 1
Confirms whether the reading of the boot data from the boot block has been performed normally. If it is read normally, the process proceeds to step S3. If it is not read correctly, the process proceeds to step S8.

【0088】ステップ3において、データ処理装置1
は、読み込んだブートデータに基づいて、メモリカード
2が当該データ処理装置1に対応しているか否かを判別
する。対応したメモリカードであるならば、ステップS
4へ進み、対応していないメモリカードならば、ステッ
プS8へ進む。
In step 3, the data processing device 1
Determines whether the memory card 2 is compatible with the data processing device 1 based on the read boot data. If the memory card is compatible, step S
The process proceeds to step S4, and if the memory card is not supported, the process proceeds to step S8.

【0089】ステップS4において、データ処理装置1
は、メモリカード2から集合管理情報を読み込む。な
お、集合管理情報が格納されているブロックの物理アド
レスは、ブートデータの中で指定されている。次に、ス
テップS5へ進む。
In step S4, the data processing device 1
Reads the collective management information from the memory card 2. Note that the physical address of the block in which the set management information is stored is specified in the boot data. Next, the process proceeds to step S5.

【0090】ステップS5において、データ処理装置1
は、有効な集合管理情報の読み込みが正常に行われたか
を確認する。正常に読み込めたならば、ステップS6へ
進み、正常に読み込めなかったならば、ステップS7へ
進む。
In step S5, the data processing device 1
Confirms whether the valid set management information has been read normally. If it can be read normally, the process proceeds to step S6. If it cannot be read normally, the process proceeds to step S7.

【0091】ステップS6において、データ処理装置1
は、読み込んだ集合管理情報を内部メモリ4に展開し、
メモリカード2を管理するための管理テーブルを作成す
る。以上の処理で、メモリカード2の起動時の初期処理
が完了し、メモリカード2の使用が可能となる。
In step S6, the data processing device 1
Expands the read set management information into the internal memory 4,
A management table for managing the memory card 2 is created. With the above processing, the initial processing at the time of starting the memory card 2 is completed, and the memory card 2 can be used.

【0092】また、ステップS5で有効な集合管理情報
が正常に読み込めなかったと判断された場合は、上述し
たようにステップS7へ進む。ステップS7において、
データ処理装置1は、各ブロックの分散管理情報を読み
出して、集合管理情報を再構築する。そして、その集合
管理情報を内部メモリ4に展開し、メモリカード2を管
理するための管理テーブルを作成する。以上の処理で、
メモリカード2の起動時の初期処理が完了し、メモリカ
ード2の使用が可能となる。
If it is determined in step S5 that valid set management information cannot be read normally, the process proceeds to step S7 as described above. In step S7,
The data processing device 1 reads out the distribution management information of each block and reconstructs the set management information. Then, the group management information is expanded in the internal memory 4 and a management table for managing the memory card 2 is created. With the above processing,
The initial processing at the time of starting the memory card 2 is completed, and the memory card 2 can be used.

【0093】一方、ステップS2でブートデータ読み込
み時にエラーが生じたと判断された場合、及び、ステッ
プS3でメモリカード2がデータ処理装置1に対応して
いないと判断された場合は、上述したようにステップS
8へ進む。
On the other hand, if it is determined in step S2 that an error has occurred during the reading of boot data, and if it is determined in step S3 that the memory card 2 does not correspond to the data processing device 1, as described above. Step S
Proceed to 8.

【0094】ステップS8に進むのは、メモリカード2
を使用できないときである。そこで、ステップS8にお
いて、データ処理装置1は、例えば、利用不可のメッセ
ージを表示するなどの所定のエラー処理を行い、メモリ
カード2の起動処理を終了する。
The process proceeds to step S8 for the memory card 2
It is when you can not use. Therefore, in step S8, the data processing device 1 performs a predetermined error process such as displaying a message indicating that the memory card 2 cannot be used, and terminates the startup process of the memory card 2.

【0095】9.データ更新処理時の集合管理情報の取
り扱い データ処理装置1は、メモリカード2へデータを書き込
む処理や、メモリカード2からデータを消去する処理
(以下、これらの処理をまとめて「データ更新処理」と
称する。)を行う毎に、内部メモリ4に保持している管
理テーブルを、メモリカード2の実際の状態と整合する
ように(すなわち、分散管理情報の内容と整合するよう
に)、随時更新していく。一方、メモリカード2にファ
イルとして格納されている集合管理情報は、データ更新
処理毎に更新されるのではなく、適当なタイミングに
て、その変更内容が一括して更新される。
9. Acquisition of set management information during data update processing
Each time the handling data processing device 1 performs a process of writing data to the memory card 2 or a process of erasing data from the memory card 2 (hereinafter, these processes are collectively referred to as “data update process”). The management table held in the internal memory 4 is updated as needed so as to match the actual state of the memory card 2 (that is, to match the contents of the distributed management information). On the other hand, the collective management information stored as a file in the memory card 2 is not updated every time the data is updated, but the changed content is updated collectively at an appropriate timing.

【0096】一般にフラッシュメモリ12の書き換え可
能回数には上限があるが、集合管理情報の書き換えをあ
る程度まとめて一括して行うようにすることで、集合管
理情報が格納されているブロックの書き換え回数を削減
することができ、メモリカード2の長寿命化を図ること
ができる。
Generally, there is an upper limit to the number of times that the flash memory 12 can be rewritten. Therefore, the life of the memory card 2 can be extended.

【0097】ただし、データ更新処理を行う際は、メモ
リカード2に格納されている集合管理情報のファイルを
無効にしてから行う。これは、分散管理情報と集合管理
情報の一貫性を損なわないためである。データ更新処理
時には、処理の対象となるブロックの分散管理情報は同
時に更新されるが、集合管理情報の内容は同時には更新
されないので、分散管理情報と集合管理情報とが一致し
ない状態となる。そこで、このような状態のときには、
メモリカード2に格納されている集合管理情報のファイ
ルを無効にしておく。
However, when performing the data updating process, the file of the collective management information stored in the memory card 2 is invalidated. This is because the consistency between the distributed management information and the collective management information is not lost. During the data update processing, the distributed management information of the block to be processed is updated at the same time, but the contents of the collective management information are not updated at the same time, so that the distributed management information and the collective management information do not match. So, in such a state,
The set management information file stored in the memory card 2 is invalidated.

【0098】具体的には、データ更新処理時には、図1
2に示すように、先ず、ステップS11において、デー
タ処理装置1は、メモリカード2に格納されている集合
管理情報が有効であるか無効であるかを判別する。そし
て、集合管理情報が既に無効となっていたならば、その
ままデータ更新処理に移行する。一方、集合管理情報が
有効であれば、ステップS12へ進む。
Specifically, at the time of the data update processing, FIG.
As shown in FIG. 2, first, in step S11, the data processing device 1 determines whether the set management information stored in the memory card 2 is valid or invalid. If the set management information has already been invalidated, the process directly proceeds to the data update process. On the other hand, if the set management information is valid, the process proceeds to step S12.

【0099】ステップS12において、データ処理装置
1は、集合管理情報を無効にする。具体的には、集合管
理情報のファイルが格納されているブロックのブロック
フラグを「未消去」にするか、或いは当該ブロックに対
して消去処理を施してデータを消去する。そして、この
ように集合管理情報を無効にした上で、データ更新処理
に移行する。
In step S12, the data processing device 1 invalidates the set management information. Specifically, the block flag of the block in which the file of the set management information is stored is set to “not erased”, or the block is erased to erase the data. Then, after the set management information is invalidated as described above, the process proceeds to the data update process.

【0100】なお、メモリカード2に格納されている集
合管理情報のファイルは、分散管理情報と集合管理情報
の一貫性を損なわないために、データ更新処理時に無効
とされるが、データ処理装置1の内部メモリ4に保持さ
れている管理テーブルの内容は、常に最新の状態となる
ように随時更新される。そして、データ処理装置1は、
通常は、この管理テーブルに基づいて各ブロックを管理
する。
The set management information file stored in the memory card 2 is invalidated during the data update process in order to maintain the consistency between the distributed management information and the set management information. The content of the management table held in the internal memory 4 is constantly updated so as to be the latest state. Then, the data processing device 1
Usually, each block is managed based on this management table.

【0101】また、データ更新処理時に無効とされた集
合管理情報は、適当なタイミングで、改めてメモリカー
ド2に書き込まれて、再び有効とされる。なお、ここで
の適当なタイミングとは、例えば、メモリカード2の使
用を終了して電源を落とすときや、メモリカード2への
アクセスが所定時間以上なされなかったときや、データ
の書き換えが所定回数以上行われたときなどである。
The collective management information invalidated during the data update processing is newly written to the memory card 2 at an appropriate timing, and becomes valid again. Here, the appropriate timing is, for example, when the power of the memory card 2 is turned off after the use of the memory card 2 is completed, when the access to the memory card 2 is not performed for a predetermined time or more, or when the data is This is the case when the above is performed.

【0102】具体的には、例えば、メモリカード2の使
用を終了して電源を落とす前に、図13に示すような終
了処理を行い、集合管理情報を有効なものとする。
Specifically, for example, before the use of the memory card 2 is terminated and the power is turned off, a termination process as shown in FIG. 13 is performed to make the group management information valid.

【0103】この終了処理では、先ず、ステップS21
において、データ処理装置1は、メモリカード2に格納
されている集合管理情報が有効であるか無効であるかを
判別する。そして、集合管理情報が有効であれば、その
まま処理を終了する。一方、集合管理情報が無効であれ
ば、ステップS22へ進む。
In this end processing, first, in step S21
In, the data processing device 1 determines whether the set management information stored in the memory card 2 is valid or invalid. Then, if the set management information is valid, the process ends. On the other hand, if the set management information is invalid, the process proceeds to step S22.

【0104】ステップS22において、データ処理装置
1は、集合管理情報のファイルが格納されているブロッ
クに対して、消去処理が施されているか否かを判別す
る。消去処理が施されていなければ、ステップS23へ
進み、消去処理が施されていれば、ステップS24へ進
む。
In step S22, the data processing device 1 determines whether or not an erasing process has been performed on the block storing the file of the set management information. If the erasing process has not been performed, the process proceeds to step S23. If the erasing process has been performed, the process proceeds to step S24.

【0105】ステップS23において、データ処理装置
1は、集合管理情報のファイルが格納されているブロッ
クに対して消去処理を施す。その後、ステップS24へ
進む。
In step S23, the data processing device 1 performs an erasing process on the block storing the file of the set management information. Thereafter, the process proceeds to step S24.

【0106】ステップS24において、データ処理装置
1は、メモリカード2に集合管理情報を書き込む。この
とき、データ処理装置1は、内部メモリ4に保持してい
る管理テーブルの内容に基づいて新しい集合管理情報の
ファイルを作成し、その新しい集合管理情報のファイル
をメモリカード2に書き込む。これにより、メモリカー
ド2の最新の状態を示す有効な集合管理情報が、メモリ
カード2に格納されたこととなる。
In step S24, the data processing device 1 writes the collective management information in the memory card 2. At this time, the data processing device 1 creates a new file of collective management information based on the contents of the management table held in the internal memory 4 and writes the new collective management information file to the memory card 2. As a result, the effective collective management information indicating the latest state of the memory card 2 is stored in the memory card 2.

【0107】以上で終了処理が完了し、メモリカード2
に有効な集合管理情報が格納された状態となる。
With the above, the end processing is completed, and the memory card 2
Is stored.

【0108】10.新規ファイルの書き込み つぎに、メモリカード2に新規なファイルを書き込む際
の処理手順について説明する。メモリカード2にファイ
ルを書き込む際の処理手順は、ファイルサイズが予め分
かっている場合と、分かっていない場合とで異なる。
[0108] 10. Writing a new file The following describes a procedure for writing a new file in the memory card 2. The processing procedure for writing a file to the memory card 2 differs depending on whether the file size is known in advance or not.

【0109】10−1 ファイルサイズが予め分かって
いる場合 予めファイルのサイズが分かっている場合は、当該ファ
イルのデータを新規なブロックに書き込む毎に、データ
が当該ブロックに納まるかどうかを判断する。そして、
データがブロック内に納まりきらない場合には、次に続
くブロックの論理アドレスを確保しておき、データをデ
ータエリアに書き込むとともに、次に続くブロックの論
理アドレスを連結アドレスとして分散管理情報を書き込
む。このとき、最終フラグは「ブロック連続」に設定し
ておく。一方、データがブロック内に納まる場合には、
データの端数部分、すなわちデータエリアの空き領域は
「0xffff」としておく。このとき、最終フラグは「ブロ
ック最終」に設定しておき、追加管理情報に有効データ
サイズを書き込んでおく。
10-1 Know the File Size in Advance
If the size of the file is known in advance, each time data of the file is written to a new block, it is determined whether the data fits in the block. And
If the data does not fit in the block, the logical address of the next succeeding block is secured, the data is written in the data area, and the distribution management information is written using the logical address of the next succeeding block as a concatenated address. At this time, the final flag is set to “block continuation”. On the other hand, if the data fits in a block,
The fractional part of the data, that is, the free area of the data area is set to “0xffff”. At this time, the last flag is set to “block last”, and the effective data size is written in the additional management information.

【0110】つぎに、以上のように予めサイズが分かっ
ているファイルをメモリカード2に書き込む際の手順に
ついて、図14に示すフローチャートを参照して、詳細
に説明する。なお、図14に示すフローチャート、並び
に後掲する図15及び図17に示すフローチャートで
は、メモリカード2の誤消去防止スイッチ20のチェッ
クや、何らかのエラーが発生したときの処理等について
は省略している。
Next, a procedure for writing a file whose size is known in advance as described above to the memory card 2 will be described in detail with reference to the flowchart shown in FIG. In the flowchart shown in FIG. 14 and the flowcharts shown in FIGS. 15 and 17 described later, the check of the erroneous erasure prevention switch 20 of the memory card 2 and the processing when any error occurs are omitted. .

【0111】予めサイズが分かっているファイルをメモ
リカード2に書き込む際は、先ず、ステップS31にお
いて、データ処理装置1は、メモリカード2に書き込む
実データと、当該実データのヘッダーとを準備する。換
言すれば、ステップS31において、データ処理装置1
は、メモリカード2のデータエリアに書き込むファイル
を準備する。なお、当該ファイルのヘッダーには、ファ
イルのサイズの情報が含まれる。次に、ステップS32
へ進む。
When writing a file of which size is known in advance to the memory card 2, first, in step S31, the data processing apparatus 1 prepares actual data to be written to the memory card 2 and a header of the actual data. In other words, in step S31, the data processing device 1
Prepares a file to be written to the data area of the memory card 2. The file header contains information on the size of the file. Next, step S32
Proceed to.

【0112】ステップS32において、データ処理装置
1は、最初にファイルが格納されるブロックのブロック
フラグを「先頭使用」に設定するとともに、空いている
論理アドレスを確保する。次に、ステップS33へ進
む。
In step S32, the data processing device 1 sets the block flag of the block in which the file is stored first to “use at the beginning” and secures a free logical address. Next, the process proceeds to step S33.

【0113】ステップS33において、データ処理装置
1は、空いている物理アドレスを検索する。次に、ステ
ップS34へ進む。
At step S33, the data processing device 1 searches for a free physical address. Next, the process proceeds to step S34.

【0114】ステップS34において、データ処理装置
1は、処理の対象となっているブロックにファイルが納
まりきるか否かを判別する。ファイルがブロック内に納
まりきらず、ファイルに続きがある場合には、ステップ
35へ進み、一方、ファイルがブロック内に納まり、フ
ァイルに続きがない場合には、ステップ36へ進む。
In step S34, the data processing device 1 determines whether or not the file fits in the block to be processed. If the file does not fit in the block and there is a continuation of the file, the process proceeds to step 35, while if the file fits in the block and there is no continuation of the file, the process proceeds to step 36.

【0115】ステップS35において、データ処理装置
1は、次に続くブロックの論理アドレスを確保して、こ
の論理アドレスを連結アドレスとして設定する。次に、
ステップS37へ進む。
In step S35, the data processing device 1 secures a logical address of the next succeeding block and sets this logical address as a concatenated address. next,
Proceed to step S37.

【0116】一方、ステップS36において、データ処
理装置1は、最終フラグを「ブロック最終」に設定する
とともに、連結アドレスを「0xffff」に設定する。次
に、ステップS37へ進む。
On the other hand, in step S36, the data processing device 1 sets the last flag to “block end” and sets the connection address to “0xffff”. Next, the process proceeds to step S37.

【0117】ステップS37において、データ処理装置
1は、これまでのステップで設定された情報等に基づい
て、処理の対象となっているブロックについての分散管
理情報を作成する。次に、ステップS38へ進む。
In step S37, the data processing device 1 creates distribution management information for the block to be processed based on the information set in the previous steps. Next, the process proceeds to step S38.

【0118】ステップS38において、データ処理装置
1は、処理の対象となっているブロックに、ページ単位
でデータを順次書き込む。ここで、処理の対象となって
いるブロックにファイルが納まりきらない場合には、1
ブロック分のデータがページ単位で書き込まれる。ま
た、処理の対象となっているブロックにファイルが納ま
りきる場合には、必要なページ分だけページ単位でデー
タが書き込まれる。なお、このステップS38で、ブロ
ックに書き込まれるのは、新規に書き込むファイルのデ
ータと、ステップS37で作成された分散管理情報とで
ある。次に、ステップS39へ進む。
In step S38, the data processing device 1 sequentially writes data in block units to be processed in page units. If the file does not fit in the block to be processed, 1
Block data is written in page units. If the file can be accommodated in the block to be processed, data is written in the required page units in page units. Note that what is written in the block in step S38 is the data of the file to be newly written and the distribution management information created in step S37. Next, the process proceeds to step S39.

【0119】ステップS39において、データ処理装置
1は、ファイルの全データについて、メモリカード2へ
の書き込みが終了したか否かを判別する。書き込みが終
了しておらず、まだデータが残っていれば、ステップS
33へ戻って処理を繰り返す。一方、書き込みが終了し
ていれば、ステップ40へ進む。
In step S39, the data processing device 1 determines whether or not writing to the memory card 2 has been completed for all data in the file. If writing has not been completed and data still remains, step S
Returning to step 33, the process is repeated. On the other hand, if the writing has been completed, the process proceeds to step S40.

【0120】ステップS40において、データ処理装置
1は、書き込んだデータが、ブロックの途中で終わって
いるか否かを判別する。そして、データがブロックの途
中で終わっていれば、ステップS41へ進む。一方、ブ
ロックの最後までデータが格納されていれば、これで処
理を終了する。
In step S40, the data processing device 1 determines whether the written data ends in the middle of the block. If the data ends in the middle of the block, the process proceeds to step S41. On the other hand, if the data has been stored up to the end of the block, the process is terminated.

【0121】ステップS41において、データ処理装置
1は、最終ページの冗長エリアに格納される追加管理情
報に有効データサイズを書き込む。すなわち、データ処
理装置1は、ファイルの最後の部分が格納されたブロッ
クのデータエリアに書き込まれたデータのサイズを示す
値を、当該ブロックの追加管理情報に有効データサイズ
として書き込む。
In step S41, the data processing device 1 writes the effective data size in the additional management information stored in the redundant area of the last page. That is, the data processing device 1 writes the value indicating the size of the data written in the data area of the block in which the last part of the file is stored as the effective data size in the additional management information of the block.

【0122】以上で、予めサイズが分かっているファイ
ルのメモリカード2への書き込みの処理が完了する。
Thus, the process of writing the file whose size is known in advance to the memory card 2 is completed.

【0123】10−2 ファイルサイズが分かっていな
い場合 ファイルのサイズが予め分からない場合には、次に続く
ブロックの論理アドレスを常に確保しておき、データが
終了した時点で、最終ブロックの最終フラグをオーバー
ライトにより設定する。なお、その他の分散管理情報及
び追加管理情報に関しては、予めファイルサイズが分か
っているときと同様に設定される。
10-2 File size is not known
If the file size is not known in advance, the logical address of the next block is always secured, and when the data ends, the final flag of the final block is set by overwriting. The other distributed management information and additional management information are set in the same manner as when the file size is known in advance.

【0124】サイズが予め分かっていないファイルをメ
モリカード2に書き込む際の手順について、図15に示
すフローチャートを参照して、詳細に説明する。
A procedure for writing a file whose size is not known in advance to the memory card 2 will be described in detail with reference to the flowchart shown in FIG.

【0125】サイズが予め分かっていないファイルをメ
モリカード2に書き込む際は、先ず、ステップS51に
おいて、データ処理装置1は、メモリカード2に書き込
むファイルの仮のヘッダーを作成する。この段階では、
ファイルサイズが不明なので、この仮のヘッダーには、
ファイルサイズの情報が含まれていない。次に、ステッ
プS52へ進む。
When writing a file whose size is not known in advance to the memory card 2, first, in step S 51, the data processing device 1 creates a temporary header of the file to be written to the memory card 2. At this stage,
Because the file size is unknown, this temporary header contains
Does not include file size information. Next, the process proceeds to step S52.

【0126】ステップS52において、データ処理装置
1は、最初にファイルが格納されるブロックのブロック
フラグを「先頭使用」に設定するとともに、空いている
論理アドレスを確保する。次に、ステップS53へ進
む。
In step S52, the data processing device 1 sets the block flag of the block in which the file is stored first to “use at the beginning” and secures a free logical address. Next, the process proceeds to step S53.

【0127】ステップS53において、データ処理装置
1は、メモリカード2に書き込むデータを準備する。次
に、ステップS54へ進む。
In step S53, the data processing device 1 prepares data to be written to the memory card 2. Next, the process proceeds to step S54.

【0128】ステップS54において、データ処理装置
1は、メモリカード2に書き込むデータが残っているか
否かを判別する。データが終了しておらず、まだデータ
が残っていれば、ステップS55へ進む。一方、データ
が終了しており、データが残っていなければ、ステップ
S61へ進む。
In step S54, the data processing device 1 determines whether or not data to be written to the memory card 2 remains. If the data has not been completed and the data still remains, the process proceeds to step S55. On the other hand, if the data has been completed and no data remains, the process proceeds to step S61.

【0129】ステップS55において、データ処理装置
1は、空いている物理アドレスを検索する。次に、ステ
ップS56へ進む。
In step S55, the data processing device 1 searches for a free physical address. Next, the process proceeds to step S56.

【0130】ステップS56において、データ処理装置
1は、次に続くブロックの論理アドレスを確保して、こ
の論理アドレスを連結アドレスとして設定する。次に、
ステップS57へ進む。
In step S56, the data processing device 1 secures the logical address of the next succeeding block and sets this logical address as a concatenated address. next,
Proceed to step S57.

【0131】ステップS57において、データ処理装置
1は、これまでのステップで設定された情報等に基づい
て、処理の対象となっているブロックについての分散管
理情報を作成する。次に、ステップS58へ進む。
In step S57, the data processing device 1 creates distribution management information for the block to be processed based on the information set in the previous steps. Next, the process proceeds to step S58.

【0132】ステップS58において、データ処理装置
1は、処理の対象となっているブロックに、ページ単位
でデータを順次書き込む。ここで、処理の対象となって
いるブロックにファイルが納まりきらない場合には、1
ブロック分のデータがページ単位で書き込まれる。ま
た、処理の対象となっているブロックにファイルが納ま
りきる場合には、必要なページ分だけページ単位でデー
タが書き込まれる。なお、このステップS58でブロッ
クに書き込まれるのは、新規に書き込むファイルのデー
タと、ステップS57で作成された分散管理情報とであ
る。次に、ステップS59へ進む。
In step S58, the data processing device 1 sequentially writes data in block units to be processed in page units. If the file does not fit in the block to be processed, 1
Block data is written in page units. If the file can be accommodated in the block to be processed, data is written in the required page units in page units. What is written to the block in step S58 is the data of the file to be newly written and the distribution management information created in step S57. Next, the process proceeds to step S59.

【0133】ステップS59において、データ処理装置
1は、書き込んだデータが、ブロックのデータエリアの
途中で終わっているか否かを判別する。そして、データ
エリアの最後に至るまでデータが格納されていれば、ス
テップS53へ戻って処理を繰り返す。一方、データが
データエリアの途中で終わっていれば、ステップS60
へ進む。
In step S59, the data processing device 1 determines whether the written data ends in the middle of the data area of the block. If the data has been stored up to the end of the data area, the process returns to step S53 to repeat the processing. On the other hand, if the data ends in the middle of the data area, step S60
Proceed to.

【0134】ステップS60において、データ処理装置
1は、処理の対象となっているブロックの最終ページの
冗長エリアに格納される追加管理情報に、有効データサ
イズを書き込む。すなわち、データ処理装置1は、ファ
イルの最後の部分が格納されたブロックのデータエリア
に書き込まれたデータのサイズを示す値を、当該ブロッ
クの追加管理情報に有効データサイズとして書き込む。
次に、ステップS61へ進む。
In step S60, the data processing device 1 writes the effective data size in the additional management information stored in the redundant area of the last page of the block to be processed. That is, the data processing device 1 writes the value indicating the size of the data written in the data area of the block in which the last part of the file is stored as the effective data size in the additional management information of the block.
Next, the process proceeds to step S61.

【0135】ステップS61において、データ処理装置
1は、処理の対象となっているブロックの最終フラグを
「ブロック最終」にオーバーライトにより設定する。次
に、ステップS62へ進む。
In step S61, the data processing device 1 sets the last flag of the block to be processed to "block last" by overwriting. Next, the process proceeds to step S62.

【0136】ステップS62において、データ処理装置
1は、ファイルのヘッダーを更新する。すなわち、この
段階では、ファイルサイズが明らかとなっているので、
ファイルサイズの情報を含むヘッダーを新たに作成し
て、上述した仮のヘッダーを、ファイルサイズの情報を
含む新たなヘッダーに書き換える。
At step S62, the data processing device 1 updates the header of the file. In other words, at this stage, the file size is clear,
A new header including the file size information is newly created, and the temporary header described above is rewritten to a new header including the file size information.

【0137】以上で、予めサイズが分かっていなかった
ファイルのメモリカード2への書き込みの処理が完了す
る。
Thus, the process of writing the file whose size is not known in advance into the memory card 2 is completed.

【0138】11.ファイルの更新 つぎに、メモリカード2に格納されているファイルを更
新する際の処理手順について説明する。
[0138] 11. Update of File Next, a processing procedure when updating a file stored in the memory card 2 will be described.

【0139】ファイルの更新時には、データの書き換え
の対象となるブロックと同じ論理アドレスを別のブロッ
クに付して、当該ブロックに対して新しいデータを書き
込む。このとき、古いデータが書かれているブロック
は、ファイルの更新が終了するまで開放せずに保持して
おく。これにより、ファイル更新中に障害が発生したと
しても、ファイル更新前の状態に復旧することが可能と
なる。
When updating a file, the same logical address as that of the block whose data is to be rewritten is assigned to another block, and new data is written to the block. At this time, the block in which the old data is written is held without being released until the file update is completed. As a result, even if a failure occurs during the file update, it is possible to restore the state before the file update.

【0140】このようなファイル更新の手順の具体的な
例を図16を参照して説明する。
A specific example of such a file update procedure will be described with reference to FIG.

【0141】図16(a)に示すように、ファイルの先
頭が、論理アドレス「1」のブロックに格納され、ファ
イルの次の部分が、論理アドレス「2」のブロックに格
納され、ファイルの次の部分が、論理アドレス「3」の
ブロックに格納されていたとする。また、論理アドレス
「1」のブロックの識別番号は「6」、論理アドレス
「2」のブロックの識別番号は「4」、論理アドレス
「3」のブロックの識別番号は「1」であったとする。
As shown in FIG. 16A, the head of the file is stored in the block of the logical address “1”, the next part of the file is stored in the block of the logical address “2”, and the next of the file is stored. Is stored in the block of the logical address “3”. It is also assumed that the identification number of the block having the logical address “1” is “6”, the identification number of the block having the logical address “2” is “4”, and the identification number of the block having the logical address “3” is “1”. .

【0142】そして、このような状態のときに、論理ア
ドレス「2」のブロックのデータを書き換えるとする。
このときは、先ず、図16(b)に示すように、空いて
いる別にブロックに論理アドレス「2」を割り当て、こ
のブロックに新しいデータを書き込む。ここで、新しい
データを書き込むブロックの識別番号には、古いデータ
が書き込まれているブロックの識別番号を1インクリメ
ントした値、すなわち「5」を設定する。
Then, in such a state, it is assumed that the data of the block of the logical address "2" is rewritten.
In this case, first, as shown in FIG. 16B, a logical address "2" is assigned to a free block, and new data is written to this block. Here, as the identification number of the block in which new data is written, a value obtained by incrementing the identification number of the block in which old data is written by 1, that is, “5” is set.

【0143】この段階では、同じ論理アドレスを持つブ
ロックが2つ存在していることとなる。そして、これら
の2つのブロックのうち、識別番号が大きい方のブロッ
クに格納されているデータが新しい方のデータであり、
識別番号が小さい方のブロックに格納されているデータ
が古い方のデータとなる。
At this stage, there are two blocks having the same logical address. Then, of these two blocks, the data stored in the block with the larger identification number is the newer data,
The data stored in the block with the smaller identification number is the older data.

【0144】そして、新しいデータの書き込みが正常に
完了したら、次に、図16(c)に示すように、古いデ
ータが書き込まれていたブロックを消去する。なお、こ
のときは、古いデータが書き込まれていたブロックに対
して消去処理を施すのではなく、該当するブロックのブ
ロックフラグを「未消去」にするだけにしておき、後か
ら適当なタイミングで、このブロックに対して消去処理
を施すようにしてもよい。
Then, when the writing of the new data is completed normally, next, as shown in FIG. 16C, the block in which the old data has been written is erased. At this time, instead of performing the erasing process on the block in which the old data has been written, only the block flag of the corresponding block is set to “not erased”, and at an appropriate timing later, An erasing process may be performed on this block.

【0145】以上のような処理の手順について、図17
に示すフローチャートを参照して、詳細に説明する。
The above processing procedure is described in FIG.
This will be described in detail with reference to the flowchart shown in FIG.

【0146】ファイルを更新する際は、先ず、ステップ
S71において、データ処理装置1は、更新の対象とな
るブロックを選択する。次に、ステップS72へ進む。
When updating a file, first, in step S71, the data processing device 1 selects a block to be updated. Next, the process proceeds to step S72.

【0147】ステップS72において、データ処理装置
1は、更新の対象となるブロックの識別番号を読み出
し、その値を1インクリメントした値を、新しいデータ
を書き込むブロックの識別番号として設定する。また、
新しいデータを書き込むブロックの論理アドレスとし
て、更新の対象となるブロックの論理アドレスと同じ値
を設定する。次に、ステップS73へ進む。
In step S72, the data processing device 1 reads the identification number of the block to be updated, and sets the value obtained by incrementing the value by 1 as the identification number of the block in which new data is to be written. Also,
The same value as the logical address of the block to be updated is set as the logical address of the block in which new data is to be written. Next, the process proceeds to step S73.

【0148】ステップS73において、データ処理装置
1は、ブロックに書き込む新しいデータを準備する。次
に、ステップS74に進む。
In step S73, the data processing device 1 prepares new data to be written to the block. Next, the process proceeds to step S74.

【0149】ステップS74において、データ処理装置
1は、空いている物理アドレスを検索する。次に、ステ
ップS75に進む。
In step S74, the data processing device 1 searches for a free physical address. Next, the process proceeds to step S75.

【0150】ステップS75において、データ処理装置
1は、データの変更が全て完了しているか否かを判別す
る。完了していなければ、ステップS76へ進み、完了
していれば、ステップS79へ進む。
In step S75, the data processing device 1 determines whether or not all data changes have been completed. If not completed, the process proceeds to step S76, and if completed, the process proceeds to step S79.

【0151】ステップS76において、データ処理装置
1は、次に続くブロックの論理アドレスを確保して、こ
の論理アドレスを連結アドレスとして設定する。次に、
ステップS77へ進む。
In step S76, the data processing device 1 secures a logical address of the next block, and sets this logical address as a link address. next,
Proceed to step S77.

【0152】ステップS77において、データ処理装置
1は、これまでのステップで設定された情報等に基づい
て、新しいデータを書き込むブロックについての分散管
理情報を作成する。次に、ステップS78へ進む。
In step S77, the data processing device 1 creates distribution management information for a block in which new data is to be written, based on the information and the like set in the previous steps. Next, the process proceeds to step S78.

【0153】ステップS78において、データ処理装置
1は、ステップS74で検索された物理アドレスのブロ
ックに、ページ単位で新しいデータを順次書き込む。こ
こで、処理の対象となっているブロックにファイルが納
まりきらない場合には、1ブロック分のデータがページ
単位で書き込まれる。また、処理の対象となっているブ
ロックにファイルが納まりきる場合には、必要なページ
分だけページ単位でデータが書き込まれる。なお、この
ステップS78で、ブロックに書き込まれるのは、新し
いファイルのデータと、ステップS77で作成された分
散管理情報とである。そして、このステップS78の後
は、ステップS73へ戻って処理を繰り返す。
In step S78, the data processing device 1 sequentially writes new data in page units in the block of the physical address searched in step S74. If the file does not fit in the block to be processed, data for one block is written in page units. If the file can be accommodated in the block to be processed, data is written in the required page units in page units. Note that what is written to the block in this step S78 is the data of the new file and the distribution management information created in step S77. After step S78, the process returns to step S73 to repeat the processing.

【0154】一方、ステップS79において、データ処
理装置1は、最後に更新の対象となっていたブロック
に、連結アドレスが設定されているか否かを判別する。
連結アドレスが設定されていなければ、ステップS80
へ進み、連結アドレスが設定されていたならば、ステッ
プS81へ進む。
On the other hand, in step S79, the data processing device 1 determines whether or not a link address has been set to the block which was the last to be updated.
If the link address has not been set, step S80
The process proceeds to step S81 if the link address has been set.

【0155】ステップS80において、データ処理装置
1は、最後に新しいデータを書き込んだブロックの最終
フラグを「ブロック最終」に設定する。次に、ステップ
S82へ進む。
In step S80, the data processing device 1 sets the last flag of the last block in which new data has been written to "block last". Next, the process proceeds to step S82.

【0156】一方、ステップS81において、データ処
理装置1は、最後に新しいデータを書き込んだブロック
の連結アドレスに、最後に更新の対象となっていたブロ
ックに設定されていた連結アドレスの値を設定する。次
に、ステップS82へ進む。
On the other hand, in step S81, the data processing device 1 sets the value of the link address set in the block to be updated last in the link address of the block in which the new data was written last. . Next, the process proceeds to step S82.

【0157】ステップS82において、データ処理装置
1は、ファイルのヘッダーを更新する。すなわち、ファ
イルの更新により、ファイルサイズが変更となっている
可能性があるので、新しいファイルサイズの情報を含む
ヘッダーを新たに作成して、ファイルのヘッダーを更新
する。次に、ステップS83へ進む。
In step S82, the data processing device 1 updates the header of the file. That is, since there is a possibility that the file size has been changed due to the update of the file, a header including information on the new file size is newly created and the header of the file is updated. Next, the process proceeds to step S83.

【0158】ステップS83において、データ処理装置
1は、古いデータが書き込まれていたブロックを消去す
る。なお、このときは、古いデータが書き込まれていた
ブロックに対して消去処理を施すのではなく、該当する
ブロックのブロックフラグを「未消去」にするだけにし
ておき、後から適当なタイミングで、これらのブロック
に対して消去処理を施すようにしてもよい。
In step S83, the data processing device 1 erases the block in which the old data has been written. At this time, instead of performing the erasing process on the block in which the old data has been written, only the block flag of the corresponding block is set to “not erased”, and at an appropriate timing later, An erasing process may be performed on these blocks.

【0159】以上でファイルの更新処理が完了する。Thus, the file update processing is completed.

【0160】12.エラー検出訂正処理 以上のようなシステムでは、メモリカード2に新規ファ
イルを書き込んでいるときや、メモリカード2に格納さ
れているファイルを更新しているときなどに、いきなり
電源が遮断されたり、メモリカード2がデータ処理装置
1から強制的に取り外されたりすると、同じ論理アドレ
スを持つ複数のブロックが同時に存在するような状態
(すなわち論理アドレスエラー)となってしまったり、
或いは、連結アドレスで指し示されたブロックが存在し
ないような状態(すなわち連結アドレスエラー)となっ
てしまったりする可能性がある。
[0160] 12. Error Detection and Correction Processing In such a system as described above, when a new file is written to the memory card 2 or when a file stored in the memory card 2 is being updated, the power is suddenly shut off or the memory is turned off. When the card 2 is forcibly removed from the data processing device 1, a state where a plurality of blocks having the same logical address exist simultaneously (that is, a logical address error) occurs,
Alternatively, there is a possibility that a state in which the block indicated by the link address does not exist (that is, a link address error) may occur.

【0161】そこで、本発明を適用したシステムでは、
集合管理情報を構築する際に、論理アドレスエラーや連
結アドレスエラーを検出して訂正するエラー検出訂正処
理を行うようにする。以下、このエラー検出訂正処理に
ついて、詳細に説明する。
Therefore, in a system to which the present invention is applied,
When constructing the set management information, an error detection and correction process for detecting and correcting a logical address error or a link address error is performed. Hereinafter, the error detection and correction processing will be described in detail.

【0162】12−1 エラー検出テーブル 本発明を適用したシステムでは、集合管理情報を構築す
る際に、論理アドレスエラーや連結アドレスエラーの検
出を行う。そして、連結アドレスエラーを検出するため
に使用するテーブルとして、エラー検出テーブルを使用
する。エラー検出テーブルは、連結アドレスエラーの検
出にだけ使用されるテーブルであり、エラー検出訂正処
理を行う際に、データ処理装置1の内部メモリ4に一時
的に確保される。エラー検出テーブルのために確保され
ていた領域は、エラー検出訂正処理が終了した後、開放
される。
12-1 Error Detection Table In the system to which the present invention is applied, a logical address error or a linked address error is detected when constructing the set management information. Then, an error detection table is used as a table used for detecting a link address error. The error detection table is a table used only for detecting a link address error, and is temporarily secured in the internal memory 4 of the data processing device 1 when performing error detection and correction processing. The area reserved for the error detection table is released after the error detection and correction processing ends.

【0163】このエラー検出テーブルは、図18に示す
ように、1論理アドレスに対して、各ブロックの連結状
態を示す1ビットの領域を備えたテーブルである。換言
すれば、エラー検出テーブルは、1エントリあたり1ビ
ットとなっており、各エントリは論理アドレスの連結状
態を「0」又は「1」で示す。処理の対象となるブロッ
クがN個ある場合、このエラー検出テーブルが占める領
域は、N/8バイトとなる。
As shown in FIG. 18, this error detection table is a table provided with a 1-bit area indicating the connection state of each block for one logical address. In other words, the error detection table has one bit per entry, and each entry indicates the connection state of the logical address by “0” or “1”. When there are N blocks to be processed, the area occupied by the error detection table is N / 8 bytes.

【0164】このエラー検出テーブルは、集合管理情報
を構築しているときと、集合管理情報の構築が終了した
ときとで、各ブロックの連結状態を示す値の意味合いが
異なる。
In the error detection table, the meaning of the value indicating the connection state of each block differs between when the set management information is constructed and when the construction of the set management information is completed.

【0165】集合管理情報を構築している最中におい
て、連結状態を示す値が「0」のとき、そのエントリ
は、正常な状態であることを示しているか、或いは、当
該エントリに対応する論理アドレスが、現在処理の対象
となっているブロックまでの間に他のブロックの連結ア
ドレスで指定されていないことを示している。この状態
のときは、今後の処理が進むに従って、値が「1」にな
る可能性があり、連結アドレスエラーであるかどうか不
確定な状態である。
When the value indicating the connection state is “0” during the construction of the set management information, the entry indicates that the entry is in a normal state, or the logic corresponding to the entry is This indicates that the address is not specified by a concatenated address of another block before the current block to be processed. In this state, the value may become "1" as the processing proceeds, and it is uncertain whether it is a linked address error.

【0166】また、集合管理情報を構築している最中に
おいて、連結状態を示す値が「1」のとき、そのエント
リは、当該エントリに対応する論理アドレスが、現在処
理の対象となっているブロックまでの間に他のブロック
の連結アドレスとして指定されているが、物理アドレス
に対応していない状態を示す。この状態のときは、今後
の処理が進むに従って、値が「0」になる可能性があ
り、連結アドレスエラーであるかどうか不確定な状態で
ある。
When the value indicating the connection state is "1" during construction of the set management information, the logical address corresponding to the entry is currently processed. This indicates a state in which a link address of another block is specified before the block, but does not correspond to a physical address. In this state, the value may become “0” as the processing proceeds in the future, and it is uncertain whether or not there is a connection address error.

【0167】一方、集合管理情報の構築が終了した段階
で、連結状態を示す値が「1」のとき、そのエントリ
は、当該エントリに対応する論理アドレスが連結アドレ
スとして指定されているのに、対応する物理アドレスが
存在しないことを示している。したがって、この状態の
ときは、連結アドレスエラーである。
On the other hand, when the value indicating the connection state is “1” at the stage when the construction of the set management information has been completed, the entry indicates that the logical address corresponding to the entry is specified as the connection address. This indicates that the corresponding physical address does not exist. Therefore, in this state, a link address error occurs.

【0168】また、集合管理情報の構築が終了した段階
で、連結状態を示す値が「0」のとき、そのエントリ
は、当該エントリに対応する論理アドレスに関する連結
が正常な状態となっていることを示している。
When the value indicating the connection state is "0" at the stage when the construction of the set management information has been completed, the entry is in a state where the connection related to the logical address corresponding to the entry is normal. Is shown.

【0169】12−2 連結アドレスエラーの検出 つぎに、以上のようなエラー検出テーブルを用いて行わ
れる、連結アドレスエラーの検出について、具体的な例
を挙げて説明する。
12-2 Detection of Linked Address Error Next, detection of a linked address error performed using the above-described error detection table will be described with a specific example.

【0170】例えば、図19に示すように、物理アドレ
ス「10」のブロックについて、その論理アドレスが
「1」、その連結アドレスが「3」であり、また、物理
アドレス「17」のブロックについて、その論理アドレ
スが「3」、その連結アドレスが「2」であったとす
る。また、論理アドレスが「2」のブロックは存在しな
いとする。
For example, as shown in FIG. 19, for a block having a physical address "10", its logical address is "1", its concatenated address is "3", and for a block having a physical address "17", It is assumed that the logical address is “3” and the link address is “2”. It is also assumed that there is no block whose logical address is “2”.

【0171】このとき、集合管理情報の再構築の処理が
行われると、集合管理情報の再構築に伴って、図20に
示すように、連結アドレスエラーの検出が行われる。
At this time, if the process of reconstructing the collective management information is performed, a connection address error is detected as shown in FIG. 20 along with the restructuring of the collective management information.

【0172】先ず、初期状態では、図20(a)に示す
ように、論理アドレス「1」「2」「3」のそれぞれに
ついて、エラー検出テーブルの値は、すべて初期値
「0」とする。また、集合管理情報の変換テーブルも、
全て初期値「0xffff」とする。このとき、集合管理情報
の連結テーブルは、全く値が入っていない状態とする。
First, in the initial state, as shown in FIG. 20A, the values of the error detection table are all set to the initial value "0" for each of the logical addresses "1", "2" and "3". In addition, the conversion table of the set management information is also
All are set to the initial value "0xffff". At this time, the consolidation table of the set management information is in a state where no value is entered.

【0173】次に、論理アドレス「1」のブロックにつ
いての情報を読み込む。これにより、図20(b)に示
すように、論理アドレス「1」に対応する変換テーブル
の値は、論理アドレス「1」のブロックの物理アドレス
の値、すなわち「10」とされる。また、論理アドレス
「1」に対応する連結テーブルの値は、論理アドレス
「1」のブロックの連結アドレスの値、すなわち「3」
とされる。
Next, information on the block having the logical address "1" is read. Thus, as shown in FIG. 20B, the value of the conversion table corresponding to the logical address “1” is the value of the physical address of the block having the logical address “1”, that is, “10”. The value of the link table corresponding to the logical address “1” is the value of the link address of the block having the logical address “1”, that is, “3”.
It is said.

【0174】次に、論理アドレス「1」に対応する連結
テーブルの値が指し示す論理アドレス「3」のエントリ
を確認する。このとき、論理アドレス「3」のエントリ
には、物理ブロックが割り当てられていないので、図2
0(c)に示すように、論理アドレス「3」に対応する
エラー検出テーブルの値を「1」とする。また、論理ア
ドレス「3」に対応する変換テーブルの値は、連結元の
論理アドレスの値、すなわち「1」とする。
Next, the entry of the logical address “3” indicated by the value of the concatenation table corresponding to the logical address “1” is confirmed. At this time, since the physical block is not allocated to the entry of the logical address “3”, FIG.
As shown in 0 (c), the value of the error detection table corresponding to the logical address “3” is “1”. The value of the conversion table corresponding to the logical address “3” is the value of the logical address of the connection source, that is, “1”.

【0175】次に、エラー検出テーブルの値が「1」と
なっている論理アドレス「3」のブロックについて、そ
の情報を読み込む。このとき、論理アドレス「3」のブ
ロックは存在しており、当該ブロックの情報は正常に読
み込むことができる。したがって、図20(d)に示す
ように、論理アドレス「3」に対応するエラー検出テー
ブルの値を「0」とする。また、このとき、論理アドレ
ス「3」に対応する変換テーブルの値は、論理アドレス
「3」のブロックの物理アドレスの値、すなわち「1
7」とする。また、論理アドレス「3」に対応する連結
テーブルの値は、論理アドレス「3」のブロックの連結
アドレスの値、すなわち「2」とする。
Next, the information of the block of the logical address “3” whose value of the error detection table is “1” is read. At this time, the block with the logical address “3” exists, and the information of the block can be read normally. Therefore, as shown in FIG. 20D, the value of the error detection table corresponding to the logical address “3” is set to “0”. At this time, the value of the conversion table corresponding to the logical address “3” is the value of the physical address of the block of the logical address “3”, that is, “1”.
7 ". The value of the link table corresponding to the logical address “3” is the value of the link address of the block having the logical address “3”, that is, “2”.

【0176】次に、論理アドレス「3」に対応する連結
テーブルの値が指し示す論理アドレス「2」のエントリ
を確認する。このとき、論理アドレス「2」のエントリ
には、物理ブロックが割り当てられていないので、図2
0(e)に示すように、論理アドレス「2」に対応する
エラー検出テーブルの値を「1」とする。また、論理ア
ドレス「2」に対応する変換テーブルの値は、連結元の
論理アドレスの値、すなわち「3」とする。
Next, the entry of the logical address “2” indicated by the value of the concatenation table corresponding to the logical address “3” is confirmed. At this time, since the physical block is not allocated to the entry of the logical address “2”, FIG.
As shown in 0 (e), the value of the error detection table corresponding to the logical address “2” is set to “1”. The value of the conversion table corresponding to the logical address “2” is the value of the logical address of the connection source, that is, “3”.

【0177】次に、エラー検出テーブルの値が「1」と
なっている論理アドレス「2」のブロックについて、そ
の情報の読み込みを試みる。しかしながら、論理アドレ
スが「2」のブロックは存在していないので、この段階
で、連結アドレスエラーであることが判明する。
Next, an attempt is made to read the information of the block of the logical address "2" in which the value of the error detection table is "1". However, since the block having the logical address “2” does not exist, it is determined at this stage that a link address error has occurred.

【0178】12−3 エラー訂正処理 本発明を適用したシステムにおいて、論理アドレスエラ
ーに対するエラー訂正処理は、以下のように行う。
12-3 Error Correction Processing In a system to which the present invention is applied, error correction processing for a logical address error is performed as follows.

【0179】論理アドレスエラーが生じているときに
は、同じ論理アドレスを持つブロックをそれぞれ調べ
る。そして、ブロックとして完全なものが1つしかない
場合には、完全なブロックを生かして、残りのブロック
は無効とする。
When a logical address error has occurred, each block having the same logical address is examined. If there is only one complete block, the complete block is used and the remaining blocks are invalidated.

【0180】また、同じ論理アドレスを持つ完全なブロ
ック(ブートブロックを除く。)が複数ある場合には、
識別番号を比較して値が小さい方のブロックを生かす。
なお、一方のブロックの識別番号が「255」であり、
他方のブロックの識別番号が「0」の場合には、識別番
号が「255」のブロックを生かすようにする。
When there are a plurality of complete blocks (excluding the boot block) having the same logical address,
The identification number is compared, and the block having the smaller value is used.
The identification number of one block is “255”,
If the identification number of the other block is "0", the block with the identification number of "255" is used.

【0181】なお、通常は、同じ論理アドレスを持つブ
ロックが複数あったとしても、それらの識別番号の差は
1である。この条件に当てはまらないような場合には、
システムの側で自動的にエラー訂正処理を行うのではな
く、手動復旧モードとする。
Normally, even if there are a plurality of blocks having the same logical address, the difference between their identification numbers is 1. If this is not the case,
Instead of automatically performing error correction processing on the system side, a manual recovery mode is set.

【0182】また、本発明を適用したシステムにおい
て、連結アドレスエラーが生じた場合には、メモリカー
ド2を使用するアプリケーションソフトウェアやメモリ
カード2に格納するデータ等に応じた適切なエラー訂正
処理を行うようにする。具体的には、例えば、以下に挙
げるようなエラー訂正処理を行うようにすればよい。
In the system to which the present invention is applied, when a link address error occurs, an appropriate error correction process is performed according to application software that uses the memory card 2, data stored in the memory card 2, and the like. To do. Specifically, for example, the following error correction processing may be performed.

【0183】すなわち、例えば、最後の連結アドレスが
指し示すブロックとして新規ブロックを割り当てる。そ
して、最後のブロックのデータを正しく読めるページま
で読み込んで、そのページまでのデータを新規ブロック
にコピーする。このとき、新規ブロックの最終フラグは
「ブロック最終」としておく。このようなエラー訂正処
理は、対象となるデータが音楽データ等のようにデータ
の途中でも意味があるデータの場合に、特に好適であ
る。
That is, for example, a new block is assigned as the block indicated by the last link address. Then, the data of the last block is read up to a page that can be read correctly, and the data up to that page is copied to a new block. At this time, the final flag of the new block is set to “block final”. Such error correction processing is particularly suitable when the target data is data that is significant even in the middle of data, such as music data.

【0184】或いは、例えば、連結アドレスエラーが生
じたブロックを含むファイル全体を削除する。このよう
なエラー訂正処理は、対象となるデータがプログラムや
画像データ等のようにデータの途中では意味をなさない
データである場合に、特に好適である。
Alternatively, for example, the entire file including the block in which the link address error has occurred is deleted. Such error correction processing is particularly suitable when the target data is data that does not make sense in the middle of data, such as a program or image data.

【0185】12−4 集合管理情報の構築とエラー検
出訂正処理 本発明を適用したシステムにおいて、物理アドレスエラ
ーや連結アドレスエラーが発生するのは、データ更新処
理の途中に何らかの障害が発生した場合である。そし
て、本発明を適用したシステムでは、上述したように、
データ更新処理に先だってメモリカード2に格納されて
いる集合管理情報を無効にするようにしている。したが
って、物理アドレスエラーや連結アドレスエラーが発生
するときには、集合管理情報が無効となっている。そし
て、集合管理情報が無効となっているときには、次にメ
モリカード2を起動するときに、全てのブロックの分散
管理情報を調べ直して集合管理情報を再構築する処理が
必ず行われる。
12-4 Construction of Set Management Information and Error Detection
Output Correction Process In a system to which the present invention is applied, a physical address error or a link address error occurs when some trouble occurs during the data update process. And in the system to which the present invention is applied, as described above,
Prior to the data update processing, the collective management information stored in the memory card 2 is invalidated. Therefore, when a physical address error or a link address error occurs, the set management information is invalid. When the collective management information is invalid, when the memory card 2 is started next, the process of re-examining the distributed management information of all the blocks and reconstructing the collective management information is always performed.

【0186】そこで、このシステムでは、集合管理情報
を再構築する際に、全てのブロックを調べ直すというこ
とに着目し、このときにエラー検出訂正処理を同時に行
う。換言すれば、集合管理情報が有効となっているとき
には、物理アドレスエラーや連結アドレスエラーが発生
している可能性はないので、このときにはエラー検出訂
正処理を行わない。すなわち、この方法では、集合管理
情報の再構築時にだけ、エラー検出訂正処理を行う。こ
れにより、エラー検出訂正処理のためにメモリカード2
に余分にアクセスする必要がなくなる。その結果、例え
ば、メモリカード2の速やかな起動が可能となる。
Therefore, in this system, when reconstructing the set management information, attention is paid to rechecking all blocks, and at this time, error detection and correction processing is performed simultaneously. In other words, when the set management information is valid, there is no possibility that a physical address error or a concatenated address error has occurred, and no error detection and correction processing is performed at this time. That is, in this method, the error detection and correction processing is performed only when the set management information is reconstructed. This allows the memory card 2 to perform error detection and correction processing.
There is no need for extra access to. As a result, for example, the memory card 2 can be quickly activated.

【0187】このエラー検出訂正処理は、以下のような
手順によって行われる。
This error detection and correction processing is performed according to the following procedure.

【0188】(1)データ処理装置1の内部メモリ4上
の変換テーブルを全て「0xffff」で初期化する。また、
内部メモリ4上にエラー検出テーブルの領域を確保し、
当該エラー検出テーブルを全て「0」で初期化する。
(1) The conversion tables on the internal memory 4 of the data processing device 1 are all initialized to “0xffff”. Also,
The area of the error detection table is secured in the internal memory 4,
The error detection table is all initialized to “0”.

【0189】(2)ブロックの先頭に移動する。(2) Move to the beginning of the block.

【0190】(3)ブロックから分散管理情報を読み込
み、当該分散管理情報を用いてビットマップテーブルを
構築する。このとき、可/不可フラグが「使用不可」で
あるか、或いはブロックフラグが「未使用」又は「未消
去」である場合には、ビットマップテーブルの作成が終
了したら、次のブロックへ移動して処理を繰り返す。
(3) The distribution management information is read from the block, and a bitmap table is constructed using the distribution management information. At this time, if the enable / disable flag is “unusable” or the block flag is “unused” or “unerased”, the process moves to the next block after the bitmap table is created. And repeat the process.

【0191】(4)ブロックの論理アドレス(以下、論
理アドレスAとする。)と、連結アドレス(以下、論理
アドレスBとする。)とを調べる。
(4) Check the logical address of the block (hereinafter, logical address A) and the concatenated address (hereinafter, logical address B).

【0192】(5)論理アドレスAが「0xffff」の場合
は、次のブロックへ移動し、(3)へ戻って処理を繰り
返す。
(5) If the logical address A is "0xffff", the process moves to the next block, returns to (3), and repeats the process.

【0193】(6)エラー検出テーブルの論理アドレス
Aの欄を調べる。エラー検出テーブルの論理アドレスA
の欄が「1」となっている場合は、「0」に書き換える
とともに、変換テーブルの論理アドレスAの欄に、論理
アドレス「A」のブロックの物理アドレスを書き込む。
また、エラー検出テーブルの論理アドレスAの欄が
「0」となっている場合は、変換テーブルの論理アドレ
スAの欄を調べる。そして、変換テーブルの論理アドレ
スAの値が「0xffff」のときは、そこに、論理アドレス
Aのブロックの物理アドレスを書き込む。
(6) Check the column of logical address A in the error detection table. Logical address A of error detection table
Is replaced with "0" and the physical address of the block of the logical address "A" is written in the column of the logical address A in the conversion table.
If the logical address A column of the error detection table is “0”, the logical address A column of the conversion table is checked. When the value of the logical address A in the conversion table is “0xffff”, the physical address of the block of the logical address A is written therein.

【0194】なお、変換テーブルの論理アドレスAの値
として、「0xffff」以外の値が既に入っている場合は、
論理アドレスエラーが発生している場合であるので、論
理アドレスエラーに対するエラー訂正処理を行う。
When a value other than “0xffff” is already entered as the value of the logical address A in the conversion table,
Since a logical address error has occurred, error correction processing for the logical address error is performed.

【0195】(7)連結テーブルの論理アドレスAの欄
に、論理アドレスBの値を記入する。
(7) The value of the logical address B is entered in the column of the logical address A in the connection table.

【0196】(8)最終フラグが「ブロック最終」とな
っているかを調べる。「ブロック最終」となっていれ
ば、連結アドレスは無効なので、次のブロックに移動
し、(3)へ戻って処理を繰り返す。
(8) Check whether the last flag is "block last". If it is "block end", the linked address is invalid, so the process moves to the next block, returns to (3), and repeats the process.

【0197】(9)論理アドレスBに物理アドレスが対
応しているかどうかを、変換テーブルを用いて確認す
る。変換テーブルの論理アドレスBの値が「0xffff」以
外の場合は、論理アドレスBに物理アドレスが対応して
いる。一方、変換テーブルの論理アドレスBの値が「0x
ffff」の場合は、現在のブロックまでの段階では、論理
アドレスBに物理アドレスが対応していない。このとき
は、エラー検出テーブルの論理アドレスBの欄に「1」
を書き込むとともに、変換テーブルの論理アドレスBの
欄に論理アドレスAの値を記入する。その後、次のブロ
ックに移動し、(3)へ戻って処理を繰り返す。
(9) Whether or not a physical address corresponds to the logical address B is confirmed by using a conversion table. When the value of the logical address B in the conversion table is other than “0xffff”, the physical address corresponds to the logical address B. On the other hand, if the value of the logical address B in the conversion table is “0x
In the case of “ffff”, the physical address does not correspond to the logical address B up to the current block. At this time, “1” is entered in the logical address B column of the error detection table.
Is written, and the value of the logical address A is written in the column of the logical address B in the conversion table. Thereafter, the process moves to the next block, returns to (3), and repeats the processing.

【0198】なお、変換テーブルの論理アドレスBの値
が「0xffff」となっても、ブロックの途中までしか処理
を行っていない段階では、論理アドレスBに物理アドレ
スが本当に対応していないのかは明らかではない。すな
わち、論理アドレスBに物理アドレスが本当に対応して
いない場合と、今後処理を進めて行くに従って、対応す
るブロックが現れる場合との2通りがあり得る。
Even if the value of the logical address B in the conversion table is "0xffff", it is clear whether or not the physical address really corresponds to the logical address B at the stage where processing is performed only halfway through the block. is not. That is, there are two cases: a case where the physical address does not really correspond to the logical address B, and a case where the corresponding block appears as the processing proceeds in the future.

【0199】(10)全てのブロックに対して処理を行
った後、エラー検出テーブルを参照する。エラー検出テ
ーブルの値が「1」となっている論理アドレスは、物理
アドレスが対応していない。すなわち、連結アドレスエ
ラーが発生している。このときは、変換テーブル内に連
結元のブロックの論理アドレスが格納されているので、
これを用いて元ブロックを特定し、適切なエラー訂正処
理を行う。なお、エラー訂正処理を行った後は、エラー
検出テーブルの値を「0」にし、該当する変換テーブル
の値を「0xffff」にしておく。
(10) After processing all blocks, the error detection table is referred to. A logical address whose value in the error detection table is “1” does not correspond to a physical address. That is, a link address error has occurred. In this case, since the logical address of the link source block is stored in the conversion table,
Using this, the original block is specified, and appropriate error correction processing is performed. After the error correction processing, the value of the error detection table is set to “0”, and the value of the corresponding conversion table is set to “0xffff”.

【0200】本発明を適用したシステムでは、以上のよ
うに、集合管理情報を構築するときにエラー検出訂正処
理を行う。以下、このような集合管理情報の構築及びエ
ラー検出訂正処理の具体的な方法について、図21乃至
図23に示すフローチャートを参照して、更に詳細に説
明する。
In the system to which the present invention is applied, as described above, the error detection and correction processing is performed when constructing the set management information. Hereinafter, a specific method of constructing the set management information and performing the error detection and correction processing will be described in more detail with reference to flowcharts illustrated in FIGS.

【0201】なお、ここでは、変数としてI,A,B,
C,D,T(I)を使用し、定数としてNを使用する。
変数Iは、物理アドレスが入力される変数であり、変数
Aは、論理アドレスが入力される変数であり、変数B
は、連結アドレスが入力される変数であり、変数C,D
は、識別番号の値が入力される変数であり、変数T
(I)は、論理アドレス「I」に対応するエラー検出テ
ーブルの値を示す変数である。また、定数Nは、総ブロ
ック数を示す定数である。
Here, the variables I, A, B,
Use C, D, T (I) and N as a constant.
The variable I is a variable to which a physical address is input, the variable A is a variable to which a logical address is input, and the variable B
Are variables to which a link address is input, and variables C and D
Is a variable to which the value of the identification number is input, and the variable T
(I) is a variable indicating the value of the error detection table corresponding to the logical address “I”. The constant N is a constant indicating the total number of blocks.

【0202】集合管理情報を構築する際は、図21のス
テップS101において、データ処理装置1は、変換テ
ーブルを初期化し、全ての値を「0xffff」とする。次に
ステップS102へ進む。
When constructing the group management information, in step S101 of FIG. 21, the data processing device 1 initializes the conversion table and sets all values to “0xffff”. Next, the process proceeds to step S102.

【0203】ステップS102において、データ処理装
置1は、エラー検出テーブルを初期化し、全ての値を
「0」とする。次にステップS103へ進む。
In step S102, the data processing device 1 initializes the error detection table and sets all values to "0". Next, the process proceeds to step S103.

【0204】ステップS103において、データ処理装
置1は、変数Iに「0」を代入する。次にステップS1
04へ進む。
In step S103, the data processing device 1 substitutes “0” for the variable I. Next, step S1
Go to 04.

【0205】ステップS104において、データ処理装
置1は、物理アドレス「I」のブロックの分散管理情報
をメモリカード2から読み込む。次にステップS105
へ進む。
In step S 104, the data processing device 1 reads the distribution management information of the block having the physical address “I” from the memory card 2. Next, step S105
Proceed to.

【0206】ステップS105において、データ処理装
置1は、ステップS104で読み込んだ分散管理情報の
可/不可フラグを参照して、物理アドレス「I」のブロ
ックが使用可能か否かを判別する。使用可能であれば、
ステップS106へ進み、使用不可能であれば、ステッ
プS129へ進む。
In step S105, the data processing device 1 refers to the permission / inhibition flag of the distribution management information read in step S104 to determine whether the block of the physical address “I” is usable. If available,
Proceed to step S106, and if unusable, proceed to step S129.

【0207】ステップS106において、データ処理装
置1は、ステップS104で読み込んだ分散管理情報の
ブロックフラグを参照して、物理アドレス「I」のブロ
ックが使用中であるか否かを判別する。具体的には、ブ
ロックフラグが「先頭使用」又は「使用」になっている
か否かを判別する。ブロックフラグが「先頭使用」又は
「使用」になっており、当該ブロックが使用中であれ
ば、ステップS107へ進む。また、当該ブロックが使
用中でなければ、ステップS129へ進む。
In step S106, the data processing device 1 refers to the block flag of the distribution management information read in step S104, and determines whether the block of the physical address “I” is in use. Specifically, it is determined whether or not the block flag is set to “head use” or “use”. If the block flag is “head use” or “use” and the block is in use, the process proceeds to step S107. If the block is not in use, the process proceeds to step S129.

【0208】ステップS107において、データ処理装
置1は、物理アドレス「I」のブロックについての情報
をビットマップテーブルに加える。次に、ステップS1
08へ進む。
In step S107, the data processing device 1 adds information on the block of the physical address “I” to the bitmap table. Next, step S1
Proceed to 08.

【0209】ステップS108において、データ処理装
置1は、ステップS104で読み出した分散管理情報に
基づいて、物理アドレス「I」のブロックの論理アドレ
スを変数Aに代入し、物理アドレス「I」のブロックの
連結アドレスを変数Bに代入する。次にステップS10
9へ進む。
[0209] In step S108, the data processing device 1 substitutes the logical address of the block of the physical address "I" into the variable A based on the distribution management information read in step S104, and sets the logical address of the block of the physical address "I". The link address is assigned to the variable B. Next, step S10
Go to 9.

【0210】ステップS109において、データ処理装
置1は、Aの値が「0xffff」であるか否かを判別する。
「0xffff」でなければ、ステップS110へ進み、「0x
ffff」であれば、図22のステップS120へ進む。
[0210] In step S109, the data processing device 1 determines whether or not the value of A is "0xffff".
If it is not “0xffff”, the process proceeds to step S110, and “0xffff”
If “ffff”, the process proceeds to step S120 in FIG.

【0211】ステップS110において、データ処理装
置1は、エラー検出テーブルの論理アドレス「A」の値
を調べる。次にステップS111へ進む。
In step S110, the data processing device 1 checks the value of the logical address “A” in the error detection table. Next, the process proceeds to step S111.

【0212】ステップS111において、データ処理装
置1は、エラー検出テーブルの論理アドレス「A」の値
が「1」であるかを判別する。「1」であれば、ステッ
プS112へ進み、「1」でなければステップS130
へ進む。
In step S111, the data processing device 1 determines whether the value of the logical address “A” in the error detection table is “1”. If “1”, the process proceeds to step S112, and if “1”, the process proceeds to step S130.
Proceed to.

【0213】ステップS112において、データ処理装
置1は、エラー検出テーブルの論理アドレス「A」の値
を「0」に書き換える。次に、ステップS113へ進
む。
In step S112, the data processing device 1 rewrites the value of the logical address “A” in the error detection table to “0”. Next, the process proceeds to step S113.

【0214】ステップS113において、データ処理装
置1は、変換テーブルの論理アドレス「A」の欄に、変
数「I」(すなわち物理ブロック「I」)を書き込む。
次に、ステップS114へ進む。
In step S113, the data processing device 1 writes the variable “I” (ie, the physical block “I”) in the column of the logical address “A” in the conversion table.
Next, the process proceeds to step S114.

【0215】ステップS114において、データ処理装
置1は、連結テーブルの論理アドレス「A」の欄に、変
数「B」(すなわち連結アドレス「B」)を書き込む。
次に、ステップS115へ進む。
In step S114, the data processing device 1 writes the variable “B” (ie, the connection address “B”) in the column of the logical address “A” in the connection table.
Next, the process proceeds to step S115.

【0216】ステップS115において、データ処理装
置1は、最終フラグが「ブロック最終」になっているか
否かを判別する。「ブロック最終」になっていなけれ
ば、ステップS116へ進み、「ブロック最終」になっ
ていれば、図22のステップS120へ進む。
[0216] In step S115, the data processing device 1 determines whether or not the last flag is "block last". If it has not reached the "block end", the process proceeds to step S116, and if it has reached the "block end", the process proceeds to step S120 in FIG.

【0217】ステップS116において、データ処理装
置1は、論理アドレス「B」に対応する変換テーブルの
値を調べる。次に、ステップS117へ進む。
At step S116, the data processing device 1 checks the value of the conversion table corresponding to the logical address "B". Next, the process proceeds to step S117.

【0218】ステップS117において、データ処理装
置1は、論理アドレス「B」に対応する変換テーブルの
値が「0xffff」であるかを判別する。「0xffff」であれ
ば、ステップS118へ進み、「0xffff」でなければ、
図22のステップS120へ進む。
In step S117, the data processing device 1 determines whether the value of the conversion table corresponding to the logical address “B” is “0xffff”. If “0xffff”, the process proceeds to step S118, and if not “0xffff”,
The process proceeds to step S120 in FIG.

【0219】ステップS118において、データ処理装
置1は、エラー検出テーブルの論理アドレス「B」の欄
を「1」に書き換える。次に、ステップS119へ進
む。
In step S118, the data processing device 1 rewrites the column of the logical address “B” in the error detection table to “1”. Next, the process proceeds to step S119.

【0220】ステップS119において、データ処理装
置1は、エラー検出テーブルの論理アドレス「B」の欄
に、論理アドレス「A」を書き込む。次に、図22のス
テップS120へ進む。
[0220] In step S119, the data processing device 1 writes the logical address "A" in the logical address "B" column of the error detection table. Next, the process proceeds to step S120 in FIG.

【0221】図22のステップS120において、デー
タ処理装置1は、変数Iの値と、総ブロック数を示す定
数Nの値とを比較する。I<Nでなければ、ステップS
121へ進み、I<Nであれば、ステップS128へ進
む。
At step S120 in FIG. 22, the data processing device 1 compares the value of the variable I with the value of a constant N indicating the total number of blocks. If I <N, step S
The process proceeds to 121, and if I <N, the process proceeds to step S128.

【0222】ステップS121において、データ処理装
置1は、変数Iに「0」を代入する。次にステップS1
22へ進む。
In step S121, the data processing device 1 substitutes “0” for the variable I. Next, step S1
Proceed to 22.

【0223】ステップS122において、データ処理装
置1は、エラー検出テーブルの論理アドレス「I」の値
を示す変数T(I)が「1」であるかを判別する。
「1」でなければステップS123へ進み、「1」であ
ればステップS125へ進む。
In step S122, the data processing device 1 determines whether the variable T (I) indicating the value of the logical address “I” in the error detection table is “1”.
If it is not "1", the process proceeds to step S123, and if it is "1", the process proceeds to step S125.

【0224】ステップS123において、データ処理装
置1は、変数Iの値と、総ブロック数を示す定数Nの値
とを比較する。I=Nであれば、これで処理を終了す
る。I=Nでなければ、ステップS124へ進む。
In step S123, the data processing device 1 compares the value of the variable I with the value of a constant N indicating the total number of blocks. If I = N, the process ends here. If not I = N, the process proceeds to step S124.

【0225】ステップS124において、データ処理装
置1は、変数Iの値を1インクリメントする。その後、
ステップS122へ戻って処理を繰り返す。
[0225] In step S124, the data processing device 1 increments the value of the variable I by one. afterwards,
Returning to step S122, the process is repeated.

【0226】また、ステップS122で変数T(I)が
「1」であったときは、上述したようにステップS12
5へ進む。このステップS125に進むのは、連結アド
レスエラーが生じていたときである。そこで、ステップ
S125において、データ処理装置1は、連結アドレス
エラーに対する所定のエラー訂正処理を行う。ここで
は、上述したように、メモリカード2を使用するアプリ
ケーションソフトウェアやメモリカード2に格納するデ
ータ等に応じた適切なエラー訂正処理を行うようにす
る。そして、エラー訂正処理が完了したら、ステップS
126へ進む。
If the variable T (I) is "1" in step S122, as described above, the process proceeds to step S12.
Go to 5. The process proceeds to step S125 when a link address error has occurred. Therefore, in step S125, the data processing device 1 performs a predetermined error correction process for the link address error. Here, as described above, an appropriate error correction process is performed according to application software that uses the memory card 2, data stored in the memory card 2, and the like. Then, when the error correction processing is completed, step S
Go to 126.

【0227】ステップS126において、データ処理装
置1は、エラー検出テーブルの論理アドレス「I」の値
を「0」にする。次に、ステップS127へ進む。
In step S126, the data processing device 1 sets the value of the logical address “I” in the error detection table to “0”. Next, the process proceeds to step S127.

【0228】ステップS127において、データ処理装
置1は、変換テーブルの論理アドレス「I」の欄を「0x
ffff」に書き換える。その後、ステップS123へ進
み、上述した処理を行う。
In step S127, the data processing device 1 sets the logical address “I” column of the conversion table to “0x”.
ffff ”. Thereafter, the process proceeds to step S123, and performs the above-described processing.

【0229】また、ステップS120でI<Nであった
ときは、上述したようにステップS128へ進む。この
ステップS128へ進むのは、全ブロックについての分
散管理情報の読み出しが完了していないときである。そ
こで、このステップS128において、データ処理装置
1は、変数Iの値を1インクリメントし、その後、図2
1のステップS104へ戻って処理を繰り返す。
When I <N in step S120, the process proceeds to step S128 as described above. The process proceeds to step S128 when the reading of the distribution management information has not been completed for all blocks. Therefore, in step S128, the data processing device 1 increments the value of the variable I by one, and thereafter,
The process returns to Step S104 of Step 1 and is repeated.

【0230】また、図21のステップS105で物理ア
ドレス「I」のブロックが使用不可能であったとき、及
びステップS106で物理アドレス「I」のブロックが
使用中でなかったときは、上述したようにステップS1
29へ進む。
When the block of the physical address "I" is unusable in step S105 of FIG. 21 and when the block of the physical address "I" is not in use in step S106, Step S1
Go to 29.

【0231】ステップS129において、データ処理装
置1は、物理アドレス「I」のブロックについての情報
をビットマップテーブルに加える。その後、図22のス
テップS120へ進み、上述した処理を行う。
In step S129, the data processing device 1 adds information on the block having the physical address “I” to the bitmap table. Thereafter, the process proceeds to step S120 in FIG. 22, and the above-described processing is performed.

【0232】また、図21のステップS111でエラー
検出テーブルの論理アドレス「A」の値が「1」でなか
ったときは、上述したようにステップS130へ進む。
このステップS130において、データ処理装置1は、
変換テーブルの論理アドレス「A」の値を調べる。次
に、ステップS131へ進む。
If the value of the logical address "A" in the error detection table is not "1" in step S111 of FIG. 21, the process proceeds to step S130 as described above.
In this step S130, the data processing device 1
The value of the logical address “A” in the conversion table is checked. Next, the process proceeds to step S131.

【0233】ステップS131において、データ処理装
置1は、変換テーブルの論理アドレス「A」の値が「0x
ffff」であるかを判別する。「0xffff」であれば、ステ
ップS113へ進んで上述した処理を行い、「0xffff」
でなければ、図23のステップS132へ進む。
In step S131, the data processing device 1 sets the value of the logical address “A” in the conversion table to “0x
ffff ”. If “0xffff”, the process proceeds to step S113 to perform the above-described processing, and “0xffff”
If not, the process proceeds to step S132 in FIG.

【0234】図23のステップS132に進むのは、論
理アドレスエラーが生じて、論理アドレス「A」を持つ
ブロックが2つ存在しているときである。そこで、ステ
ップS132において、データ処理装置1は、論理アド
レス「A」を持つ2つのブロックの識別番号を読み出
す。そして、一方のブロックの識別番号が読み出せた
ら、その値を変数Cに代入する。また、他方のブロック
の識別番号が読み出せたら、その値を変数Dに代入す
る。次にステップS133へ進む。
The process proceeds to step S132 in FIG. 23 when a logical address error has occurred and there are two blocks having the logical address "A". Therefore, in step S132, the data processing device 1 reads the identification numbers of the two blocks having the logical address “A”. When the identification number of one block can be read, the value is substituted for the variable C. When the identification number of the other block can be read, the value is substituted for the variable D. Next, the process proceeds to step S133.

【0235】ステップS133において、データ処理装
置1は、ステップS132での識別番号の読み出しが正
常に行えたかを判別する。変数Cに代入される識別番号
だけが読み出せたときは、ステップS134へ進み、そ
れ以外のときは、ステップS137へ進む。
[0235] In step S133, the data processing device 1 determines whether the identification number has been read out normally in step S132. When only the identification number assigned to the variable C can be read, the process proceeds to step S134, otherwise, the process proceeds to step S137.

【0236】ステップS134において、データ処理装
置1は、変数Dに対応するブロックのブロックフラグを
「未消去」にする。次にステップS135へ進む。
In step S134, the data processing device 1 sets the block flag of the block corresponding to the variable D to “not erased”. Next, the process proceeds to step S135.

【0237】ステップS135において、データ処理装
置1は、ステップS134での処理、すなわち変数Dに
対応するブロックのブロックフラグを「未消去」にする
処理が成功したかを判別する。成功していれば、図21
のステップS113へ戻って上述した処理を行い、成功
していなければ、ステップS136へ進む。
[0237] In step S135, the data processing device 1 determines whether the process in step S134, that is, the process of setting the block flag of the block corresponding to the variable D to "unerased" was successful. If successful, Figure 21
Returning to step S113, the above-described processing is performed, and if not successful, the flow proceeds to step S136.

【0238】ステップS136において、データ処理装
置1は、変数Dに対応するブロックの可/不可フラグを
「使用不可」にする。その後、図21のステップS11
3へ戻って上述した処理を行う。
In step S136, the data processing device 1 sets the permission / inhibition flag of the block corresponding to the variable D to “unusable”. Thereafter, step S11 in FIG.
3 and the above-described processing is performed.

【0239】また、ステップS137において、データ
処理装置1は、ステップS132での識別番号の読み出
しが正常に行えたかを判別する。変数Dに代入される識
別番号だけが読み出せたときは、ステップS138へ進
み、それ以外のときは、ステップS141へ進む。
In step S137, the data processing device 1 determines whether the reading of the identification number in step S132 has been performed normally. If only the identification number assigned to the variable D can be read, the process proceeds to step S138; otherwise, the process proceeds to step S141.

【0240】ステップS138において、データ処理装
置1は、変数Cに対応するブロックのブロックフラグを
「未消去」にする。次にステップS139へ進む。
In step S138, the data processing device 1 sets the block flag of the block corresponding to the variable C to “not erased”. Next, the process proceeds to step S139.

【0241】ステップS139において、データ処理装
置1は、ステップS138での処理、すなわち変数Cに
対応するブロックのブロックフラグを「未消去」にする
処理が成功したかを判別する。成功していれば、図21
のステップS113へ戻って上述した処理を行い、成功
していなければ、ステップS140へ進む。
In step S139, the data processing device 1 determines whether or not the process in step S138, that is, the process of setting the block flag of the block corresponding to the variable C to “not erased” has succeeded. If successful, Figure 21
Returning to step S113, the above-described processing is performed, and if not successful, the flow proceeds to step S140.

【0242】ステップS140において、データ処理装
置1は、変数Cに対応するブロックの可/不可フラグを
「使用不可」にする。その後、図21のステップS11
3へ戻って上述した処理を行う。
In step S140, the data processing device 1 sets the permission / inhibition flag of the block corresponding to the variable C to “unusable”. Thereafter, step S11 in FIG.
3 and the above-described processing is performed.

【0243】また、ステップS141において、データ
処理装置1は、ステップS132での識別番号の読み出
しが正常に行えたかを判別する。変数Cに代入される識
別番号と、変数Dに代入される識別番号との両方が正常
に読み出せたときは、ステップS142へ進む。一方、
両方とも読み出せなかったときには、手動復旧モードに
移行し、手動にてエラーの訂正に必要な適切な処理を行
うようにする。
In step S141, the data processing device 1 determines whether the reading of the identification number in step S132 has been performed normally. If both the identification number assigned to the variable C and the identification number assigned to the variable D can be read normally, the process proceeds to step S142. on the other hand,
If neither of them can be read, the mode is shifted to the manual recovery mode, and the appropriate processing required for error correction is manually performed.

【0244】ステップS142において、データ処理装
置1は、変数Cの値と、変数Dの値に「1」を加えた値
とを比較する。これらの値が等しければ、ステップS1
34へ進み上述した処理を行い、これらの値が等しくな
ければ、ステップS143へ進む。
In step S142, the data processing device 1 compares the value of the variable C with the value obtained by adding “1” to the value of the variable D. If these values are equal, step S1
The process proceeds to step S143, and if the values are not equal, the process proceeds to step S143.

【0245】ステップS143において、データ処理装
置1は、変数Dの値と、変数Cの値に「1」を加えた値
とを比較する。これらの値が等しければ、ステップS1
38へ進み上述した処理を行う。一方、これらの値が等
しくないときは、手動復旧モードに移行し、手動にてエ
ラーの訂正に必要な適切な処理を行うようにする。
In step S143, the data processing device 1 compares the value of the variable D with the value obtained by adding “1” to the value of the variable C. If these values are equal, step S1
The process proceeds to step S38, and the above-described processing is performed. On the other hand, when these values are not equal, the mode is shifted to the manual recovery mode, and appropriate processing necessary for error correction is manually performed.

【0246】以上のような処理により、集合管理情報の
再構築時に、エラー検出訂正処理が同時に行われる。こ
れにより、上述したように、エラー検出訂正処理のため
にメモリカード2に余分にアクセスする必要がなくな
る。すなわち、本発明を適用したシステムでは、データ
の書き込みが正常に終了し有効な集合管理情報がメモリ
カード2に書き戻されている場合には、エラー検出訂正
処理は実行されない。
With the above-described processing, the error detection and correction processing is performed at the same time when the set management information is reconstructed. Thus, as described above, it is not necessary to access the memory card 2 extra for the error detection and correction processing. That is, in the system to which the present invention is applied, the error detection and correction processing is not executed when the data writing has been completed normally and the valid collective management information has been written back to the memory card 2.

【0247】このように、本発明を適用したシステムで
は、不要なエラー検出訂正処理を行わないので、メモリ
カード2へのアクセスの高効率化を図ることができる。
特に、上記エラー検出訂正処理は、分散管理情報から集
中管理情報を構築する作業と同時に行われるため、メモ
リカード2へのアクセスが最小限にとどめられる。
As described above, in the system to which the present invention is applied, since unnecessary error detection and correction processing is not performed, the efficiency of access to the memory card 2 can be improved.
In particular, the error detection and correction processing is performed simultaneously with the operation of constructing the centralized management information from the distributed management information, so that access to the memory card 2 is minimized.

【0248】また、本発明を適用したシステムでは、メ
モリカード2の各ブロックに識別番号を付し、この識別
番号を用いて論理アドレスエラーに対処するようにして
いるので、データ更新処理を安全に行うことができる。
すなわち、データ更新処理時に何らかのエラーが発生し
て、同じ論理アドレスを持つブロックが複数存在するよ
うになってしまっても、識別番号を用いることで、デー
タ更新処理前の状態のデータを復旧することができる。
更に、本発明を適用したシステムでは、エラー検出テー
ブルを用いることで、連結アドレスエラーを検出するこ
ともでき、しかも連結先の存在しないブロックを検出す
ることもできる。
In the system to which the present invention is applied, each block of the memory card 2 is assigned an identification number, and the identification number is used to deal with a logical address error. It can be carried out.
In other words, even if an error occurs during data update processing and there are multiple blocks having the same logical address, the data before the data update processing can be restored by using the identification number. Can be.
Further, in the system to which the present invention is applied, by using the error detection table, a link address error can be detected, and a block having no link destination can be detected.

【0249】[0249]

【発明の効果】以上詳細に説明したように、本発明によ
れば、外部記憶装置の各ブロックに識別番号を格納し、
この識別番号を用いて論理アドレスエラーに対処するよ
うにしているので、データ更新処理を安全に行うことが
できる。すなわち、データ更新処理時に何らかのエラー
が発生して、同じ論理アドレスを持つブロックが複数存
在するようになってしまっても、識別番号に基づいて、
ブロックに格納されているデータの新旧を判別し、新し
い方のデータは無効なデータとし、古い方のデータを有
効なデータとすることで、データ更新処理前の状態のデ
ータを復旧することができる。
As described above in detail, according to the present invention, an identification number is stored in each block of an external storage device,
Since the logical address error is dealt with using the identification number, the data updating process can be performed safely. In other words, even if some error occurs during the data update process and there are a plurality of blocks having the same logical address, based on the identification number,
By discriminating whether the data stored in the block is new or old, setting the new data as invalid data and setting the old data as valid data, the data in the state before the data update process can be recovered. .

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

【図1】本発明が適用されるシステムの全体構成を示す
図である。
FIG. 1 is a diagram showing an overall configuration of a system to which the present invention is applied.

【図2】本発明を適用したメモリカードの構成を示すブ
ロック図である。
FIG. 2 is a block diagram showing a configuration of a memory card to which the present invention is applied.

【図3】本発明を適用したメモリカードの外観を示す斜
視図である。
FIG. 3 is a perspective view showing the appearance of a memory card to which the present invention is applied.

【図4】本発明を適用したメモリカードの記憶領域の構
造を示す図である。
FIG. 4 is a diagram showing a structure of a storage area of a memory card to which the present invention is applied.

【図5】分散管理情報の構成を示す図である。FIG. 5 is a diagram illustrating a configuration of distributed management information.

【図6】追加管理情報の構成を示す図である。FIG. 6 is a diagram showing a configuration of additional management information.

【図7】各ブロックの分散管理情報から集合管理情報を
構築する様子を示す図である。
FIG. 7 is a diagram showing a state in which set management information is constructed from distributed management information of each block.

【図8】集合管理情報の構成を示す図である。FIG. 8 is a diagram showing a configuration of collective management information.

【図9】変換テーブルを示す図である。FIG. 9 is a diagram showing a conversion table.

【図10】連結テーブルを示す図である。FIG. 10 is a diagram showing a connection table.

【図11】メモリカード起動時の手順を示すフローチャ
ートである。
FIG. 11 is a flowchart showing a procedure when starting a memory card.

【図12】データ更新処理時の手順を示すフローチャー
トである。
FIG. 12 is a flowchart illustrating a procedure during a data update process.

【図13】終了処理の手順を示すフローチャートであ
る。
FIG. 13 is a flowchart illustrating a procedure of a termination process.

【図14】サイズが分かっているファイルをメモリカー
ドに書き込むときの手順を示すフローチャートである。
FIG. 14 is a flowchart showing a procedure for writing a file of a known size to a memory card.

【図15】サイズが分かっていないファイルをメモリカ
ードに書き込むときの手順を示すフローチャートであ
る。
FIG. 15 is a flowchart showing a procedure for writing a file whose size is not known to a memory card.

【図16】ファイル更新の手順について、具体的な例を
挙げて示す概念図である。
FIG. 16 is a conceptual diagram showing a specific example of a file update procedure.

【図17】ファイル更新の手順を示すフローチャートで
ある。
FIG. 17 is a flowchart illustrating a file update procedure.

【図18】エラー検出テーブルを示す図である。FIG. 18 is a diagram illustrating an error detection table.

【図19】ブロック間の連結状態の具体的な例を示す図
である。
FIG. 19 is a diagram illustrating a specific example of a connection state between blocks.

【図20】連結アドレスエラー検出の例として、ブロッ
ク間の連結状態が図19に示した状態のときの処理の流
れを示す図である。
20 is a diagram showing a flow of processing when the connection state between blocks is the state shown in FIG. 19 as an example of detection of a connection address error;

【図21】集合管理情報の構築とエラー検出訂正処理の
手順を示すフローチャートである。
FIG. 21 is a flowchart illustrating a procedure of construction of collective management information and error detection and correction processing.

【図22】集合管理情報の構築とエラー検出訂正処理の
手順を示すフローチャートである。
FIG. 22 is a flowchart illustrating a procedure of construction of the set management information and error detection and correction processing.

【図23】集合管理情報の構築とエラー検出訂正処理の
手順を示すフローチャートである。
FIG. 23 is a flowchart showing a procedure of construction of the set management information and error detection and correction processing.

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

1 データ処理装置、 2 メモリカード、 3 演算
処理装置、 4 内部メモリ、 5 補助記憶装置、
6 シリアルインターフェース回路、 7 バス、 1
1 コントローラ、 12 フラッシュメモリ、 13
シリアル/パラレル・パラレル/シリアル・インター
フェース・シーケンサ、 14 フラッシュメモリ・イ
ンターフェース・シーケンサ、 15 ページバッフ
ァ、 16エラー訂正回路、 17 コマンドジェネレ
ータ、 18 コンフィグレーションROM、 19
発振器、 20 誤消去防止スイッチ
1 data processing device, 2 memory card, 3 arithmetic processing device, 4 internal memory, 5 auxiliary storage device,
6 serial interface circuit, 7 bus, 1
1 controller, 12 flash memory, 13
Serial / Parallel / Parallel / Serial Interface Sequencer, 14 Flash Memory Interface Sequencer, 15 Page Buffer, 16 Error Correction Circuit, 17 Command Generator, 18 Configuration ROM, 19
Oscillator, 20 Erroneous erase prevention switch

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.7 識別記号 FI G06F 12/00 531 G06F 12/00 531Z 542 542J (56)参考文献 特開 平8−272698(JP,A) 特開 平3−246645(JP,A) 特開 平7−248978(JP,A) 特開 平4−3218(JP,A) 特開 昭63−75951(JP,A) 特開 平8−221333(JP,A) 特表 平9−506460(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 12/16 G06F 3/06 - 3/08 G06F 12/00 ──────────────────────────────────────────────────続 き Continued on the front page (51) Int.Cl. 7 Identification code FI G06F 12/00 531 G06F 12/00 531Z 542 542J JP-A-246645 (JP, A) JP-A-7-248978 (JP, A) JP-A-4-3218 (JP, A) JP-A-63-75951 (JP, A) JP-A-8-221333 (JP, A) Special table Hei 9-506460 (JP, A) (58) Field surveyed (Int. Cl. 7 , DB name) G06F 12/16 G06F 3/06-3/08 G06F 12/00

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 データ処理装置に着脱可能に接続され、
上記データ処理装置からのデータを記憶する外部記憶装
置において、 上記データ処理装置とシリアルデータをやり取りするた
めのシリアルインターフェースと、 上記データを格納する不揮発性メモリとを備え、 上記不揮発性メモリは、一括消去可能な複数のブロック
に分割され、上記ブロックには、論理アドレスと、上記
ブロックに格納された上記データの新旧を示す識別番号
が格納され、 同じ論理アドレスを持つ複数のブロックが
存在する場合には、上記識別番号に基づいて、それらの
ブロックに格納されているデータの新旧が判別され、新
しい方のデータは無効なデータとされ、古い方のデータ
が有効なデータとされることを特徴とする外部記憶装
置。
1. A data processing apparatus, comprising:
External storage device for storing data from the data processing device
In location was to exchange the data processing device and the serial data
And a non-volatile memory for storing the data, wherein the non- volatile memory includes a plurality of blocks that can be erased in a batch.
The above block is divided into a logical address and the above
Identification number indicating the old or new of the above data stored in the block
Is stored, and if there are a plurality of blocks having the same logical address, the old and new data stored in those blocks is determined based on the identification number, and the new data is regarded as invalid data. And the older data is regarded as valid data.
【請求項2】 シリアルデータをやり取りするためのシ
リアルインターフェースと、一括消去可能な複数のブロ
ックに分割され、上記ブロックにデータを格納する不揮
発性メモリとを備える外部記憶装置が着脱されるデータ
処理装置において、 上記外部記憶装置にデータを格納する際に、上記不揮発
性メモリのブロックに、論理アドレスと、上記ブロック
に格納された上記データの新旧を示す識別番号を格納
し、 上記外部記憶装置からデータを読み出す際に、同じ
論理アドレスを持つ複数のブロックが存在する場合に
は、上記識別番号に基づいて、それらのブロックに格納
されているデータの新旧を判別し、新しい方のデータは
無効なデータとし、古い方のデータを有効なデータとす
ることを特徴とするデータ処理装置。
2. A system for exchanging serial data.
Real interface and multiple blocks that can be deleted all at once
Blocks that store data in the above blocks.
Data to be attached to and detached from an external storage device having a volatile memory
In the processing device, when storing data in the external storage device,
Logical addresses and the above blocks
Stores the identification number indicating the old or new of the above data stored in
And, when data is read from the external storage device, when a plurality of blocks having the same logical address exists, based on the identification number, to determine the old and new data stored in these blocks, A data processing device wherein the newer data is invalid data and the older data is valid data.
【請求項3】 一括消去可能な複数のブロックに分割さ
れた不揮発性メモリを有する外部記憶装置にデータを格
納する際に、上記不揮発性メモリのブロックに、論理ア
ドレスと、上記ブロックに格納された上記データの新旧
を示す識別番号を格納し、上記外部記憶装置からデータ
を読み出す際に、同じ論理アドレスを持つ複数のブロッ
クが存在する場合には、上記識別番号に基づいて、それ
らのブロックに格納されているデータの新旧を判別し、
新しい方のデータは無効なデータとし、古い方のデータ
を有効なデータとすることを特徴とするデータ処理方
法。
3. Data is stored in an external storage device having a nonvolatile memory divided into a plurality of blocks that can be collectively erased.
At the time of storage , the logical
Dress and the old and new data stored in the block
Storing an identification number indicating, when data is read out from the external storage device, when a plurality of blocks having the same logical address exists, the data based on the identification number, is stored in the blocks Of the old and new,
A data processing method, wherein new data is invalid data and old data is valid data.
JP9267178A 1997-09-30 1997-09-30 External storage device, data processing device, and data processing method Expired - Fee Related JP3070539B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP9267178A JP3070539B2 (en) 1997-09-30 1997-09-30 External storage device, data processing device, and data processing method
JP34682699A JP3640154B2 (en) 1997-09-30 1999-12-06 Nonvolatile memory, nonvolatile memory management method, storage device having nonvolatile memory, data management device for managing nonvolatile memory, and data processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9267178A JP3070539B2 (en) 1997-09-30 1997-09-30 External storage device, data processing device, and data processing method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP34682699A Division JP3640154B2 (en) 1997-09-30 1999-12-06 Nonvolatile memory, nonvolatile memory management method, storage device having nonvolatile memory, data management device for managing nonvolatile memory, and data processing system

Publications (2)

Publication Number Publication Date
JPH11110300A JPH11110300A (en) 1999-04-23
JP3070539B2 true JP3070539B2 (en) 2000-07-31

Family

ID=17441199

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9267178A Expired - Fee Related JP3070539B2 (en) 1997-09-30 1997-09-30 External storage device, data processing device, and data processing method

Country Status (1)

Country Link
JP (1) JP3070539B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7657702B2 (en) 2001-01-19 2010-02-02 Sandisk Corporation Partial block data programming and reading operations in a non-volatile memory

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001051883A (en) * 1999-08-12 2001-02-23 Nec Corp Method for self-restoration by nonvolatile memory and novolatile memory device
KR100449708B1 (en) * 2001-11-16 2004-09-22 삼성전자주식회사 Flash memory management method
US7234036B1 (en) * 2002-10-28 2007-06-19 Sandisk Corporation Method and apparatus for resolving physical blocks associated with a common logical block
JP2005190288A (en) * 2003-12-26 2005-07-14 Tdk Corp Memory controller, flash memory system therewith, and method for controlling flash memory
JP4558393B2 (en) * 2004-07-01 2010-10-06 三菱電機株式会社 Information processing device
JP4580724B2 (en) * 2004-09-29 2010-11-17 株式会社タイテック Nonvolatile memory control method
JP4251133B2 (en) 2004-11-29 2009-04-08 ソニー株式会社 Image compression apparatus and method
JP5707695B2 (en) * 2009-12-08 2015-04-30 沖電気工業株式会社 Flash disk device
JP2012146340A (en) * 2012-05-07 2012-08-02 Kyocera Corp Electronic device and storage method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03246645A (en) * 1990-02-23 1991-11-05 Nec Corp Data management system
JPH07248978A (en) * 1994-03-11 1995-09-26 Fuji Film Micro Device Kk Nonvolatile memory
JP3364356B2 (en) * 1995-03-30 2003-01-08 富士通株式会社 Memory rewriting device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7657702B2 (en) 2001-01-19 2010-02-02 Sandisk Corporation Partial block data programming and reading operations in a non-volatile memory
US7818490B2 (en) 2001-01-19 2010-10-19 Sandisk Corporation Partial block data programming and reading operations in a non-volatile memory
US7970987B2 (en) 2001-01-19 2011-06-28 Sandisk Corporation Partial block data programming and reading operations in a non-volatile memory
US8316177B2 (en) 2001-01-19 2012-11-20 Sandisk Corporation Partial block data programming and reading operations in a non-volatile memory

Also Published As

Publication number Publication date
JPH11110300A (en) 1999-04-23

Similar Documents

Publication Publication Date Title
JP3912355B2 (en) Data management device, data management method, nonvolatile memory, storage device having nonvolatile memory, and data processing system
JP2914360B2 (en) External storage device and data processing method
JP3072722B2 (en) Data management device and data management method using flash memory and storage medium using flash memory
US6687784B2 (en) Controller for controlling nonvolatile memory unit
JP3233079B2 (en) Data processing system and data processing method
KR100370893B1 (en) Flash memory unit and control method of flash memory
KR100527610B1 (en) Storage devices, data processing systems, and how to record and read data
JP3268130B2 (en) Data processing device using flash EEPROM
JP3070539B2 (en) External storage device, data processing device, and data processing method
JP2008033801A (en) Memory data management device
JPH10124384A (en) Method for controlling non-volatile semiconductor memory
JP2002251310A (en) Method for preparing file system for flash memory
JP3640154B2 (en) Nonvolatile memory, nonvolatile memory management method, storage device having nonvolatile memory, data management device for managing nonvolatile memory, and data processing system
JPS62226351A (en) Ic card
JP2910745B2 (en) Storage device and data processing method
JP2004078902A (en) Storage device, memory management method, and program thereof
JP4183237B2 (en) Storage device
JP2002108722A (en) Storage device
JPH11110263A (en) Storage and data processing device and method
JP3624647B2 (en) Storage device, data management device, data management system, data management method, file management device, recording medium, and file management system
JP2002278934A (en) Device and method for managing security

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: 20000425

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

Free format text: PAYMENT UNTIL: 20090526

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100526

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20100526

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20110526

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20110526

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20120526

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20120526

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20130526

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees