JP2001084180A - File managing device - Google Patents

File managing device

Info

Publication number
JP2001084180A
JP2001084180A JP25601999A JP25601999A JP2001084180A JP 2001084180 A JP2001084180 A JP 2001084180A JP 25601999 A JP25601999 A JP 25601999A JP 25601999 A JP25601999 A JP 25601999A JP 2001084180 A JP2001084180 A JP 2001084180A
Authority
JP
Japan
Prior art keywords
area
data
identification code
file
flash memory
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.)
Abandoned
Application number
JP25601999A
Other languages
Japanese (ja)
Inventor
Hidetada Nagaoka
秀忠 長岡
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP25601999A priority Critical patent/JP2001084180A/en
Publication of JP2001084180A publication Critical patent/JP2001084180A/en
Abandoned legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a file managing device normally resuming a file operation without destroying any file or data even when an abnormal state such as power source interruption is generated during the file operation. SOLUTION: In this file managing device, an identification code indicating the processing contents of wiring processing or the like are recorded in an operation history recording region 10, and when the writing processing or the like is normally ended, the identification code is deleted. Afterwards, when the recording of the identification code is left in the operation history recording region 10, the identification code is analyzed, and the data stored in the data region or the like are restored.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、ブロック単位の
データの消去が可能なフラッシュメモリをアクセスする
ファイル管理装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a file management apparatus for accessing a flash memory capable of erasing data in block units.

【0002】[0002]

【従来の技術】近年、デジタルスチルカメラやPDAな
どの携帯型情報機器の記憶媒体にはフラッシュメモリが
多く使用されている。フラッシュメモリは、電気的に読
み書きが可能な不揮発性のメモリであり、SRAMやD
RAMと異なり、電源遮断後もデータを保持することが
できる特徴を有している。
2. Description of the Related Art In recent years, flash memories are widely used as storage media for portable information devices such as digital still cameras and PDAs. A flash memory is an electrically readable and writable non-volatile memory, such as an SRAM or a DRAM.
Unlike a RAM, it has a feature that data can be retained even after power is turned off.

【0003】しかし、フラッシュメモリはオーバーライ
トが不可能であり、物理アドレス空間における任意のア
ドレスのデータを書き換えるには、そのデータを一旦消
去する必要がある。フラッシュメモリは、通常、複数の
ブロックから構成され、データの消去はブロック単位で
のみ行うことができる。ブロックのサイズはチップによ
って異なるが、数キロバイト〜数百キロバイトである。
However, a flash memory cannot be overwritten, and in order to rewrite data at an arbitrary address in a physical address space, it is necessary to temporarily erase the data. A flash memory is usually composed of a plurality of blocks, and data can be erased only in block units. The size of the block varies from chip to chip, but is from a few kilobytes to a few hundred kilobytes.

【0004】図19は例えば特開平11−53248号
公報に示された従来のファイル管理装置におけるフラッ
シュメモリ上の論理フォーマットを示す説明図であり、
図において、100は予約領域、101はFAT(Fi
le AllocationTable)、102はデ
ィレクトリ領域、103はデータ領域、104はデータ
領域103における任意の領域である。
FIG. 19 is an explanatory diagram showing a logical format on a flash memory in a conventional file management apparatus disclosed in Japanese Patent Application Laid-Open No. 11-53248, for example.
In the figure, 100 is a reserved area, 101 is a FAT (Fi
le AllocationTable), 102 is a directory area, 103 is a data area, and 104 is an arbitrary area in the data area 103.

【0005】フラッシュメモリの記憶領域は、図19に
示すように、予約領域100、FAT101、ディレク
トリ領域102、データ領域103に区分けされてい
て、データ領域は複数のブロックから構成される。FA
Tとディレクトリでファイルを管理する技術は、従来か
らよく知られている公知の技術であるが、以下に簡単な
説明を記述する。
As shown in FIG. 19, the storage area of the flash memory is divided into a reserved area 100, a FAT 101, a directory area 102, and a data area 103, and the data area is composed of a plurality of blocks. FA
The technique of managing files with T and a directory is a well-known technique that has been well known in the art, and a brief description will be given below.

【0006】データ領域103は、ファイルデータを記
憶する領域であり、セクタと呼ばれる固定サイズの領域
で論理的に分けられている。データ領域103のアクセ
スは、セクタ単位で行うが(大容量の記憶領域を扱うも
のは、連続した複数個のセクタからなるクラスタと呼ば
れる単位でアクセスを行う)、セクタサイズは通常、2
56バイトあるいは512バイトといった値である。
The data area 103 is an area for storing file data, and is logically divided into fixed-size areas called sectors. The data area 103 is accessed in units of sectors (those handling large-capacity storage areas are accessed in units called clusters composed of a plurality of consecutive sectors).
It is a value such as 56 bytes or 512 bytes.

【0007】ファイルは、そのデータサイズにより複数
個のセクタに格納される。ファイルサイズがセクタサイ
ズで割り切れない場合でも、最終セクタはそのファイル
が占有し、セクタの余った領域に他のファイルのデータ
が格納されることはない。FAT101は、それぞれの
セクタに1対1で対応したエントリを持っており、セク
タにデータが書き込まれているか、空きセクタであるか
は、FAT101のエントリから知ることができる。
[0007] A file is stored in a plurality of sectors according to its data size. Even if the file size is not divisible by the sector size, the last sector is occupied by the file, and the data of another file is not stored in the surplus area of the sector. The FAT 101 has an entry corresponding to each sector on a one-to-one basis, and it can be known from the FAT 101 entry whether data is written to the sector or whether the sector is a free sector.

【0008】ディレクトリ領域102には、ファイル
名、ファイルサイズ、ファイル属性情報、ファイルの開
始セクタ番号などが記録されている。また、FAT10
1はファイルのデータがどのセクタにどのような順番で
格納されているかを示すマップ情報を含んでいる。
In the directory area 102, a file name, a file size, file attribute information, a file start sector number, and the like are recorded. Also, FAT10
1 includes map information indicating in which sector the file data is stored in which order.

【0009】ファイルが1つのセクタに格納しきれない
場合、FAT101のエントリにはデータを引き続き格
納するセクタの番号が記録される。ファイルデータを読
み出すときは、ディレクトリに記録されている開始セク
タ番号から順にFATのエントリを読み出すことによ
り、複数のセクタにばらばらに記録されているファイル
データを1つのデータとして読み出すことができる。
If the file cannot be stored in one sector, the FAT 101 entry records the number of the sector in which data is to be stored continuously. When reading the file data, the FAT entries are sequentially read from the starting sector number recorded in the directory, so that the file data separately recorded in a plurality of sectors can be read as one data.

【0010】次に、従来のファイル管理装置が領域10
4に記録されているファイルを更新する場合の動作を説
明する。図20は従来のファイル管理装置の処理内容を
示すフローチャートである。まず、ファイル管理装置
は、データ領域103における空きブロックを検索する
(ステップST201)。
Next, the conventional file management device is
The operation when updating the file recorded in No. 4 will be described. FIG. 20 is a flowchart showing the processing contents of a conventional file management device. First, the file management device searches for a free block in the data area 103 (step ST201).

【0011】次に、ファイル管理装置は、領域104が
存在するブロック(5)に記録されているファイルのう
ち、領域104以外の領域に記録されているファイルを
空きブロックにコピーするとともに(ステップST20
2)、その領域104に記録されていたファイルの更新
後のファイルを当該空きブロックにコピーする(ステッ
プST203)。
Next, the file management apparatus copies files recorded in an area other than the area 104 among the files recorded in the block (5) where the area 104 exists, to an empty block (step ST20).
2) Copy the updated file recorded in the area 104 to the empty block (step ST203).

【0012】そして、ファイル管理装置は、ファイルの
コピーを完了すると、ブロック(5)を消去し(ステッ
プST204)、FAT101及びディレクトリ領域1
02のデータを更新する(ステップST205)。
When the file management device completes copying the file, it deletes block (5) (step ST204), and deletes the FAT 101 and the directory area 1.
02 is updated (step ST205).

【0013】[0013]

【発明が解決しようとする課題】従来のファイル管理装
置は以上のように構成されているので、フラッシュメモ
リを携帯型情報機器などに搭載すると、次に示すような
不具合が発生する。即ち、携帯型情報機器は、主電源に
電池(バッテリ)を使用するため、電池の消耗によって
電源が突然遮断される場合がある(あるいは、ユーザの
誤操作によって電源が遮断される場合も考えられる)。
例えば、電源の遮断が図20のステップST204の実
行後に発生すると、ブロック(5)が消去されているに
も拘わらず、FAT101及びディレクトリ領域102
のデータが更新されていないため、電源を再起動して、
更新後の該当ファイルの読み込みを試みると、消去状態
のファイル(ブロック(5)のファイル)が読み込まれ
てしまう課題があった。
Since the conventional file management apparatus is configured as described above, when the flash memory is mounted on a portable information device or the like, the following problems occur. That is, since a portable information device uses a battery (battery) as a main power supply, the power supply may be suddenly shut down due to the exhaustion of the battery (or the power supply may be shut down due to a user's erroneous operation). .
For example, when the power supply shuts down after the execution of step ST204 in FIG. 20, the FAT 101 and the directory area 102 are deleted even though the block (5) is erased.
Because the data of has not been updated, restart the power supply,
There is a problem in that if an attempt is made to read the corresponding file after updating, the file in the erased state (the file of block (5)) is read.

【0014】また、更新後のファイルを記録したブロッ
クも、更新後のファイルを記録したにも拘わらず、FA
T101のエントリからは空きセクタ領域であると認識
されるので、ファイルを正しく書き込めない課題があっ
た。さらに、FAT101を更新する際、FAT101
を消去した時に電源が遮断されると、FAT101のデ
ータが完全に失われ、全てのファイルを読み込めなくな
る課題があった。
[0014] The block in which the updated file is recorded also has an FA regardless of the recorded file.
Since the entry in T101 is recognized as an empty sector area, there is a problem that a file cannot be written correctly. Further, when updating the FAT101, the FAT101
If the power is cut off when the file is erased, the data in the FAT 101 is completely lost, and all the files cannot be read.

【0015】この発明は上記のような課題を解決するた
めになされたもので、ファイル操作中に電源遮断などの
異常状態が発生しても、ファイルやデータが破壊される
ことなく、ファイル操作を正常に再開することができる
ファイル管理装置を得ることを目的とする。
[0015] The present invention has been made to solve the above-described problem, and even if an abnormal state such as a power shutdown occurs during a file operation, the file operation can be performed without destroying the file or data. An object of the present invention is to provide a file management device that can be restarted normally.

【0016】[0016]

【課題を解決するための手段】この発明に係るファイル
管理装置は、書込手段が書込処理又は更新処理を実行す
る際、その処理内容を示す識別コードをフラッシュメモ
リの動作履歴記録領域に記録し、その書込処理又は更新
処理が正常終了すると、その識別コードを消去する動作
履歴記録手段を設け、そのフラッシュメモリの動作履歴
記録領域に識別コードの記録が残されている場合、その
識別コードを解析して、そのデータ領域及び管理領域に
格納されているデータを復旧するようにしたものであ
る。
A file management device according to the present invention records an identification code indicating the processing content in an operation history recording area of a flash memory when a writing means executes a writing process or an updating process. When the writing process or the updating process is completed normally, an operation history recording means for erasing the identification code is provided, and when the identification code is recorded in the operation history recording area of the flash memory, the identification code is deleted. Is analyzed to recover the data stored in the data area and the management area.

【0017】この発明に係るファイル管理装置は、書込
手段が書込処理又は更新処理を実行する際、その処理内
容を示す識別コードをフラッシュメモリの動作履歴記録
領域に記録し、その書込処理又は更新処理が正常終了す
ると、正常終了を示す識別コードを動作履歴記録領域に
記録する動作履歴記録手段を設け、そのフラッシュメモ
リの動作履歴記録領域に正常終了を示す識別コードが記
録されていない場合、その処理内容を示す識別コードを
解析して、そのデータ領域及び管理領域に格納されてい
るデータを復旧するようにしたものである。
In the file management device according to the present invention, when the writing means executes a writing process or an updating process, an identification code indicating the processing content is recorded in an operation history recording area of the flash memory, and the writing process is performed. Or, when the update processing is normally completed, an operation history recording unit that records an identification code indicating a normal end in the operation history recording area is provided, and an identification code indicating a normal end is not recorded in the operation history recording area of the flash memory. An analysis of the identification code indicating the contents of the processing is performed to recover the data stored in the data area and the management area.

【0018】この発明に係るファイル管理装置は、識別
コードの解析結果に応じた復旧処理を実行して、データ
領域及び管理領域に格納されているデータを書込処理又
は更新処理が実行される前の内容に戻すようにしたもの
である。
The file management apparatus according to the present invention executes a recovery process according to the analysis result of the identification code, and writes or updates the data stored in the data area and the management area before the execution of the update processing. The content is returned.

【0019】この発明に係るファイル管理装置は、削除
手段が削除処理又は更新処理を実行する際、その処理内
容を示す識別コードをフラッシュメモリの動作履歴記録
領域に記録し、その削除処理又は更新処理が正常終了す
ると、その識別コードを消去する動作履歴記録手段を設
け、そのフラッシュメモリの動作履歴記録領域に識別コ
ードの記録が残されている場合、その識別コードを解析
して、そのデータ領域及び管理領域に格納されているデ
ータを復旧するようにしたものである。
In the file management apparatus according to the present invention, when the deletion means executes the deletion processing or the update processing, the identification code indicating the processing content is recorded in the operation history recording area of the flash memory, and the deletion processing or the update processing is performed. Is normally completed, an operation history recording means for erasing the identification code is provided. If the identification code is recorded in the operation history recording area of the flash memory, the identification code is analyzed and the data area and the data area are analyzed. The data stored in the management area is restored.

【0020】この発明に係るファイル管理装置は、削除
手段が削除処理又は更新処理を実行する際、その処理内
容を示す識別コードをフラッシュメモリの動作履歴記録
領域に記録し、その削除処理又は更新処理が正常終了す
ると、正常終了を示す識別コードを動作履歴記録領域に
記録する動作履歴記録手段を設け、そのフラッシュメモ
リの動作履歴記録領域に正常終了を示す識別コードが記
録されていない場合、その処理内容を示す識別コードを
解析して、そのデータ領域及び管理領域に格納されてい
るデータを復旧するようにしたものである。
In the file management device according to the present invention, when the deletion means executes the deletion processing or the update processing, the identification code indicating the processing content is recorded in the operation history recording area of the flash memory, and the deletion processing or the update processing is performed. Is normally provided, an operation history recording means for recording an identification code indicating the normal end in the operation history recording area is provided. If the identification code indicating the normal end is not recorded in the operation history recording area of the flash memory, the processing is performed. The identification code indicating the content is analyzed to restore the data stored in the data area and the management area.

【0021】この発明に係るファイル管理装置は、識別
コードの解析結果に応じた復旧処理を実行して、データ
領域及び管理領域に格納されているデータを削除処理又
は更新処理が実行される前の内容に戻すようにしたもの
である。
The file management apparatus according to the present invention executes recovery processing according to the analysis result of the identification code, and deletes data stored in the data area and the management area before the deletion processing or the update processing is performed. It is intended to return to the contents.

【0022】この発明に係るファイル管理装置は、同一
の識別コードが2回続けて記録されている場合に限り、
その識別コードを有効な識別コードであるとして取り扱
うようにしたものである。
According to the file management apparatus of the present invention, only when the same identification code is recorded twice consecutively,
The identification code is handled as a valid identification code.

【0023】この発明に係るファイル管理装置は、検出
手段がハードウエアエラーを検出すると、書込手段の処
理を中止させて復旧手段の処理を開始させるようにした
ものである。
In the file management apparatus according to the present invention, when the detecting means detects a hardware error, the processing of the writing means is stopped and the processing of the restoring means is started.

【0024】この発明に係るファイル管理装置は、検出
手段がハードウエアエラーを検出すると、削除手段の処
理を中止させて復旧手段の処理を開始させるようにした
ものである。
In the file management apparatus according to the present invention, when the detecting means detects a hardware error, the processing of the deleting means is stopped and the processing of the restoring means is started.

【0025】この発明に係るファイル管理装置は、検出
手段がフラッシュメモリからハードウエアエラーのステ
ータス信号を一定時間以上受信できない場合、その検出
手段がハードウエアエラーを検出した場合と同様の処理
を実行するようにしたものである。
The file management device according to the present invention executes the same processing as when the detecting means detects a hardware error when the detecting means cannot receive a hardware error status signal from the flash memory for a certain period of time or more. It is like that.

【0026】この発明に係るファイル管理装置は、書込
手段が一方のバンクに対してファイルデータを書き込ん
でいる時、他方のバンクからデータを読み込む読込手段
を設けるようにしたものである。
In the file management apparatus according to the present invention, when the writing means is writing file data to one bank, a reading means for reading data from the other bank is provided.

【0027】この発明に係るファイル管理装置は、削除
手段が一方のバンクからセクタを削除している時、他方
のバンクからデータを読み込む読込手段を設けるように
したものである。
The file management apparatus according to the present invention is provided with reading means for reading data from the other bank when the deleting means is deleting a sector from one bank.

【0028】[0028]

【発明の実施の形態】以下、この発明の実施の一形態を
説明する。 実施の形態1.図1はこの発明の実施の形態1によるフ
ァイル管理装置を示す構成図であり、図において、1は
キー入力部3からの入力信号に応じて、I/F部4を経
由して外部から入力されるデータをフラッシュメモリ5
にファイルとして保存したり、フラッシュメモリ5に保
存されているファイルを読み出してI/F部4を介して
データを外部に出力したり、フラッシュメモリ5に保存
されているファイルデータをVRAM6に転送して表示
部7に表示したり、あるいは、フラッシュメモリ5に保
存されているファイルを削除したりするMPUである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below. Embodiment 1 FIG. FIG. 1 is a block diagram showing a file management device according to a first embodiment of the present invention. In FIG. 1, reference numeral 1 denotes an external input via an I / F unit 4 in response to an input signal from a key input unit 3. Flash memory 5
The I / F unit 4 reads the file stored in the flash memory 5 and outputs the data to the outside, or transfers the file data stored in the flash memory 5 to the VRAM 6. This is an MPU for displaying on the display unit 7 or deleting a file stored in the flash memory 5.

【0029】2はMPU1が実行するプログラム等を格
納するROM、3は電源をオンオフするスイッチやユー
ザから各種操作を受け付ける各種キーが設けられている
キー入力部、4は外部からデータを入力するとともに、
データを外部に出力するI/F部、5はブロック単位の
データの消去が可能なフラッシュメモリ、6はデータ等
を表示する際に格納するVRAM、7はデータ等を表示
する表示部、8はMPU1が各種処理を実行する際、ワ
ークメモリとして使用されるRAMである。なお、MP
U1は書込手段、削除手段、動作履歴記録手段及び復旧
手段を構成する。
Reference numeral 2 denotes a ROM for storing a program executed by the MPU 1 and the like. Reference numeral 3 denotes a key input unit provided with a switch for turning on and off a power supply and various keys for receiving various operations from a user. ,
An I / F unit for outputting data to the outside, 5 a flash memory capable of erasing data in block units, 6 a VRAM for storing data and the like, 7 a display unit for displaying data and the like, and 8 a display unit for displaying data and the like A RAM used as a work memory when the MPU 1 executes various processes. Note that MP
U1 constitutes a writing unit, a deleting unit, an operation history recording unit, and a recovery unit.

【0030】図2はファイル管理装置におけるフラッシ
ュメモリ5上の論理フォーマットを示す説明図であり、
図において、10は動作履歴記録領域、11はFAT、
12はFATCOPY、13はディレクトリ領域、14
はディレクトリ待避領域、15はデータ領域、16はデ
ータ待避領域である。なお、FAT11及びディレクト
リ領域13から管理領域が構成されている。
FIG. 2 is an explanatory diagram showing a logical format on the flash memory 5 in the file management device.
In the figure, 10 is an operation history recording area, 11 is a FAT,
12 is FATCOPY, 13 is a directory area, 14
Is a directory save area, 15 is a data area, and 16 is a data save area. A management area is composed of the FAT 11 and the directory area 13.

【0031】フラッシュメモリ5の記憶領域は、図2に
示すように、動作履歴記録領域10、FAT11、FA
TCOPY12、ディレクトリ領域13、ディレクトリ
待避領域14、データ領域15、データ待避領域16に
区分けされていて、データ領域は複数のブロックから構
成される。この実施の形態1におけるファイル管理装置
が使用するフラッシュメモリ5は32個のブロックを有
しているものとする。
As shown in FIG. 2, the storage area of the flash memory 5 includes an operation history recording area 10, a FAT 11, a FA
It is divided into a TCOPY 12, a directory area 13, a directory save area 14, a data area 15, and a data save area 16, and the data area is composed of a plurality of blocks. It is assumed that the flash memory 5 used by the file management device in the first embodiment has 32 blocks.

【0032】先に述べたように、ブロックとはフラッシ
ュメモリの消去単位である。動作履歴記録領域10には
ブロック(0)が、FAT11にはブロック(1)が、
FATCOPY12にはブロック(2)が、ディレクト
リ領域13にはブロック(3)が、ディレクトリ待避領
域14にはブロック(4)が、データ領域15にはブロ
ック(5)〜(30)が、データ待避領域16にはブロ
ック(31)が割り当てられている。
As described above, a block is an erase unit of a flash memory. Block (0) is stored in the operation history recording area 10, block (1) is stored in the FAT 11,
Block (2) in FATCOPY 12, block (3) in directory area 13, block (4) in directory save area 14, block (5) to (30) in data area 15, data save area. The block (31) is allocated to 16.

【0033】データ領域15には1ブロック当たり12
8個のセクタが配置され、各セクタは0から3327ま
での番号で論理的にマッピングされている。FAT11
はセクタ1つに対して2バイトのエントリを有し、初期
状態(ファイルが何も存在しない状態)のエントリデー
タは‘0000’とする。1つのセクタに収まるファイ
ルを記録した場合には、対応するセクタのFATエント
リには、例えば‘FFFF’を記録する。ファイルが複
数のセクタに記録される場合には、次に繋がるセクタの
番号をFATエントリに記録する。ファイルの最終セク
タには‘FFFF’を記録する。空きセクタの検索は、
FAT11をスキャンし、エントリデータが‘000
0’のものを検索することにより行うことができる。
The data area 15 has 12 addresses per block.
Eight sectors are arranged, and each sector is logically mapped by a number from 0 to 3327. FAT11
Has a 2-byte entry for one sector, and the entry data in the initial state (the state where no file exists) is '0000'. When a file that fits in one sector is recorded, for example, 'FFFF' is recorded in the FAT entry of the corresponding sector. When a file is recorded in a plurality of sectors, the number of the next connected sector is recorded in the FAT entry. 'FFFF' is recorded in the last sector of the file. Search for empty sectors
Scans FAT11 and finds that entry data is' 000
The search can be performed by searching for 0's.

【0034】図3はディレクトリ領域13のフォーマッ
トを示す説明図であり、図において、20はディレクト
リチェックバイトであり、ファイル登録済みのディレク
トリであるか、未使用ディレクトリであるかを識別する
ためのデータが記録される。初期状態において、ディレ
クトリチェックバイト20は‘00’であるとする。デ
ィレクトリチェックバイト20をスキャンすれば未使用
ディレクトリを検索することができる。21はファイル
名、22はファイル属性、23は日付、24は該当ファ
イルのデータが記録されている先頭のセクタの番号を示
す開始セクタ番号、25はファイルサイズである。
FIG. 3 is an explanatory diagram showing the format of the directory area 13. In FIG. 3, reference numeral 20 denotes a directory check byte, which is data for identifying whether the directory is a file-registered directory or an unused directory. Is recorded. It is assumed that the directory check byte 20 is “00” in the initial state. By scanning the directory check byte 20, an unused directory can be searched. 21 is a file name, 22 is a file attribute, 23 is a date, 24 is a start sector number indicating the number of the first sector in which data of the file is recorded, and 25 is a file size.

【0035】動作履歴記録領域10は、ファイルの書込
処理を実行するときの処理経過状況を示す唯一のデータ
(以下、動作識別コードという)や、異常発生時にファ
イル管理装置を復旧するために必要となる情報を記録す
るためのエリアである。通常時は消去状態になってい
る。具体的な記録内容や動作履歴を記録するタイミング
については後述する。
The operation history recording area 10 is the only data (hereinafter, referred to as an operation identification code) indicating the progress of processing when writing a file, and is necessary for restoring the file management device when an error occurs. This is an area for recording information. Normally, it is in the erased state. The specific recording contents and the timing of recording the operation history will be described later.

【0036】なお、ファイル管理装置が使用するフラッ
シュメモリ5は、消去時に全てのビットが‘1’とな
る。ディレクトリ待避領域14は、ディレクトリ領域1
3の内容を書き換える際に使用するテンポラリ領域であ
る。データ待避領域16は、データ領域15の内容を書
き換える際に使用するテンポラリ領域である。FATC
OPY12はFAT11と同じデータが記録される領域
である。FATCOPY12を設ける手法はファイル管
理装置の信頼性を向上するために従来からよく使われて
いる。
In the flash memory 5 used by the file management device, all bits are set to "1" at the time of erasing. The directory save area 14 is the directory area 1
3 is a temporary area used when rewriting the contents of No.3. The data save area 16 is a temporary area used when rewriting the contents of the data area 15. FATC
OPY12 is an area where the same data as FAT11 is recorded. The method of providing the FATCOPY 12 has been often used in the past to improve the reliability of the file management device.

【0037】次に動作について説明する。図4はファイ
ル管理装置によるファイルの書込処理を示すフローチャ
ートである。まず、MPU1は、キー入力部3からファ
イルの書込指令を受けると、そのファイルを保存するた
めに必要なセクタ数を計算する。そして、MPU1は、
FAT11をスキャンして、空きセクタを必要セクタ分
検索する(ステップST1)。その際、必要セクタ分の
空きセクタが無い場合、ファイルの書き込みが不可であ
ることを通知する(ステップST17)。
Next, the operation will be described. FIG. 4 is a flowchart showing a file writing process by the file management device. First, upon receiving a file write command from the key input unit 3, the MPU 1 calculates the number of sectors required to store the file. And MPU1
The FAT 11 is scanned to search for empty sectors for the required sectors (step ST1). At this time, if there is no empty sector for the required sector, it is notified that the file cannot be written (step ST17).

【0038】MPU1は、空きセクタを必要セクタ分検
索すると、動作履歴記録領域10に対して、ファイル書
き込み中であることを示す動作識別コード‘A000’
と、そのファイルを記録するセクタの番号を記録し(ス
テップST2)、そのファイルを該当セクタに記録する
(ステップST3)。
When the MPU 1 searches for a necessary sector for a free sector, the operation identification code “A000” indicating that the file is being written to the operation history recording area 10.
And the number of the sector in which the file is to be recorded (step ST2), and the file is recorded in the corresponding sector (step ST3).

【0039】そして、MPU1は、ディレクトリ領域1
3のディレクトリチェックバイト20をスキャンして、
未使用ディレクトリを検索し(ステップST4)、ディ
レクトリ領域13の管理データをディレクトリ待避領域
14にコピーする(ステップST5)。また、MPU1
は、動作履歴記録領域10に対して、ディレクトリ更新
中であることを示す動作識別コード‘A001’を追記
する(ステップST6)。
The MPU 1 has a directory area 1
Scan the directory check byte 20 of 3
An unused directory is searched (step ST4), and the management data of the directory area 13 is copied to the directory save area 14 (step ST5). Also, MPU1
Adds an operation identification code 'A001' indicating that the directory is being updated to the operation history recording area 10 (step ST6).

【0040】MPU1は、動作識別コード‘A001’
を動作履歴記録領域10に追記すると、ディレクトリ領
域13をブロック消去する(ステップST7)。そし
て、MPU1は、新規ディレクトリデータと既存ディレ
クトリデータをマージして、ディレクトリ領域13にマ
ージ後の管理データを記録する(ステップST8)。
The MPU 1 has an operation identification code 'A001'
Is added to the operation history recording area 10, the directory area 13 is block erased (step ST7). Then, the MPU 1 merges the new directory data with the existing directory data and records the merged management data in the directory area 13 (step ST8).

【0041】次に、MPU1は、動作履歴記録領域10
に対して、FAT更新中であることを示す動作識別コー
ド‘A002’を追記する(ステップST9)。MPU
1は、動作識別コード‘A002’を動作履歴記録領域
10に追記すると、FAT11をブロック消去する(ス
テップST10)。そして、MPU1は、新規FATエ
ントリの記録と、既存FATエントリの書き戻しを実行
する(ステップST11)。即ち、予め、FATCOP
Y12にコピーしていた既存FATエントリと、新規F
ATエントリをマージして、FATエントリを更新す
る。
Next, the MPU 1 operates in the operation history recording area 10.
, An operation identification code 'A002' indicating that the FAT is being updated is added (step ST9). MPU
When the operation identification code 'A002' is additionally written in the operation history recording area 10, the block 1 erases the FAT 11 (step ST10). Then, the MPU 1 performs recording of the new FAT entry and writing back of the existing FAT entry (step ST11). That is, in advance, FATCOP
The existing FAT entry copied to Y12 and the new FAT
Merge the AT entry and update the FAT entry.

【0042】次に、MPU1は、FAT11の更新を完
了すると、動作履歴記録領域10に対して、FAT更新
が完了したことを示す動作識別コード‘A003’を追
記する(ステップST12)。MPU1は、動作識別コ
ード‘A003’を動作履歴記録領域10に追記する
と、FATCOPY12をブロック消去する(ステップ
ST13)。
Next, when the updating of the FAT 11 is completed, the MPU 1 additionally writes an operation identification code 'A003' indicating that the FAT updating is completed in the operation history recording area 10 (step ST12). When the operation identification code 'A003' is added to the operation history recording area 10, the MPU 1 erases the block in the FATCOPY 12 (step ST13).

【0043】そして、MPU1は、次回のファイル書込
処理に備えるため、FAT11の管理データ(FATエ
ントリ)をFATCOPY12にコピーする(ステップ
ST14)。また、MPU1は、ディレクトリ待避領域
14をブロック消去し(ステップST15)、動作履歴
記録領域10をブロック消去する(ステップST1
6)。
Then, the MPU 1 copies the management data (FAT entry) of the FAT 11 to the FATCOPY 12 to prepare for the next file writing process (step ST14). Further, the MPU 1 erases blocks in the directory save area 14 (step ST15), and erases blocks in the operation history recording area 10 (step ST1).
6).

【0044】ここで、上記ファイル書込処理の途中で電
源が突然遮断されて異常終了した場合について考える。
ここでは、一例として、図4のステップST8の処理中
に電源が遮断されたものとして説明する。ただし、本発
明の効果を明確にするため、最初に、復旧処理を全く実
施しない場合について説明する。
Here, consider the case where the power supply is suddenly shut off during the above-described file writing process and the process ends abnormally.
Here, as an example, a description will be given assuming that the power supply is cut off during the processing of step ST8 in FIG. However, in order to clarify the effect of the present invention, first, a case where the restoration process is not performed at all will be described.

【0045】再起動して、再度、ファイルの書込処理を
試みると、次のような状況が発生する。まず、ステップ
ST1において、FAT11をスキャンして空きセクタ
を検索するが、異常終了時点ではFATエントリへの書
き込みが完了していないので、ファイル書込済みのセク
タが空きセクタと認識され、ステップST3において、
ファイルの上書き処理が実行される。
When restarting and trying to write the file again, the following situation occurs. First, in step ST1, the FAT11 is scanned for a free sector. At the time of abnormal termination, writing to the FAT entry has not been completed, so the file-written sector is recognized as a free sector. ,
The file is overwritten.

【0046】しかし、フラッシュメモリ5は、1度デー
タを書き込んだ領域に対して、消去せずにデータの再書
込を実行しても、正しくデータを記録することができな
い。したがって、シーケンス上は正常に書き込んだもの
として処理が進行するが、誤った内容のファイルがフラ
ッシュメモリ5に保存されることになる。
However, the flash memory 5 cannot correctly record data even if data is rewritten without erasing data in an area in which data has been written once. Therefore, the process proceeds as if the data was written normally in the sequence, but a file with incorrect contents is stored in the flash memory 5.

【0047】次に、動作履歴による復旧処理を実行する
場合について説明する。図5は再起動時に実行する復旧
処理を示すフローチャートである。まず、MPU1は、
再起動時に動作履歴記録領域10のデータをチェックす
る(ステップST20)。
Next, a case in which a recovery process is performed based on the operation history will be described. FIG. 5 is a flowchart showing a recovery process executed at the time of restart. First, MPU1
At the time of restart, the data in the operation history recording area 10 is checked (step ST20).

【0048】MPU1は、動作履歴記録領域10に動作
識別コードの記録が残されていない場合(動作識別コー
ドが消去されている場合)、異常終了状態が発生してい
ないものと判断し、復旧処理を終了して通常の処理に移
行する。一方、動作識別コードの記録が残されている場
合(動作識別コードが消去されていない場合)、異常終
了状態が発生したものと判断し、ステップST21以降
の処理を実行する。
When no operation identification code is recorded in the operation history recording area 10 (when the operation identification code is erased), the MPU 1 determines that an abnormal end state has not occurred, and performs a recovery process. Ends, and the process proceeds to a normal process. On the other hand, when the record of the operation identification code is left (when the operation identification code is not erased), it is determined that the abnormal end state has occurred, and the processes after step ST21 are executed.

【0049】MPU1は、異常終了状態の発生を認識す
ると、動作履歴記録領域10に最後に記録されている動
作識別コードを解析し、ファイル書込処理のうち、どの
処理を実行している時に異常終了したかを判断する(ス
テップST21)。この実施の形態1では、ステップS
T8の実行時に異常終了が発生したものと仮定している
ので、動作履歴記録領域10の最後に記録されている動
作識別コードは‘A001’のである。
When the MPU 1 recognizes the occurrence of the abnormal end state, the MPU 1 analyzes the operation identification code recorded last in the operation history recording area 10 and determines which of the file writing processes is being executed. It is determined whether the process has been completed (step ST21). In the first embodiment, step S
Since it is assumed that an abnormal end has occurred during the execution of T8, the operation identification code recorded at the end of the operation history recording area 10 is “A001”.

【0050】異常終了の発生時期により、復旧処理の内
容が若干異なるが、ステップST22以降に示す処理は
動作識別コード‘A001’が検出された場合のフロー
チャートである。最後に記録されている動作識別コード
が別なコードの場合は、ステップST29、ステップS
T30、ステップST31の処理に移行する。
Although the contents of the recovery processing are slightly different depending on the time of occurrence of the abnormal end, the processing shown from step ST22 is a flow chart in the case where the operation identification code 'A001' is detected. If the last recorded operation identification code is a different code, step ST29, step S29
T30, the process proceeds to step ST31.

【0051】MPU1は、ステップST21において、
動作識別コード‘A001’が検出された場合、ディレ
クトリ領域13をブロック消去し(ステップST2
2)、ディレクトリ待避領域14の管理データをディレ
クトリ領域13にコピーする(ステップST23)。
In step ST21, the MPU 1 determines
When the operation identification code 'A001' is detected, the directory area 13 is block erased (step ST2).
2) The management data in the directory save area 14 is copied to the directory area 13 (step ST23).

【0052】また、MPU1は、動作履歴記録領域10
に記録されているセクタ番号を参照して、そのセクタ番
号が示すセクタを含むブロックのデータをデータ待避領
域16にコピーする(ステップST24)。そして、M
PU1は、そのセクタを含むブロックをブロック消去し
(ステップST25)、そのセクタ以外の有効データを
書き戻す処理を実行する(ステップST26)。即ち、
そのブロックを構成するセクタのうち、そのセクタ番号
が示すセクタ以外のセクタに格納されていたデータのみ
を元のブロックのセクタに書き戻す処理を実行する。
The MPU 1 has an operation history recording area 10
The data of the block including the sector indicated by the sector number is copied to the data save area 16 by referring to the sector number recorded in the data save area 16 (step ST24). And M
PU1 performs block erasing of the block including the sector (step ST25), and executes a process of writing back valid data other than the sector (step ST26). That is,
A process of writing back only the data stored in the sectors other than the sector indicated by the sector number among the sectors constituting the block to the original block sector is executed.

【0053】MPU1は、上記のようにしてデータ領域
15の内容をデータの書込処理が実行される前の状態に
戻すと、データ待避領域16をブロック消去し(ステッ
プST27)、動作履歴記録領域10をブロック消去す
る(ステップST28)。上記復旧処理によりFATエ
ントリが空きセクタと示しているセクタのデータが消去
状態になり、また、中途半端に記録されたディレクトリ
の管理データも消去される。
When the MPU 1 returns the contents of the data area 15 to the state before the data write processing is executed as described above, the MPU 1 erases the data save area 16 as a block (step ST27), and the operation history recording area The block 10 is erased (step ST28). By the above recovery processing, the data of the sector whose FAT entry indicates a free sector is erased, and the management data of the directory recorded halfway is also erased.

【0054】以上のように、ファイルの書込処理中に動
作識別コードを動作履歴記録領域10に逐次記録して、
ファイルを記録するセクタの番号も動作履歴記録領域1
0に保存し、電源遮断などにより異常終了が発生する
と、電源再起動時に動作識別コードを解析して、フラッ
シュメモリ5の内容を修復するようにしているので、突
然の電源遮断などの突発的な異常終了状態に強く、デー
タの信頼性が高いフラッシュメモリ5を記憶媒体に使用
したファイル管理装置を得ることができるという効果を
奏する。
As described above, the operation identification code is sequentially recorded in the operation history recording area 10 during the file writing process.
The number of the sector for recording the file is also the operation history recording area 1
0, and if an abnormal end occurs due to power shutdown, the operation identification code is analyzed when the power is restarted, and the contents of the flash memory 5 are repaired. There is an effect that it is possible to obtain a file management device that uses the flash memory 5 as a storage medium that is resistant to an abnormal end state and has high data reliability.

【0055】図6はファイル管理装置によるファイルの
削除処理を示すフローチャートである。まず、MPU1
は、キー入力部3からファイルの削除指令を受けると、
削除するファイルが格納されているセクタの番号を検索
する(ステップST40)。そして、MPU1は、セク
タ番号を検索すると、その削除するセクタを含むブロッ
クのデータをデータ待避領域16にコピーする(ステッ
プST41)。MPU1は、動作履歴記録領域10に対
して、ファイル削除中であることを示す動作識別コード
‘A100’と、そのファイルのファイル番号と、削除
するセクタを含むブロックの番号とを記録する(ステッ
プST42)。
FIG. 6 is a flowchart showing a file deletion process by the file management device. First, MPU1
Receives a file deletion command from the key input unit 3,
The number of the sector storing the file to be deleted is searched (step ST40). Then, when searching for the sector number, the MPU 1 copies the data of the block including the sector to be deleted to the data save area 16 (step ST41). The MPU 1 records the operation identification code 'A100' indicating that the file is being deleted, the file number of the file, and the number of the block including the sector to be deleted in the operation history recording area 10 (step ST42). ).

【0056】そして、MPU1は、削除するセクタを含
むブロックをブロック消去し(ステップST43)、削
除するファイル以外の有効データを書き戻す処理を実行
する(ステップST44)。即ち、そのブロックを構成
するセクタのうち、削除するセクタ以外のセクタに格納
されていたデータのみを元のブロックのセクタに書き戻
す処理を実行する。
The MPU 1 erases the block containing the sector to be deleted (step ST43), and executes a process of writing back valid data other than the file to be deleted (step ST44). In other words, of the sectors constituting the block, only the data stored in the sectors other than the sector to be deleted is written back to the sector of the original block.

【0057】次に、MPU1は、データの書き戻し処理
を実行すると、動作履歴記録領域10に対して、データ
削除が完了したことを示す動作識別コード‘A101’
を追記する(ステップST45)。MPU1は、動作識
別コード‘A101’を動作履歴記録領域10に追記す
ると、ディレクトリ領域13の管理データをディレクト
リ待避領域14にコピーする(ステップST46)。
Next, when the MPU 1 executes the data write-back processing, the operation identification code 'A101' indicating to the operation history recording area 10 that the data deletion has been completed.
Is added (step ST45). After adding the operation identification code 'A101' to the operation history recording area 10, the MPU 1 copies the management data of the directory area 13 to the directory save area 14 (step ST46).

【0058】次に、MPU1は、動作履歴記録領域10
に対して、ディレクトリ更新中であることを示す動作識
別コード‘A102’を追記する(ステップST4
7)。MPU1は、動作識別コード‘A102’を動作
履歴記録領域10に追記すると、ディレクトリ領域13
をブロック消去する(ステップST48)。また、MP
U1は、削除したファイルのディレクトリを未使用状態
にして、最新の管理データをディレクトリ領域13に記
録する(ステップST49)。なお、削除対象ファイル
以外のファイルに係る管理データは、ディレクトリ待避
領域14にコピーした管理データをディレクトリ領域1
3にコピーする。
Next, the MPU 1 operates in the operation history recording area 10.
Is added to the operation identification code 'A102' indicating that the directory is being updated (step ST4).
7). The MPU 1 adds the operation identification code 'A102' to the operation history recording area 10 and
Is erased (step ST48). Also, MP
U1 makes the directory of the deleted file unused, and records the latest management data in the directory area 13 (step ST49). The management data relating to files other than the file to be deleted is stored in the directory save area 14 in the directory area 1.
Copy to 3.

【0059】次に、MPU1は、動作履歴記録領域10
に対して、FAT更新中であることを示す動作識別コー
ド‘A103’を追記する(ステップST50)。MP
U1は、動作識別コード‘A103’を動作履歴記録領
域10に追記すると、FAT11をブロック消去する
(ステップST51)。また、MPU1は、新規FAT
エントリの記録と、既存FATエントリの書き戻しを実
行する(ステップST52)。即ち、予め、FATCO
PY12にコピーしていた既存FATエントリと、新規
FATエントリをマージして、FATエントリを更新す
る。
Next, the MPU 1 operates in the operation history recording area 10.
, An operation identification code 'A103' indicating that the FAT is being updated is added (step ST50). MP
When U1 adds the operation identification code 'A103' to the operation history recording area 10, the block erases the FAT11 (step ST51). Also, MPU1 has a new FAT
The entry is recorded and the existing FAT entry is written back (step ST52). That is, FATCO
The existing FAT entry copied to the PY 12 and the new FAT entry are merged to update the FAT entry.

【0060】次に、MPU1は、FAT11の更新を完
了すると、動作履歴記録領域10に対して、FAT更新
が完了したことを示す動作識別コード‘A104’を追
記する(ステップST53)。MPU1は、動作識別コ
ード‘A104’を動作履歴記録領域10に追記する
と、FATCOPY12をブロック消去する(ステップ
ST54)。
Next, when the updating of the FAT 11 is completed, the MPU 1 adds an operation identification code 'A104' indicating that the FAT updating is completed to the operation history recording area 10 (step ST53). After additionally writing the operation identification code 'A104' in the operation history recording area 10, the MPU 1 erases the block of the FATCOPY 12 (step ST54).

【0061】そして、MPU1は、次回のファイル削除
処理に備えるため、FAT11の管理データ(FATエ
ントリ)をFATCOPY12にコピーする(ステップ
ST55)。また、MPU1は、データ待避領域16を
ブロック消去するとともに(ステップST56)、ディ
レクトリ待避領域14をブロック消去し(ステップST
57)、動作履歴記録領域10をブロック消去する(ス
テップST58)。
Then, the MPU 1 copies the management data (FAT entry) of the FAT 11 to the FATCOPY 12 in preparation for the next file deletion processing (step ST55). Further, the MPU 1 erases the block of the data save area 16 (step ST56) and erases the block of the directory save area 14 (step ST56).
57), the block is erased from the operation history recording area 10 (step ST58).

【0062】ここで、上記ファイル削除処理の途中で電
源が突然遮断されて異常終了した場合について考える。
ここでは、一例として、図6のステップST43の処理
後に電源が遮断されたものとして説明する。なお、削除
対象のセクタを含むブロックに格納されていたファイル
は全て消去されているので、復旧処理を全く実施せずに
再起動した場合、そのブロックに格納されていたファイ
ルの読み出しを試みると、消去状態のファイルを読み出
すことになる。
Here, consider the case where the power supply is suddenly shut off during the above-described file deletion processing and the processing ends abnormally.
Here, as an example, a description will be given assuming that the power is turned off after the process of step ST43 in FIG. Note that all files stored in the block containing the sector to be deleted have been deleted, so if you restart without performing any recovery processing, if you try to read the file stored in that block, The file in the erased state will be read.

【0063】次に、動作履歴による復旧処理を実行する
場合について説明する。図7は再起動時に実行する復旧
処理を示すフローチャートである。まず、MPU1は、
再起動時に動作履歴記録領域10のデータをチェックす
る(ステップST60)。
Next, a case in which a recovery process is performed based on the operation history will be described. FIG. 7 is a flowchart showing a recovery process executed at the time of restart. First, MPU1
At the time of restart, data in the operation history recording area 10 is checked (step ST60).

【0064】MPU1は、動作履歴記録領域10に動作
識別コードの記録が残されていない場合(動作識別コー
ドが消去されている場合)、異常終了状態が発生してい
ないものと判断し、復旧処理を終了して通常の処理に移
行する。一方、動作識別コードの記録が残されている場
合(動作識別コードが消去されていない場合)、異常終
了状態が発生したものと判断し、ステップST61以降
の処理を実行する。
When no operation identification code is recorded in the operation history recording area 10 (when the operation identification code is erased), the MPU 1 determines that an abnormal end state has not occurred, and performs a recovery process. Ends, and the process proceeds to a normal process. On the other hand, when the record of the operation identification code is left (when the operation identification code is not erased), it is determined that the abnormal end state has occurred, and the processing after step ST61 is executed.

【0065】MPU1は、異常終了状態の発生を認識す
ると、動作履歴記録領域10に最後に記録されている動
作識別コードを解析し、ファイル削除処理のうち、どの
処理を実行している時に異常終了したかを判断する(ス
テップST61)。この実施の形態1では、ステップS
T43の実行後に異常終了が発生したものと仮定してい
るので、動作履歴記録領域10の最後に記録されている
動作識別コードは‘A100’である。
When the MPU 1 recognizes the occurrence of the abnormal end state, the MPU 1 analyzes the operation identification code recorded last in the operation history recording area 10 and determines which one of the file deletion processes is being executed. It is determined whether the process has been performed (step ST61). In the first embodiment, step S
Since it is assumed that abnormal termination has occurred after the execution of T43, the operation identification code recorded at the end of the operation history recording area 10 is “A100”.

【0066】異常終了の発生時期により、復旧処理の内
容が若干異なるが、ステップST62以降に示す処理は
動作識別コード‘A100’が検出された場合のフロー
チャートである。最後に記録されている動作識別コード
が別なコードの場合は、ステップST67、ステップS
T68、ステップST69、ステップST70の処理に
移行する。
Although the contents of the recovery processing are slightly different depending on the time of occurrence of the abnormal end, the processing shown after step ST62 is a flowchart when the operation identification code 'A100' is detected. If the last recorded operation identification code is a different code, step ST67, step S67
The process proceeds to T68, step ST69, and step ST70.

【0067】MPU1は、ステップST61において、
動作識別コード‘A100’が検出された場合、動作履
歴記録領域10に記録されているセクタ番号を参照し
て、そのセクタ番号が示すセクタを含むブロックをブロ
ック消去する(ステップST62)。そして、MPU1
は、図6のステップST41において、データ待避領域
16にコピーされたデータを上記のブロックにコピーす
る(ステップST63)。
MPU 1 determines in step ST 61
When the operation identification code 'A100' is detected, the block including the sector indicated by the sector number is erased with reference to the sector number recorded in the operation history recording area 10 (step ST62). And MPU1
Copies the data copied in the data save area 16 to the above block in step ST41 of FIG. 6 (step ST63).

【0068】MPU1は、上記のようにしてデータ領域
15の内容をデータの削除処理が実行される前の状態に
戻すと、データ待避領域16をブロック消去するととも
に(ステップST64)、動作履歴記録領域10をブロ
ック消去し(ステップST65)、ファイル削除処理を
再実行する(ステップST66)。なお、削除するファ
イルの番号は動作履歴記録領域10に記録されているの
で、動作履歴記録領域10を参照することにより認識す
ることができる。上記復旧処理により、消去された有効
なファイルが復活する。
When the MPU 1 returns the contents of the data area 15 to the state before the data deletion processing is executed as described above, the MPU 1 erases the data save area 16 as a block (step ST64), and also stores the operation history recording area. Then, block 10 is erased (step ST65), and the file deletion process is executed again (step ST66). Since the number of the file to be deleted is recorded in the operation history recording area 10, it can be recognized by referring to the operation history recording area 10. By the above-mentioned restoration processing, the deleted valid file is restored.

【0069】以上のように、この実施の形態1によれ
ば、ファイル削除処理中に動作識別コードを動作履歴記
録領域10に逐次記録して、削除するファイルの番号と
削除するファイルが格納されているセクタを含むブロッ
クの番号も動作履歴記録領域10に保存し、電源遮断な
どにより異常終了が発生すると、電源再起動時に動作識
別コードを解析して、フラッシュメモリ5の内容を修復
するようにしているので、突然の電源遮断などの突発的
な異常終了状態に強く、データの信頼性が高いフラッシ
ュメモリ5を記憶媒体に使用したファイル管理装置を得
ることができる効果を奏する。
As described above, according to the first embodiment, the operation identification code is sequentially recorded in the operation history recording area 10 during the file deletion processing, and the number of the file to be deleted and the file to be deleted are stored. The number of the block including the current sector is also stored in the operation history recording area 10, and if an abnormal end occurs due to power shutdown or the like, the operation identification code is analyzed when the power is restarted, and the contents of the flash memory 5 are restored. Therefore, a file management apparatus using a flash memory 5 having high data reliability as a storage medium, which is resistant to a sudden abnormal termination state such as a sudden power shutdown and the like, can be obtained.

【0070】実施の形態2.上記実施の形態1では、フ
ァイル書込処理又はファイル削除処理が正常終了した時
に動作履歴記録領域10をブロック消去するものについ
て示したが、ファイル書込処理又はファイル削除処理が
正常終了したことを示す動作識別コードを動作履歴記録
領域10に追記するようにして、動作履歴記録領域10
の空き領域が一定サイズ以下になったら、動作履歴記録
領域10をブロック消去するようにしてもよい。なお、
ファイル管理装置の構成及びフラッシュメモリ5上の論
理フォーマットは、上記実施の形態1における図1及び
図2と同様である。
Embodiment 2 In the first embodiment, the case where the operation history recording area 10 is erased as a block when the file writing process or the file deleting process ends normally is described. However, it indicates that the file writing process or the file deleting process ends normally. The operation identification code is added to the operation history recording area 10 so that the operation history recording area 10
When the empty area of the storage area becomes smaller than a certain size, the operation history recording area 10 may be erased as a block. In addition,
The configuration of the file management device and the logical format on the flash memory 5 are the same as those in FIGS. 1 and 2 in the first embodiment.

【0071】次に動作について説明する。図8はファイ
ル管理装置によるファイルの書込処理を示すフローチャ
ートである。まず、MPU1は、キー入力部3からファ
イルの書込指令を受けると、そのファイルを保存するた
めに必要なセクタ数を計算する。そして、MPU1は、
FAT11をスキャンして、空きセクタを必要セクタ分
検索する(ステップST80)。その際、必要セクタ分
の空きセクタが無い場合、ファイルの書き込みが不可で
あることを通知する(ステップST98)。
Next, the operation will be described. FIG. 8 is a flowchart showing a file writing process by the file management device. First, upon receiving a file write command from the key input unit 3, the MPU 1 calculates the number of sectors required to store the file. And MPU1
The FAT 11 is scanned to search for a necessary sector for a free sector (step ST80). At this time, if there is no empty sector for the required sector, it is notified that the file cannot be written (step ST98).

【0072】MPU1は、空きセクタを必要セクタ分検
索すると、動作履歴記録領域10の空き領域をチェック
する(ステップST81)。そして、MPU1は、空き
領域が一定サイズ以下の場合は、動作履歴記録領域10
をブロック消去する(ステップST82)。一方、空き
領域が一定サイズ以上の場合は、動作履歴記録領域10
に対して、ファイル書き込み中であることを示す動作識
別コード‘A000’と、そのファイルを記録するセク
タの番号を記録し(ステップST83)、そのファイル
を該当セクタに記録する(ステップST84)。
When the MPU 1 searches for empty sectors for the required sectors, it checks the empty area of the operation history recording area 10 (step ST81). If the free area is equal to or smaller than the predetermined size, the MPU 1
Is erased (step ST82). On the other hand, if the free space is equal to or larger than a certain size, the operation history recording area 10
Then, the operation identification code 'A000' indicating that the file is being written and the number of the sector for recording the file are recorded (step ST83), and the file is recorded in the corresponding sector (step ST84).

【0073】そして、MPU1は、ディレクトリ領域1
3のディレクトリチェックバイト20をスキャンして、
未使用ディレクトリを検索し(ステップST85)、デ
ィレクトリ領域13の管理データをディレクトリ待避領
域14にコピーする(ステップST86)。また、MP
U1は、動作履歴記録領域10に対して、ディレクトリ
更新中であることを示す動作識別コード‘A001’を
追記する(ステップST87)。
Then, the MPU 1 stores the directory area 1
Scan the directory check byte 20 of 3
An unused directory is searched (step ST85), and the management data of the directory area 13 is copied to the directory save area 14 (step ST86). Also, MP
U1 adds an operation identification code 'A001' indicating that the directory is being updated to the operation history recording area 10 (step ST87).

【0074】MPU1は、動作識別コード‘A001’
を動作履歴記録領域10に追記すると、ディレクトリ領
域13をブロック消去する(ステップST88)。そし
て、MPU1は、新規ディレクトリデータと既存ディレ
クトリデータをマージして、ディレクトリ領域13にマ
ージ後の管理データを記録する(ステップST89)。
The MPU 1 has the operation identification code “A001”
Is added to the operation history recording area 10, the directory area 13 is block erased (step ST88). Then, the MPU 1 merges the new directory data with the existing directory data and records the merged management data in the directory area 13 (step ST89).

【0075】次に、MPU1は、動作履歴記録領域10
に対して、FAT更新中であることを示す動作識別コー
ド‘A002’を追記する(ステップST90)。MP
U1は、動作識別コード‘A002’を動作履歴記録領
域10に追記すると、FAT11をブロック消去する
(ステップST91)。そして、MPU1は、新規FA
Tエントリの記録と、既存FATエントリの書き戻しを
実行する(ステップST92)。即ち、予め、FATC
OPY12にコピーしていた既存FATエントリと、新
規FATエントリをマージして、FATエントリを更新
する。
Next, the MPU 1 operates in the operation history recording area 10.
, An operation identification code 'A002' indicating that the FAT is being updated is added (step ST90). MP
When U1 adds the operation identification code 'A002' to the operation history recording area 10, the block erases the FAT 11 (step ST91). And MPU1 is a new FA
The recording of the T entry and the writing back of the existing FAT entry are executed (step ST92). That is, in advance, FATC
The existing FAT entry copied to OPY12 and the new FAT entry are merged to update the FAT entry.

【0076】次に、MPU1は、FAT11の更新を完
了すると、動作履歴記録領域10に対して、FAT更新
が完了したことを示す動作識別コード‘A003’を追
記する(ステップST93)。MPU1は、動作識別コ
ード‘A003’を動作履歴記録領域10に追記する
と、FATCOPY12をブロック消去する(ステップ
ST94)。
Next, when the updating of the FAT 11 is completed, the MPU 1 additionally writes an operation identification code 'A003' indicating that the FAT updating is completed in the operation history recording area 10 (step ST93). When the operation identification code 'A003' is added to the operation history recording area 10, the MPU 1 erases the block in the FATCOPY 12 (step ST94).

【0077】そして、MPU1は、次回のファイル書込
処理に備えるため、FAT11の管理データ(FATエ
ントリ)をFATCOPY12にコピーする(ステップ
ST95)。また、MPU1は、ディレクトリ待避領域
14をブロック消去し(ステップST96)、動作履歴
記録領域10に対して、ファイル書込処理が正常終了し
たことを示す動作識別コード‘A0FF’を追記する
(ステップST97)。
Then, the MPU 1 copies the management data (FAT entry) of the FAT 11 to the FATCOPY 12 in preparation for the next file writing process (step ST95). Also, the MPU 1 erases the block of the directory save area 14 (step ST96), and adds an operation identification code “A0FF” indicating that the file writing process has been normally completed to the operation history recording area 10 (step ST97). ).

【0078】上記実施の形態1では、電源起動時に動作
履歴記録領域10が消去されていない場合、動作識別コ
ードを解析して復旧処理を実行していたが、この実施の
形態2では、動作履歴記録領域10に最後に記録された
動作識別コードが、正常終了したことを示す動作識別コ
ードで無い場合、その動作識別コードを解析して、上記
実施の形態1と同様の復旧処理を実行するようにする。
In the first embodiment, when the operation history recording area 10 is not erased when the power is turned on, the operation identification code is analyzed and the recovery process is executed. In the second embodiment, the operation history is restored. If the operation identification code last recorded in the recording area 10 is not the operation identification code indicating the normal end, the operation identification code is analyzed and the same recovery processing as in the first embodiment is executed. To

【0079】ファイル削除処理についても、上記ファイ
ル書込処理と同様に、動作履歴記録領域10に最後に記
録された動作識別コードが、正常終了したことを示す動
作識別コードで無い場合、その動作識別コードを解析し
て、上記実施の形態1と同様の復旧処理を実行するよう
にする。
In the file deletion process, similarly to the file writing process, when the last operation identification code recorded in the operation history recording area 10 is not the operation identification code indicating normal end, the operation identification is performed. The code is analyzed to execute the same recovery processing as in the first embodiment.

【0080】フラッシュメモリ5は、データの読込時間
と比べて、データの書き込みや、ブロック消去に要する
時間が長いという欠点を有している。以上のように、こ
の実施の形態2によれば、ファイル書込処理あるいはフ
ァイル削除処理が正常終了した時には、正常終了したこ
とを示す動作識別コードを追記するようにし、動作履歴
記録領域10の空き領域が一定サイズ以下になったらブ
ロック消去するようにしているので、消去時間のオーバ
ヘッドを削減することができるようになり、その結果、
システムのスループットが向上する効果を奏する。
The flash memory 5 has a disadvantage that the time required for data writing and block erasing is longer than the data reading time. As described above, according to the second embodiment, when the file writing process or the file deleting process ends normally, the operation identification code indicating the normal end is added, and the free space in the operation history recording area 10 is added. Since the block erase is performed when the area becomes smaller than a certain size, the overhead of the erase time can be reduced, and as a result,
This has the effect of improving the system throughput.

【0081】実施の形態3.上記実施の形態1,2で
は、ファイル書込処理又はファイル削除処理中に動作識
別コードを動作履歴記録領域10に逐次記録するものに
ついて示したが、図12に示すように、動作識別コード
を逐次記録する際、その動作識別コードを動作履歴記録
領域10に対して、2回続けて記録するようにしてもよ
い。なお、ファイル管理装置の構成及びフラッシュメモ
リ5上の論理フォーマットは、上記実施の形態1におけ
る図1及び図2と同様である。
Embodiment 3 In the first and second embodiments, the case where the operation identification code is sequentially recorded in the operation history recording area 10 during the file writing process or the file deletion process has been described. However, as shown in FIG. At the time of recording, the operation identification code may be recorded in the operation history recording area 10 twice consecutively. The configuration of the file management device and the logical format on the flash memory 5 are the same as those in FIGS. 1 and 2 in the first embodiment.

【0082】上記実施の形態1では、ファイル書込処理
中における異常終了の例として、図4のステップST8
の処理を実行している時に、電源が遮断された場合につ
いて説明した。しかし、稀なケースとして動作識別コー
ドを記録している最中に電源が遮断される可能性もあ
る。動作履歴記録中に電源が遮断されると動作識別コー
ドが正しく記録されず、復旧処理が正しく実行されない
可能性がある。
In the first embodiment, as an example of the abnormal termination during the file writing process, step ST8 in FIG.
The case where the power supply is cut off during the execution of the processing described above has been described. However, in rare cases, the power supply may be shut off while the operation identification code is being recorded. If the power is turned off during the operation history recording, the operation identification code may not be recorded correctly, and the recovery process may not be executed correctly.

【0083】図9はセクタ番号が‘0010’、‘00
11’、‘0012’、‘0013’、‘0014’の
セクタにファイルを書き込む場合において、ステップS
T3を実行する前の動作履歴の記録状態を示す説明図で
ある。‘A000’の後に続く‘0010’、‘001
1’、‘0012’、‘0013’、‘0014’はフ
ァイルを記録するセクタの番号である。‘FFFF’は
データが消去状態であることを示している。
FIG. 9 shows that the sector numbers are "0010" and "00".
When writing a file to sectors 11 ',' 0012 ',' 0013 ', and' 0014 ', step S
FIG. 14 is an explanatory diagram showing a recording state of an operation history before executing T3. '0010', '001' following 'A000'
1 ',' 0012 ',' 0013 ', and' 0014 'are the numbers of the sectors for recording the file. 'FFFF' indicates that the data is in the erased state.

【0084】一方、図10はステップST2において、
ファイルを記録するセクタの番号を動作履歴記録領域1
0に記録している最中に異常終了した場合における動作
履歴の記録状態の一例を示したものである。本来、‘0
013’と記録されるべきところのデータが誤って‘0
000’と記録されてしまった状態を示している。この
場合、検出される動作識別コードは、‘A000’であ
るので、図5の復旧処理(ステップST29)が実行
される。図11は復旧処理の処理内容を示すフローチ
ャートである。
On the other hand, FIG. 10 shows that in step ST2,
The number of the sector for recording the file is set in the operation history recording area 1
This shows an example of the recording state of the operation history in the case of abnormal termination during recording to 0. Originally '0
The data to be recorded as “013” is incorrectly “0”.
000 'is recorded. In this case, since the detected operation identification code is “A000”, the restoration process (step ST29) in FIG. 5 is executed. FIG. 11 is a flowchart showing the processing contents of the recovery processing.

【0085】MPU1は、動作履歴記録領域10に記録
されているセクタ番号を参照して、そのセクタ番号が示
すセクタを含むブロックのデータをデータ待避領域16
にコピーする(ステップST100)。そして、MPU
1は、そのセクタを含むブロックをブロック消去し(ス
テップST101)、そのセクタ以外の有効データを書
き戻す処理を実行する(ステップST102)。即ち、
そのブロックを構成するセクタのうち、そのセクタ番号
が示すセクタ以外のセクタに格納されていたデータのみ
を元のブロックのセクタに書き戻す処理を実行する。そ
して、MPU1は、データ待避領域16をブロック消去
し(ステップST103)、動作履歴記録領域10をブ
ロック消去する(ステップST104)。
The MPU 1 refers to the sector number recorded in the operation history recording area 10 and stores the data of the block including the sector indicated by the sector number in the data save area 16.
(Step ST100). And MPU
The block 1 erases a block including the sector (step ST101) and executes a process of writing back valid data other than the sector (step ST102). That is,
A process of writing back only the data stored in the sectors other than the sector indicated by the sector number among the sectors constituting the block to the original block sector is executed. Then, the MPU 1 erases blocks in the data save area 16 (step ST103), and erases blocks in the operation history recording area 10 (step ST104).

【0086】以上のように、復旧処理は、動作履歴記録
領域10に記録されているセクタ番号のセクタに格納さ
れているデータを消去するための処理を実行するので、
図10に示した動作履歴記録状態で復旧処理を実行する
と、セクタ番号‘0000’のセクタに格納されている
データが誤って消去されることになる。
As described above, the recovery process executes the process for erasing the data stored in the sector of the sector number recorded in the operation history recording area 10.
If the recovery processing is executed in the operation history recording state shown in FIG. 10, the data stored in the sector with the sector number '0000' will be erased by mistake.

【0087】図12は図10と同様に、ステップST2
において、ファイルを記録するセクタの番号を動作履歴
記録領域10に記録している最中に異常終了した場合に
おける動作履歴の記録状態の一例を示したものである。
本来、‘0013’が2回続けて記録されるべきところ
のデータが‘0000’、‘FFFF’となっている。
FIG. 12 is similar to FIG.
9 shows an example of the recording state of the operation history when the operation is abnormally terminated while the number of the sector for recording the file is being recorded in the operation history recording area 10.
Originally, data where “0013” should be recorded twice consecutively is “0000” and “FFFF”.

【0088】この実施の形態3では、図11のステップ
ST100において、同じ値が2回続けて記録されてい
る動作識別コードのみを有効データとして扱う。したが
って、‘0000’は無効なデータとして扱われ、セク
タ番号‘0000’のデータが誤って消去されることは
無い。
In the third embodiment, in step ST100 of FIG. 11, only the operation identification code in which the same value is recorded twice consecutively is treated as valid data. Therefore, '0000' is treated as invalid data, and the data of sector number '0000' is not erased by mistake.

【0089】ここでは、ファイル書込処理の動作につい
て説明したが、ファイル削除処理においても、動作履歴
に記録するデータが異なるだけで、動作は同様であるの
で説明を省略する。
Although the operation of the file writing process has been described here, the operation of the file deletion process is the same as that of the file deletion process except that the data to be recorded in the operation history is different.

【0090】以上のように、この実施の形態3によれ
ば、ファイル書込処理時においてはファイルを書き込む
論理アドレスと処理経過状況を識別する動作識別コード
を2回続けて動作履歴記録領域10に逐次記録し、ファ
イル削除処理時においては削除するファイルの番号と、
消去中のブロックの番号と、処理経過状況を識別する動
作識別コードを2回続けて動作履歴記録領域10に逐次
記録するようにしているので、動作履歴記録中に異常終
了しても、正しく動作履歴を解析して、復旧処理を実行
することができるようになり、その結果、データの信頼
性が更に向上したフラッシュメモリ5を記憶媒体に使用
したファイル管理装置を得ることができる効果を奏す
る。
As described above, according to the third embodiment, at the time of file write processing, the logical address for writing a file and the operation identification code for identifying the progress of processing are stored twice in the operation history recording area 10 successively. The number of the file to be sequentially recorded and deleted during the file deletion process,
Since the number of the block being erased and the operation identification code for identifying the progress of processing are successively recorded twice consecutively in the operation history recording area 10, even if the operation ends abnormally during the operation history recording, the operation is correctly performed. The history can be analyzed and the recovery process can be executed. As a result, an effect is obtained that a file management device using the flash memory 5 as a storage medium with further improved data reliability can be obtained.

【0091】実施の形態4.この実施の形態4のファイ
ル管理装置は、フラッシュメモリ5のハードウエア・ス
テータスのエラーを検出するようにし、エラーを検出し
た場合には、ファイル書込処理又はファイル削除処理を
中断して、復旧処理を実行するようにしたものである。
Embodiment 4 The file management device according to the fourth embodiment detects an error in the hardware status of the flash memory 5, and when an error is detected, interrupts the file write process or the file delete process and performs a recovery process. Is executed.

【0092】ファイル管理装置の構成及びフラッシュメ
モリ5上の論理フォーマットは、上記実施の形態1にお
ける図1及び図2と同様である。ただし、この実施の形
態4では、MPU1は、更に検出手段及び制御手段を構
成する。
The configuration of the file management device and the logical format on the flash memory 5 are the same as those in FIGS. 1 and 2 in the first embodiment. However, in the fourth embodiment, the MPU 1 further configures a detection unit and a control unit.

【0093】フラッシュメモリ5は、DRAMやSRA
Mと異なり、データの書き込みやブロックの消去は、M
PU1からソフトウエア的なコマンドを発行することに
より実行される。図13はフラッシュメモリ5に対する
データの書込処理を実行するプログラム・コマンドを示
すフローチャートである。
The flash memory 5 includes a DRAM or an SRA
Unlike M, data writing and block erasing are performed by M
This is executed by issuing a software command from PU1. FIG. 13 is a flowchart showing a program command for executing a process of writing data to the flash memory 5.

【0094】まず、MPU1は、フラッシュメモリ5に
対してプログラムセットアップコマンドを書き込む処理
を実行する(ステップST110)。そして、MPU1
は、プログラムセットアップコマンドを書き込むと、フ
ラッシュメモリ5のプログラムアドレスに対してデータ
を書き込む処理を実行する(ステップST111)。
First, MPU 1 executes a process of writing a program setup command to flash memory 5 (step ST110). And MPU1
Executes the process of writing data to the program address of the flash memory 5 after writing the program setup command (step ST111).

【0095】MPU1は、フラッシュメモリ5のステー
タスがレディ状態になるまで待機し(ステップST11
2)、フラッシュメモリ5のステータスがレディ状態に
なると、フラッシュメモリ5のエラーステータスをチェ
ックする(ステップST113)。これにより、MPU
1は、フラッシュメモリ5のハードウエア的なエラーを
検出することができる。したがって、フラッシュメモリ
5のハードウエア的なエラーが検出された場合には、以
降のファイル書込処理を中断し、動作履歴による復旧処
理に移行する。
The MPU 1 waits until the status of the flash memory 5 becomes ready (step ST11).
2) When the status of the flash memory 5 becomes ready, the error status of the flash memory 5 is checked (step ST113). With this, MPU
1 can detect a hardware error of the flash memory 5. Therefore, when a hardware error of the flash memory 5 is detected, the subsequent file writing process is interrupted, and the process shifts to a recovery process based on the operation history.

【0096】図14はフラッシュメモリ5に対するブロ
ック消去を実行するブロックイレーズ・コマンドを示す
フローチャートである。まず、MPU1は、フラッシュ
メモリ5に対してブロックイレーズ・セットアップコマ
ンドを書き込む処理を実行する(ステップST12
0)。そして、MPU1は、ブロックイレーズ・セット
アップコマンドを書き込むと、フラッシュメモリ5に対
してブロックイレーズ・確認コマンドを書き込む処理を
実行する(ステップST121)。
FIG. 14 is a flowchart showing a block erase command for executing block erasure on the flash memory 5. First, the MPU 1 executes a process of writing a block erase / setup command to the flash memory 5 (step ST12).
0). After writing the block erase / setup command, the MPU 1 executes a process of writing a block erase / confirmation command to the flash memory 5 (step ST121).

【0097】MPU1は、フラッシュメモリ5のステー
タスがレディ状態になるまで待機し(ステップST12
2)、フラッシュメモリ5のステータスがレディ状態に
なると、フラッシュメモリ5のエラーステータスをチェ
ックする(ステップST123)。これにより、MPU
1は、フラッシュメモリ5のハードウエア的なエラーを
検出することができる。したがって、フラッシュメモリ
5のハードウエア的なエラーが検出された場合には、以
降のファイル削除処理を中断し、動作履歴による復旧処
理に移行する。
MPU 1 waits until the status of flash memory 5 becomes ready (step ST12).
2) When the status of the flash memory 5 becomes ready, the error status of the flash memory 5 is checked (step ST123). With this, MPU
1 can detect a hardware error of the flash memory 5. Therefore, when a hardware error of the flash memory 5 is detected, the subsequent file deletion processing is interrupted, and the processing shifts to the recovery processing based on the operation history.

【0098】以上のように、この実施の形態4によれ
ば、フラッシュメモリ5のハードウエア・ステータスの
エラーを検出すると、ファイル書込処理あるいはファイ
ル削除処理を中断して、復旧処理を実行するようにして
いるので、データの信頼性が更に向上したフラッシュメ
モリ5を記憶媒体に使用したファイル管理装置を得るこ
とができる効果を奏する。
As described above, according to the fourth embodiment, when an error in the hardware status of the flash memory 5 is detected, the file writing process or the file deleting process is interrupted, and the recovery process is executed. Therefore, there is an effect that a file management device using the flash memory 5 as a storage medium with further improved data reliability can be obtained.

【0099】実施の形態5.上記実施の形態4では、フ
ラッシュメモリ5のハードウエア・ステータスのエラー
を検出すると、ファイル書込処理あるいはファイル削除
処理を中断して、復旧処理を実行するものについて示し
たが、フラッシュメモリ5にコマンドを発行した時に計
測を開始するタイマを設け、フラッシュメモリ5から一
定時間応答がない場合は、ファイル書込処理あるいはフ
ァイル削除処理を中断し、復旧処理を実行するようにし
てもよい。ファイル管理装置の構成及びフラッシュメモ
リ5上の論理フォーマットは、上記実施の形態1におけ
る図1および図2と同様である。
Embodiment 5 FIG. In the fourth embodiment, when an error in the hardware status of the flash memory 5 is detected, the file writing process or the file deleting process is interrupted, and the recovery process is executed. A timer may be provided to start measurement when issuance is performed, and if there is no response from the flash memory 5 for a certain period of time, the file writing process or the file deleting process may be interrupted and the recovery process may be executed. The configuration of the file management device and the logical format on the flash memory 5 are the same as those in FIGS. 1 and 2 in the first embodiment.

【0100】図13及び図14におけるステップST1
12,ST122において、ステータスがレディ状態に
なるまで待機する処理は、フラッシュメモリ5から読み
出されるステータスをポーリングし、そのステータス中
の特定のビットをチェックしている。何らかの不具合に
より、その特定のビットがレディ状態にならないと、プ
ログラムがポーリング処理から次の処理に移行できない
場合がある。
Step ST1 in FIGS. 13 and 14
In steps 12 and 122, the process of waiting until the status becomes ready polls the status read from the flash memory 5 and checks a specific bit in the status. If the particular bit does not become ready due to some problem, the program may not be able to shift from polling processing to the next processing.

【0101】図15はこの実施の形態5におけるプログ
ラム・コマンドの処理内容を示すフローチャートであ
る。まず、MPU1は、フラッシュメモリ5に対してプ
ログラムセットアップコマンドを書き込む処理を実行す
る(ステップST130)。そして、MPU1は、プロ
グラムセットアップコマンドを書き込むと、フラッシュ
メモリ5のプログラムアドレスに対してデータを書き込
む処理を実行する(ステップST131)。その際、M
PU1は、タイマを起動する(ステップST132)。
FIG. 15 is a flowchart showing the contents of processing of a program command in the fifth embodiment. First, MPU 1 executes a process of writing a program setup command to flash memory 5 (step ST130). Then, when writing the program setup command, the MPU 1 executes a process of writing data to the program address of the flash memory 5 (step ST131). At that time, M
PU1 starts a timer (step ST132).

【0102】MPU1は、上記実施の形態4と同様に、
フラッシュメモリ5のステータスがレディ状態になるま
で待機するが(ステップST133)、その待機中、タ
イマの値をチェックし(ステップST134)、タイマ
の値が一定値以上になると、フラッシュメモリ5のステ
ータスが非レディ状態のままでも、ファイル書込処理を
中断して、復旧処理を実行するようにする。
The MPU 1 is similar to the fourth embodiment,
While waiting until the status of the flash memory 5 becomes ready (step ST133), the value of the timer is checked during the standby (step ST134). When the value of the timer exceeds a certain value, the status of the flash memory 5 is changed. Even in the non-ready state, the file write processing is interrupted and the recovery processing is executed.

【0103】ただし、タイマの値が一定値以下である限
り、待機状態を継続し、フラッシュメモリ5のステータ
スがレディ状態になると、上記実施の形態4と同様に、
フラッシュメモリ5のエラーステータスをチェックする
(ステップST135)。エラーが検出された場合に
は、ファイル書込処理を中断して、復旧処理を実行す
る。
However, as long as the value of the timer is equal to or less than the predetermined value, the standby state is continued, and when the status of the flash memory 5 becomes ready, the same as in the fourth embodiment,
The error status of the flash memory 5 is checked (step ST135). If an error is detected, the file writing process is interrupted, and the recovery process is executed.

【0104】この実施の形態5では、ファイル書込処理
中にタイマを起動して、タイマの値が一定値以上になる
と、復旧処理を実行するものについて示したが、ファイ
ル削除処理では、図14におけるステップST121の
処理後にタイマを起動するようにすればよく、ファイル
書込処理と同様に復旧処理を開始することができる。
In the fifth embodiment, the timer is started during the file writing process, and the recovery process is executed when the value of the timer exceeds a predetermined value. It is sufficient to start the timer after the process of step ST121 in, and the recovery process can be started in the same manner as the file writing process.

【0105】以上のように、この実施の形態5によれ
ば、フラッシュメモリ5にコマンドを発行した時に計測
を開始するタイマを設け、フラッシュメモリ5から一定
時間応答がない場合は、ファイル書込処理あるいはファ
イル削除処理を中断して、復旧処理を実行するようにし
ているので、データの信頼性が更に向上したフラッシュ
メモリ5を記憶媒体に使用したファイル管理装置を得る
ことができる効果を奏する。
As described above, according to the fifth embodiment, the timer for starting measurement when a command is issued to the flash memory 5 is provided. Alternatively, since the file deletion processing is interrupted and the recovery processing is executed, it is possible to obtain a file management apparatus using the flash memory 5 as a storage medium with further improved data reliability.

【0106】実施の形態6.近年のフラッシュメモリの
中には、2個のバンクから構成され、一方のバンクに対
する書込処理あるいは削除処理中に、他方のバンクから
データを読み出すことが可能なものがある。上記機能
は、デュアルオペレーション機能とか、バックグランド
・オペレーション機能などと呼ばれている。この実施の
形態6のファイル管理装置は、上記機能を有したフラッ
シュメモリ5を使用し、ファイル書込処理やファイル削
除処理における処理時間のパフォーマンス向上を図るも
のである。
Embodiment 6 FIG. 2. Description of the Related Art Some recent flash memories include two banks, and can read data from the other bank during writing or deleting of one bank. The above function is called a dual operation function or a background operation function. The file management device according to the sixth embodiment uses the flash memory 5 having the above functions to improve the performance of the processing time in the file writing process and the file deleting process.

【0107】図16はファイル管理装置におけるフラッ
シュメモリ5上の論理フォーマットを示す説明図であ
る。フラッシュメモリ5は、バンク(1)とバンク
(2)に区分けされ、バンク(1)にはブロック(0)
〜(15)が、バンク(2)にはブロック(16)〜
(31)が割り当てられている。バンク(1)に対して
書込処理や削除処理を実行している時に、バンク(2)
のデータを読み出すことが可能であり、逆に、バンク
(2)に対して書込処理や削除処理を実行している時
に、バンク(1)のデータを読み出すことが可能であ
る。
FIG. 16 is an explanatory diagram showing a logical format on the flash memory 5 in the file management device. The flash memory 5 is divided into a bank (1) and a bank (2), and the bank (1) has a block (0).
(15), but the bank (2) has the block (16)
(31) is assigned. When write processing or deletion processing is being performed on bank (1), bank (2)
Can be read, and conversely, data can be read from the bank (1) while writing or deleting is being performed on the bank (2).

【0108】この実施の形態6では、動作履歴記録領域
10にはブロック(0)が、FAT11にはブロック
(1)が、FATCOPY12にはブロック(29)
が、ディレクトリ領域13にはブロック(2)が、ディ
レクトリ待避領域14にはブロック(30)が、データ
領域15にはブロック(3)〜(28)が、データ待避
領域16にはブロック(31)が割り当てられている。
ファイル管理装置の構成は実施の形態1における図1と
同様である。ただし、このこの実施の形態6では、MP
U1は更に読込手段を構成している。
In the sixth embodiment, block (0) is stored in the operation history recording area 10, block (1) is stored in the FAT11, and block (29) is stored in the FATCOPY12.
However, the directory area 13 has a block (2), the directory save area 14 has a block (30), the data area 15 has blocks (3) to (28), and the data save area 16 has a block (31). Is assigned.
The configuration of the file management device is the same as that of the first embodiment shown in FIG. However, in this sixth embodiment, MP
U1 further constitutes reading means.

【0109】前の実施の形態で述べたように、ファイル
書込処理、ファイル削除処理、復旧処理等においては、
FAT、ディレクトリ、ファイル等を、任意のブロック
から別なブロックにコピーする処理が頻繁に実行され
る。図17はデュアルオペレーション機能を有していな
いフラッシュメモリを使用した場合におけるコピー処理
実行時の動作を説明する説明図である。
As described in the previous embodiment, in the file writing process, the file deleting process, the restoring process, etc.
A process of copying a FAT, a directory, a file, and the like from an arbitrary block to another block is frequently executed. FIG. 17 is an explanatory diagram for explaining an operation at the time of executing a copy process when a flash memory having no dual operation function is used.

【0110】コピー元のブロックから一定サイズのデー
タを読み出して、RAM8やMPU1内部のRAMにデ
ータを格納し、次にフラッシュメモリ5にプログラム・
コマンドを発行して、別なブロックにデータ書き込む。
上記読出動作と、書込動作を繰り返し実行して、1ブロ
ック分のデータをコピーする。書込時間は読出時間に比
べて長い時間を要するが、MPU1は書込動作が終了し
たことを示すステータスが得られるまで待機してから、
次のデータの読出動作に移行する。
Data of a certain size is read from the copy source block, and the data is stored in the RAM 8 or the RAM inside the MPU 1.
Issue a command to write data to another block.
The read operation and the write operation are repeatedly executed to copy one block of data. The write time takes a longer time than the read time, but the MPU 1 waits until a status indicating that the write operation has been completed is obtained,
Shift to the next data read operation.

【0111】図18はデュアルオペレーション機能を有
しているフラッシュメモリを使用した場合におけるコピ
ー処理実行時の動作を説明する説明図である。FAT1
1、ディレクトリ領域13及びデータ領域15の一部の
ブロックは、バンク(1)に構成され、FATCOPY
12、ディレクトリ待避領域14及びデータ待避領域1
6はバンク(2)に構成されている。
FIG. 18 is an explanatory diagram for explaining the operation at the time of executing copy processing when using a flash memory having a dual operation function. FAT1
1, some blocks of the directory area 13 and the data area 15 are configured in a bank (1), and FATCOPY
12, directory save area 14 and data save area 1
Reference numeral 6 denotes a bank (2).

【0112】したがって、バンク(1)のデータをバン
ク(2)に、あるいは、逆にバンク(2)のデータをバ
ンク(1)にコピーする場合、図18に示したように、
読出動作と書込動作をオーバーラップして実行すること
ができるため、データ処理時間を短縮することができ
る。以上、ブロック間でのデータコピー処理を例に、デ
ュアルオペレーション機能によりデータ処理時間が短縮
されることを説明したが、データコピー処理以外にも、
ファイル書込と未使用ディレクトリの検索を平行して行
うなど、別な処理に適用することも可能である。
Therefore, when data of bank (1) is copied to bank (2), or conversely, data of bank (2) is copied to bank (1), as shown in FIG.
Since the read operation and the write operation can be executed in an overlapping manner, the data processing time can be reduced. As described above, the data processing time is reduced by the dual operation function, taking the data copy processing between blocks as an example.
It is also possible to apply to other processing such as performing file writing and searching for an unused directory in parallel.

【0113】以上のように、この実施の形態6によれ
ば、デュアルオペレーション機能を有したフラッシュメ
モリ5を使用し、データのコピーなどが頻繁に行われる
ブロックは別々のバンクになるように論理フォーマット
を構成しているので、データ処理時間が短縮され、シス
テムのスループットが向上する効果を奏する。
As described above, according to the sixth embodiment, the flash memory 5 having the dual operation function is used, and the logical format is set so that the blocks where data copying and the like are frequently performed are in separate banks. , The data processing time is shortened and the system throughput is improved.

【0114】[0114]

【発明の効果】以上のように、この発明によれば、書込
手段が書込処理又は更新処理を実行する際、その処理内
容を示す識別コードをフラッシュメモリの動作履歴記録
領域に記録し、その書込処理又は更新処理が正常終了す
ると、その識別コードを消去する動作履歴記録手段を設
け、そのフラッシュメモリの動作履歴記録領域に識別コ
ードの記録が残されている場合、その識別コードを解析
して、そのデータ領域及び管理領域に格納されているデ
ータを復旧するように構成したので、書込手段が書込処
理又は更新処理を実行している時に電源遮断などの異常
状態が発生しても、ファイルやデータが破壊されること
なく、ファイル操作を正常に再開することができる効果
がある。
As described above, according to the present invention, when the writing means executes the writing process or the updating process, the identification code indicating the processing content is recorded in the operation history recording area of the flash memory. An operation history recording means for erasing the identification code when the writing process or the updating process ends normally is provided, and when the identification code is recorded in the operation history recording area of the flash memory, the identification code is analyzed. Then, since the data stored in the data area and the management area is configured to be restored, an abnormal state such as a power shutdown occurs when the writing unit is executing the writing process or the updating process. Also, there is an effect that file operations can be normally resumed without destroying files and data.

【0115】この発明によれば、書込手段が書込処理又
は更新処理を実行する際、その処理内容を示す識別コー
ドをフラッシュメモリの動作履歴記録領域に記録し、そ
の書込処理又は更新処理が正常終了すると、正常終了を
示す識別コードを動作履歴記録領域に記録する動作履歴
記録手段を設け、そのフラッシュメモリの動作履歴記録
領域に正常終了を示す識別コードが記録されていない場
合、その処理内容を示す識別コードを解析して、そのデ
ータ領域及び管理領域に格納されているデータを復旧す
るように構成したので、書込手段が書込処理又は更新処
理を実行している時に電源遮断などの異常状態が発生し
ても、ファイルやデータが破壊されることなく、ファイ
ル操作を正常に再開することができる効果がある。
According to the present invention, when the writing means executes the writing process or the updating process, the identification code indicating the processing content is recorded in the operation history recording area of the flash memory, and the writing process or the updating process is performed. Is normally provided, an operation history recording means for recording an identification code indicating the normal end in the operation history recording area is provided. If the identification code indicating the normal end is not recorded in the operation history recording area of the flash memory, the processing is performed. Since the configuration is such that the identification code indicating the content is analyzed and the data stored in the data area and the management area are restored, when the writing unit is executing the writing process or the updating process, the power supply is shut off. Even if an abnormal state occurs, file operations can be normally resumed without destroying files and data.

【0116】この発明によれば、識別コードの解析結果
に応じた復旧処理を実行して、データ領域及び管理領域
に格納されているデータを書込処理又は更新処理が実行
される前の内容に戻すように構成したので、突然の電源
遮断などの突発的な異常終了状態に強く、データの信頼
性が高いフラッシュメモリが得られる効果がある。
According to the present invention, the recovery processing is executed in accordance with the analysis result of the identification code, and the data stored in the data area and the management area is restored to the contents before the writing processing or the updating processing is executed. Since it is configured to return, a flash memory that is resistant to a sudden abnormal termination state such as a sudden power shutdown and has high data reliability can be obtained.

【0117】この発明によれば、削除手段が削除処理又
は更新処理を実行する際、その処理内容を示す識別コー
ドをフラッシュメモリの動作履歴記録領域に記録し、そ
の削除処理又は更新処理が正常終了すると、その識別コ
ードを消去する動作履歴記録手段を設け、そのフラッシ
ュメモリの動作履歴記録領域に識別コードの記録が残さ
れている場合、その識別コードを解析して、そのデータ
領域及び管理領域に格納されているデータを復旧するよ
うに構成したので、削除手段が削除処理又は更新処理を
実行している時に電源遮断などの異常状態が発生して
も、ファイルやデータが破壊されることなく、ファイル
操作を正常に再開することができる効果がある。
According to the present invention, when the deletion means executes the deletion processing or the update processing, the identification code indicating the processing content is recorded in the operation history recording area of the flash memory, and the deletion processing or the update processing ends normally. Then, an operation history recording means for erasing the identification code is provided, and if the identification code is recorded in the operation history recording area of the flash memory, the identification code is analyzed and the data area and the management area are analyzed. Since the stored data is configured to be restored, even if an abnormal condition such as power shutdown occurs while the deletion unit is executing the deletion process or the update process, the files and data are not destroyed, There is an effect that the file operation can be normally resumed.

【0118】この発明によれば、削除手段が削除処理又
は更新処理を実行する際、その処理内容を示す識別コー
ドをフラッシュメモリの動作履歴記録領域に記録し、そ
の削除処理又は更新処理が正常終了すると、正常終了を
示す識別コードを動作履歴記録領域に記録する動作履歴
記録手段を設け、そのフラッシュメモリの動作履歴記録
領域に正常終了を示す識別コードが記録されていない場
合、その処理内容を示す識別コードを解析して、そのデ
ータ領域及び管理領域に格納されているデータを復旧す
るように構成したので、削除手段が削除処理又は更新処
理を実行している時に電源遮断などの異常状態が発生し
ても、ファイルやデータが破壊されることなく、ファイ
ル操作を正常に再開することができる効果がある。
According to the present invention, when the deletion means executes the deletion processing or the update processing, the identification code indicating the processing content is recorded in the operation history recording area of the flash memory, and the deletion processing or the update processing ends normally. Then, an operation history recording means for recording an identification code indicating a normal end in the operation history recording area is provided, and when the identification code indicating the normal end is not recorded in the operation history recording area of the flash memory, the processing contents are indicated. Since the system is configured to analyze the identification code and recover the data stored in the data area and management area, an abnormal state such as power shutdown occurs when the deletion unit is executing the deletion or update processing. Even so, there is an effect that file operations can be normally resumed without destroying files and data.

【0119】この発明によれば、識別コードの解析結果
に応じた復旧処理を実行して、データ領域及び管理領域
に格納されているデータを削除処理又は更新処理が実行
される前の内容に戻すように構成したので、突然の電源
遮断などの突発的な異常終了状態に強く、データの信頼
性が高いフラッシュメモリが得られる効果がある。
According to the present invention, the recovery processing according to the analysis result of the identification code is executed to return the data stored in the data area and the management area to the contents before the deletion processing or the update processing was executed. With such a configuration, a flash memory which is resistant to a sudden abnormal termination state such as a sudden power shutdown and has high data reliability can be obtained.

【0120】この発明によれば、同一の識別コードが2
回続けて記録されている場合に限り、その識別コードを
有効な識別コードであるとして取り扱うように構成した
ので、動作履歴記録中に異常終了しても、正しく動作履
歴を解析して、復旧処理を実行することができるように
なり、その結果、データの信頼性が更に向上したフラッ
シュメモリを得ることができる効果がある。
According to the present invention, the same identification code is
The system is configured to treat the identification code as a valid identification code only when it is recorded consecutively, so that even if it ends abnormally while recording the operation history, it correctly analyzes the operation history and performs recovery processing. Can be executed, and as a result, it is possible to obtain a flash memory with further improved data reliability.

【0121】この発明によれば、検出手段がハードウエ
アエラーを検出すると、書込手段の処理を中止させて復
旧手段の処理を開始させるように構成したので、データ
の信頼性が更に向上したフラッシュメモリを得ることが
できる効果がある。
According to the present invention, when the detecting means detects a hardware error, the processing of the writing means is stopped and the processing of the restoring means is started, so that the flash having further improved data reliability is provided. There is an effect that a memory can be obtained.

【0122】この発明によれば、検出手段がハードウエ
アエラーを検出すると、削除手段の処理を中止させて復
旧手段の処理を開始させるように構成したので、データ
の信頼性が更に向上したフラッシュメモリを得ることが
できる効果がある。
According to the present invention, when the detecting means detects a hardware error, the processing of the deleting means is stopped and the processing of the restoring means is started. Therefore, the flash memory with further improved data reliability. There is an effect that can be obtained.

【0123】この発明によれば、検出手段がフラッシュ
メモリからハードウエアエラーのステータス信号を一定
時間以上受信できない場合、その検出手段がハードウエ
アエラーを検出した場合と同様の処理を実行するように
構成したので、フラッシュメモリに何らかの不具合が発
生して、ハードウエアエラーのステータス信号を受信で
きない場合でも、復旧手段が復旧処理を実行することが
できるようになり、その結果、データの信頼性が更に向
上したフラッシュメモリを得ることができる効果があ
る。
According to the present invention, when the detecting means cannot receive the hardware error status signal from the flash memory for a certain period of time or more, the detecting means executes the same processing as when detecting the hardware error. Therefore, even if a failure occurs in the flash memory and a hardware error status signal cannot be received, the recovery unit can execute the recovery process, and as a result, data reliability is further improved. There is an effect that a flash memory can be obtained.

【0124】この発明によれば、書込手段が一方のバン
クに対してファイルデータを書き込んでいる時、他方の
バンクからデータを読み込む読込手段を設けるように構
成したので、データ処理時間が短縮され、システムのス
ループットが向上する効果がある。
According to the present invention, when the writing means is writing file data to one bank, the reading means for reading data from the other bank is provided, so that the data processing time is reduced. This has the effect of improving the system throughput.

【0125】この発明によれば、削除手段が一方のバン
クからセクタを削除している時、他方のバンクからデー
タを読み込む読込手段を設けるように構成したので、デ
ータ処理時間が短縮され、システムのスループットが向
上する効果がある。
According to the present invention, when the deletion means is deleting a sector from one bank, the reading means for reading data from the other bank is provided, so that the data processing time is reduced, and This has the effect of improving throughput.

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

【図1】 この発明の実施の形態1によるファイル管理
装置を示す構成図である。
FIG. 1 is a configuration diagram showing a file management device according to a first embodiment of the present invention.

【図2】 ファイル管理装置におけるフラッシュメモリ
5上の論理フォーマットを示す説明図である。
FIG. 2 is an explanatory diagram showing a logical format on a flash memory 5 in the file management device.

【図3】 ディレクトリ領域13のフォーマットを示す
説明図である。
FIG. 3 is an explanatory diagram showing a format of a directory area 13;

【図4】 ファイル管理装置によるファイルの書込処理
を示すフローチャートである。
FIG. 4 is a flowchart illustrating a file writing process performed by the file management device.

【図5】 再起動時に実行する復旧処理を示すフローチ
ャートである。
FIG. 5 is a flowchart illustrating a recovery process executed at the time of restart.

【図6】 ファイル管理装置によるファイルの削除処理
を示すフローチャートである。
FIG. 6 is a flowchart illustrating a file deletion process performed by the file management device.

【図7】 再起動時に実行する復旧処理を示すフローチ
ャートである。
FIG. 7 is a flowchart illustrating a recovery process executed at the time of restart.

【図8】 ファイル管理装置によるファイルの書込処理
を示すフローチャートである。
FIG. 8 is a flowchart illustrating a file writing process performed by the file management device.

【図9】 ステップST3を実行する前の動作履歴の記
録状態を示す説明図である。
FIG. 9 is an explanatory diagram showing a recording state of an operation history before executing step ST3.

【図10】 ファイルを記録するセクタの番号を動作履
歴記録領域10に記録している最中に異常終了した場合
における動作履歴の記録状態の一例を示す説明図であ
る。
FIG. 10 is an explanatory diagram showing an example of a recording state of an operation history when an abnormal end occurs while the number of a sector for recording a file is being recorded in the operation history recording area 10;

【図11】 復旧処理の処理内容を示すフローチャー
トである。
FIG. 11 is a flowchart illustrating processing contents of a recovery processing.

【図12】 ファイルを記録するセクタの番号を動作履
歴記録領域10に記録している最中に異常終了した場合
における動作履歴の記録状態の一例を示す説明図であ
る。
FIG. 12 is an explanatory diagram showing an example of a recording state of an operation history when an abnormal end occurs while the number of a sector for recording a file is being recorded in the operation history recording area 10;

【図13】 フラッシュメモリ5に対するデータの書込
処理を実行するプログラム・コマンドを示すフローチャ
ートである。
FIG. 13 is a flowchart showing a program command for executing a process of writing data to the flash memory 5;

【図14】 フラッシュメモリ5に対するブロック消去
を実行するブロックイレーズ・コマンドを示すフローチ
ャートである。
FIG. 14 is a flowchart showing a block erase command for executing block erasure on the flash memory 5;

【図15】 プログラム・コマンドの処理内容を示すフ
ローチャートである。
FIG. 15 is a flowchart showing processing contents of a program command.

【図16】 ファイル管理装置におけるフラッシュメモ
リ5上の論理フォーマットを示す説明図である。
FIG. 16 is an explanatory diagram showing a logical format on the flash memory 5 in the file management device.

【図17】 デュアルオペレーション機能を有していな
いフラッシュメモリを使用した場合におけるコピー処理
実行時の動作を説明する説明図である。
FIG. 17 is an explanatory diagram illustrating an operation at the time of executing a copy process when a flash memory having no dual operation function is used.

【図18】 デュアルオペレーション機能を有している
フラッシュメモリを使用した場合におけるコピー処理実
行時の動作を説明する説明図である。
FIG. 18 is an explanatory diagram illustrating an operation at the time of executing copy processing when a flash memory having a dual operation function is used.

【図19】 従来のファイル管理装置におけるフラッシ
ュメモリ上の論理フォーマットを示す説明図である。
FIG. 19 is an explanatory diagram showing a logical format on a flash memory in a conventional file management device.

【図20】 従来のファイル管理装置の処理内容を示す
フローチャートである。
FIG. 20 is a flowchart showing processing contents of a conventional file management device.

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

1 MPU(書込手段、削除手段、動作履歴記録手段、
復旧手段、検出手段、制御手段、読込手段)、2 RO
M、3 キー入力部、4 I/F部、5 フラッシュメ
モリ、6 VRAM、7 表示部、8 RAM、10
動作履歴記録領域、11 FAT(管理領域)、12
FATCOPY、13 ディレクトリ領域(管理領
域)、14 ディレクトリ待避領域、15 データ領
域、16 データ待避領域、20 ディレクトリチェッ
クバイト、21 ファイル名、22 ファイル属性、2
3 日付、24 開始セクタ番号、25 ファイルサイ
ズ。
1 MPU (writing means, deletion means, operation history recording means,
Recovery means, detection means, control means, reading means), 2 RO
M, 3 key input section, 4 I / F section, 5 flash memory, 6 VRAM, 7 display section, 8 RAM, 10
Operation history recording area, 11 FAT (management area), 12
FATCOPY, 13 directory area (management area), 14 directory save area, 15 data area, 16 data save area, 20 directory check byte, 21 file name, 22 file attribute, 2
3 Date, 24 starting sector number, 25 file size.

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】 フラッシュメモリの管理領域に格納され
ている管理データを参照して、そのフラッシュメモリの
データ領域の空きセクタを検索し、その空きセクタに対
してファイルデータを書き込むとともに、その管理デー
タを更新する書込手段と、上記書込手段が書込処理又は
更新処理を実行する際、その処理内容を示す識別コード
を当該フラッシュメモリの動作履歴記録領域に記録し、
その書込処理又は更新処理が正常終了すると、その識別
コードを消去する動作履歴記録手段と、上記フラッシュ
メモリの動作履歴記録領域に識別コードの記録が残され
ている場合、その識別コードを解析して、そのデータ領
域及び管理領域に格納されているデータを復旧する復旧
手段とを備えたファイル管理装置。
An empty sector in a data area of the flash memory is searched by referring to management data stored in a management area of the flash memory, and file data is written to the empty sector. A writing unit for updating the writing process, and when the writing unit executes a writing process or an updating process, an identification code indicating the processing content is recorded in an operation history recording area of the flash memory;
When the writing process or the updating process ends normally, the operation history recording means for erasing the identification code and, if the identification code is recorded in the operation history recording area of the flash memory, analyze the identification code. And a recovery means for recovering data stored in the data area and the management area.
【請求項2】 フラッシュメモリの管理領域に格納され
ている管理データを参照して、そのフラッシュメモリの
データ領域の空きセクタを検索し、その空きセクタに対
してファイルデータを書き込むとともに、その管理デー
タを更新する書込手段と、上記書込手段が書込処理又は
更新処理を実行する際、その処理内容を示す識別コード
を当該フラッシュメモリの動作履歴記録領域に記録し、
その書込処理又は更新処理が正常終了すると、正常終了
を示す識別コードを当該動作履歴記録領域に記録する動
作履歴記録手段と、上記フラッシュメモリの動作履歴記
録領域に正常終了を示す識別コードが記録されていない
場合、その処理内容を示す識別コードを解析して、その
データ領域及び管理領域に格納されているデータを復旧
する復旧手段とを備えたファイル管理装置。
2. Searching for a free sector in a data area of the flash memory with reference to management data stored in a management area of the flash memory, writing file data to the free sector, and A writing unit for updating the writing process, and when the writing unit executes a writing process or an updating process, an identification code indicating the processing content is recorded in an operation history recording area of the flash memory;
When the writing process or the updating process is completed normally, an operation history recording means for recording an identification code indicating normal completion in the operation history recording area, and an identification code indicating normal completion in the operation history recording area of the flash memory. If not, a file management apparatus comprising: a recovery unit that analyzes an identification code indicating the processing content and recovers data stored in the data area and the management area.
【請求項3】 復旧手段は、識別コードの解析結果に応
じた復旧処理を実行して、データ領域及び管理領域に格
納されているデータを書込処理又は更新処理が実行され
る前の内容に戻すことを特徴とする請求項1又は請求項
2記載のファイル管理装置。
3. The recovery means executes recovery processing according to the analysis result of the identification code, and restores the data stored in the data area and the management area to the contents before the write processing or the update processing is executed. 3. The file management apparatus according to claim 1, wherein the file management apparatus returns the file management information.
【請求項4】 フラッシュメモリの管理領域に格納され
ている管理データを参照して、その削除対象のセクタを
含むデータ領域のブロックを検索し、そのブロックから
削除対象のセクタを削除するとともに、その管理データ
を更新する削除手段と、上記削除手段が削除処理又は更
新処理を実行する際、その処理内容を示す識別コードを
当該フラッシュメモリの動作履歴記録領域に記録し、そ
の削除処理又は更新処理が正常終了すると、その識別コ
ードを消去する動作履歴記録手段と、上記フラッシュメ
モリの動作履歴記録領域に識別コードの記録が残されて
いる場合、その識別コードを解析して、そのデータ領域
及び管理領域に格納されているデータを復旧する復旧手
段とを備えたファイル管理装置。
4. A block in a data area including a sector to be deleted is searched by referring to management data stored in a management area of the flash memory, and a sector to be deleted is deleted from the block. Deletion means for updating management data, and when the deletion means executes deletion processing or update processing, an identification code indicating the content of the processing is recorded in the operation history recording area of the flash memory, and the deletion processing or update processing is performed. When the operation is normally completed, the operation history recording means for erasing the identification code, and when the identification code is recorded in the operation history recording area of the flash memory, the identification code is analyzed, and the data area and the management area are analyzed. File management device comprising: recovery means for recovering data stored in a file.
【請求項5】 フラッシュメモリの管理領域に格納され
ている管理データを参照して、その削除対象のセクタを
含むデータ領域のブロックを検索し、そのブロックから
削除対象のセクタを削除するとともに、その管理データ
を更新する削除手段と、上記削除手段が削除処理又は更
新処理を実行する際、その処理内容を示す識別コードを
当該フラッシュメモリの動作履歴記録領域に記録し、そ
の削除処理又は更新処理が正常終了すると、正常終了を
示す識別コードを当該動作履歴記録領域に記録する動作
履歴記録手段と、上記フラッシュメモリの動作履歴記録
領域に正常終了を示す識別コードが記録されていない場
合、その処理内容を示す識別コードを解析して、そのデ
ータ領域及び管理領域に格納されているデータを復旧す
る復旧手段とを備えたファイル管理装置。
5. A block in a data area including a sector to be deleted is searched for by referring to management data stored in a management area of the flash memory, and a sector to be deleted is deleted from the block. Deletion means for updating management data, and when the deletion means executes deletion processing or update processing, an identification code indicating the content of the processing is recorded in the operation history recording area of the flash memory, and the deletion processing or update processing is performed. An operation history recording unit that records an identification code indicating a normal end in the operation history recording area when the operation ends normally; and a processing content when an identification code indicating a normal end is not recorded in the operation history recording area of the flash memory. Recovery means for analyzing the identification code indicating the data area and recovering the data stored in the data area and the management area. File management device.
【請求項6】 復旧手段は、識別コードの解析結果に応
じた復旧処理を実行して、データ領域及び管理領域に格
納されているデータを削除処理又は更新処理が実行され
る前の内容に戻すことを特徴とする請求項4又は請求項
5記載のファイル管理装置。
6. The recovery means executes recovery processing according to the analysis result of the identification code, and returns the data stored in the data area and the management area to the contents before the deletion processing or the update processing was executed. The file management device according to claim 4 or 5, wherein
【請求項7】 動作履歴記録手段が同一の識別コードを
動作履歴記録領域に2回続けて記録する場合、復旧手段
は同一の識別コードが2回続けて記録されている場合に
限り、その識別コードを有効な識別コードであるとして
取り扱うことを特徴とする請求項1から請求項6のうち
のいずれか1項記載のファイル管理装置。
7. When the operation history recording means records the same identification code twice consecutively in the operation history recording area, the recovery means performs the identification only when the same identification code is recorded twice consecutively. 7. The file management apparatus according to claim 1, wherein the code is treated as a valid identification code.
【請求項8】 フラッシュメモリのハードウエアエラー
を検出する検出手段と、上記検出手段がハードウエアエ
ラーを検出すると、書込手段の処理を中止させて復旧手
段の処理を開始させる制御手段とを設けたことを特徴と
する請求項1から請求項3のうちのいずれか1項記載の
ファイル管理装置。
8. A detecting means for detecting a hardware error of the flash memory, and a control means for stopping the processing of the writing means and starting the processing of the recovery means when the detecting means detects the hardware error. The file management device according to claim 1, wherein
【請求項9】 フラッシュメモリのハードウエアエラー
を検出する検出手段と、上記検出手段がハードウエアエ
ラーを検出すると、削除手段の処理を中止させて復旧手
段の処理を開始させる制御手段とを設けたことを特徴と
する請求項4から請求項6のうちのいずれか1項記載の
ファイル管理装置。
9. A detecting means for detecting a hardware error of the flash memory, and a control means for stopping the processing of the deleting means and starting the processing of the restoring means when the detecting means detects the hardware error. The file management device according to claim 4, wherein the file management device is a file management device.
【請求項10】 検出手段がフラッシュメモリからハー
ドウエアエラーのステータス信号を一定時間以上受信で
きない場合、制御手段は上記検出手段がハードウエアエ
ラーを検出した場合と同様の処理を実行することを特徴
とする請求項8又は請求項9記載のファイル管理装置。
10. When the detecting means cannot receive a hardware error status signal from the flash memory for a certain period of time or more, the control means executes the same processing as when the detecting means detects a hardware error. The file management device according to claim 8 or 9, wherein
【請求項11】 フラッシュメモリが2個のバンクから
構成されている場合、書込手段が一方のバンクに対して
ファイルデータを書き込んでいる時、他方のバンクから
データを読み込む読込手段を設けたことを特徴とする請
求項1から請求項3のうちのいずれか1項記載のファイ
ル管理装置。
11. When the flash memory is composed of two banks, when the writing means is writing file data to one bank, reading means for reading data from the other bank is provided. 4. The file management device according to claim 1, wherein:
【請求項12】 フラッシュメモリが2個のバンクから
構成されている場合、削除手段が一方のバンクからセク
タを削除している時、他方のバンクからデータを読み込
む読込手段を設けたことを特徴とする請求項4から請求
項6のうちのいずれか1項記載のファイル管理装置。
12. When the flash memory is composed of two banks, reading means for reading data from the other bank is provided when the deleting means deletes a sector from one bank. The file management device according to any one of claims 4 to 6, wherein
JP25601999A 1999-09-09 1999-09-09 File managing device Abandoned JP2001084180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25601999A JP2001084180A (en) 1999-09-09 1999-09-09 File managing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25601999A JP2001084180A (en) 1999-09-09 1999-09-09 File managing device

Publications (1)

Publication Number Publication Date
JP2001084180A true JP2001084180A (en) 2001-03-30

Family

ID=17286791

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25601999A Abandoned JP2001084180A (en) 1999-09-09 1999-09-09 File managing device

Country Status (1)

Country Link
JP (1) JP2001084180A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100573694B1 (en) * 2002-08-17 2006-04-26 삼성전자주식회사 Image recording/reproducing apparatus for system optimization
JP2006338083A (en) * 2005-05-31 2006-12-14 Tdk Corp Memory controller
JPWO2005041050A1 (en) * 2003-10-27 2007-11-22 松下電器産業株式会社 Recording medium, data processing apparatus, and data processing method
WO2007145316A1 (en) * 2006-06-15 2007-12-21 Panasonic Corporation Memory controller, nonvolatile storage device, and nonvolatile storage device system
US7634612B2 (en) 2003-04-25 2009-12-15 Fujifilm Corporation Method of recording and reproducing information
JP2010517131A (en) * 2007-01-18 2010-05-20 サンディスク アイエル リミテッド Method and system for facilitating fast startup of a flash memory system
JP2014071740A (en) * 2012-09-28 2014-04-21 Fujitsu Ltd Information processor, management method, and management program

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100573694B1 (en) * 2002-08-17 2006-04-26 삼성전자주식회사 Image recording/reproducing apparatus for system optimization
US7634612B2 (en) 2003-04-25 2009-12-15 Fujifilm Corporation Method of recording and reproducing information
JPWO2005041050A1 (en) * 2003-10-27 2007-11-22 松下電器産業株式会社 Recording medium, data processing apparatus, and data processing method
JP4731325B2 (en) * 2003-10-27 2011-07-20 パナソニック株式会社 Recording medium, data processing apparatus, and data processing method
JP2006338083A (en) * 2005-05-31 2006-12-14 Tdk Corp Memory controller
JP4661369B2 (en) * 2005-05-31 2011-03-30 Tdk株式会社 Memory controller
WO2007145316A1 (en) * 2006-06-15 2007-12-21 Panasonic Corporation Memory controller, nonvolatile storage device, and nonvolatile storage device system
US8180738B2 (en) 2006-06-15 2012-05-15 Panasonic Corporation Memory controller, nonvolatile storage device, and nonvolatile storage device system
JP5027805B2 (en) * 2006-06-15 2012-09-19 パナソニック株式会社 MEMORY CONTROLLER, NONVOLATILE STORAGE DEVICE, AND NONVOLATILE STORAGE DEVICE SYSTEM
JP2010517131A (en) * 2007-01-18 2010-05-20 サンディスク アイエル リミテッド Method and system for facilitating fast startup of a flash memory system
JP2014071740A (en) * 2012-09-28 2014-04-21 Fujitsu Ltd Information processor, management method, and management program

Similar Documents

Publication Publication Date Title
US5734816A (en) Nonvolatile memory with flash erase capability
US7558904B2 (en) Controller, data memory system, data rewriting method, and computer program product
US6839823B1 (en) Increased reliability of data stored on flash memory in applications sensitive to power-loss
US6687784B2 (en) Controller for controlling nonvolatile memory unit
US7587562B2 (en) Data duplication system, data duplication method and program
JP2846739B2 (en) Method for safely updating EEPROM memory
KR20110097937A (en) Ruggedized memory device
JP2001134482A (en) Method for operating independent data copy in data processing system
JPH117505A (en) Card type storage medium
WO2003056433A1 (en) Memory device and recording/reproducing apparatus using the same
JP4046877B2 (en) Batch erase nonvolatile memory and mobile phone
US6016536A (en) Method for backing up the system files in a hard disk drive
JP3472008B2 (en) Flash memory management method
US5590298A (en) Method of restoring and updating records in a disk cache system during disk drive idle time using start and end addresses
JP3544476B2 (en) Creating a memory management table
JP2004303238A (en) Flash memory access device and method
KR100703680B1 (en) Flash file system
JP4175881B2 (en) Nonvolatile memory storage method and storage device
JP2001084180A (en) File managing device
JP2006018471A (en) Storage device
US7167964B1 (en) Memory defragmentation in chipcards
JPH11272569A (en) Data restoration system for outer storage device using flash memory
US6907506B2 (en) Security device for a mass storage
EP2267725A1 (en) Memory device for managing the recovery of a non volatile memory
CN110471626B (en) Nor Flash management layer and method applied to Java Card

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20051020

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20051115

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20051226