JP2006048585A - Flash memory access method - Google Patents
Flash memory access method Download PDFInfo
- Publication number
- JP2006048585A JP2006048585A JP2004232153A JP2004232153A JP2006048585A JP 2006048585 A JP2006048585 A JP 2006048585A JP 2004232153 A JP2004232153 A JP 2004232153A JP 2004232153 A JP2004232153 A JP 2004232153A JP 2006048585 A JP2006048585 A JP 2006048585A
- Authority
- JP
- Japan
- Prior art keywords
- data
- block
- physical address
- flash memory
- old
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000001174 ascending effect Effects 0.000 claims abstract description 18
- 230000003247 decreasing effect Effects 0.000 claims description 5
- 238000012795 verification Methods 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 52
- 230000007547 defect Effects 0.000 description 6
- 230000002950 deficient Effects 0.000 description 3
- 238000012937 correction Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000011835 investigation Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Landscapes
- Read Only Memory (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
【課題】フラッシュメモリに格納されているデータが更新されたとき、旧いデータを格納するブロックには“旧”のフラグを書き込んでいた。しかし、多値メモリではフラグに書き込むことが困難であり、新旧を判断する他の方法が求められている。
【解決手段】フラッシュメモリを用いたメモリカードに、論理アドレスに関連付けられて格納されているデータを更新するとき、更新される前のデータが格納されたブロックの物理アドレスを起点に、昇順方向にたどって使用可能で未使用の最初のブロックに最新のデータを格納する。そして、ある論理アドレスの最新のデータが格納されたブロックを求めるときは、フラッシュメモリの使用可能で未使用のブロックの中で物理アドレスが最大の値を求め、降順方向にたどって求める論理アドレスのデータが格納されたブロックの最初のブロックに格納されていると判断する。
【選択図】図1When data stored in a flash memory is updated, an "old" flag is written in a block storing old data. However, it is difficult to write to a flag in a multi-level memory, and another method for determining whether it is new or old is required.
When updating data stored in association with a logical address in a memory card using a flash memory, the physical address of the block in which the data before the update is stored starts in the ascending order. The latest data is stored in the first unused block that can be traced. Then, when obtaining the block in which the latest data of a certain logical address is stored, the maximum value of the physical address in the usable and unused blocks of the flash memory is obtained, and the logical address obtained in the descending order is obtained. It is determined that the data is stored in the first block of the stored block.
[Selection] Figure 1
Description
本発明は、フラッシュメモリを用いたメモリカードなどファイルストレージデバイスのデータを更新し、更新されたデータの新旧を判別するアクセス方法に関わる。 The present invention relates to an access method for updating data in a file storage device such as a memory card using a flash memory and determining whether the updated data is new or old.
NAND型フラッシュメモリなどの不揮発性メモリは占有する容積が小さく、低消費電力であって、かつ電源を供給しなくてもデータを保持できる。この特性を生かして、メモリカードなど携帯できる形態で電子データを保存するファイルストレージデバイスの用途に広く使われている。 A non-volatile memory such as a NAND flash memory occupies a small volume, has low power consumption, and can hold data without supplying power. Taking advantage of this characteristic, it is widely used for file storage devices that store electronic data in a portable form such as a memory card.
フラッシュメモリは、メモリセルとなるトランジスタのフローティングゲートに電子などの電荷を注入し、保持することで情報を記憶している。データの書き込みは指定されたアドレスに対応するメモリセルを個々に選択し、電荷を注入して書き込んでいる。しかしフラッシュメモリでは注入された電荷を取り除く逆方向の値の書き込み動作は個々のメモリセル毎に行うのではなく、セルアレイ領域を区分する所定のブロック内のメモリセルを一括して行われ、この動作を一括消去と呼んでいる。このため、既にデータが書き込まれたブロックの内容を更新しようとする場合は、全てのメモリセルが消去状態になっている未使用のブロックを選択して修正されたデータを書き込まなければならない。データの更新を行ったときは、更新される前のデータが格納されたブロックには古いデータであることを示すために、新旧フラッグと呼ばれる特定のビットのメモリセルに旧を示す値を書き込んで区別する方法が取られている。 A flash memory stores information by injecting charges such as electrons into a floating gate of a transistor serving as a memory cell and holding it. Data is written by selecting a memory cell corresponding to a specified address and injecting charges. However, in the flash memory, the write operation of the reverse value to remove the injected charge is not performed for each individual memory cell, but is performed collectively for the memory cells in a predetermined block that partitions the cell array region. Is called batch erasure. For this reason, when trying to update the contents of a block in which data has already been written, it is necessary to select an unused block in which all the memory cells are in the erased state and write the corrected data. When data is updated, a value indicating the old is written in a memory cell of a specific bit called a new / old flag to indicate that the old data is stored in the block in which the data before the update is stored. A way to distinguish is taken.
この新旧フラグは、ブロック内の特定のビットが割り当てられ、最初にデータを書き込むときには未書き込みの状態で設定されている。そしてデータの更新が行われ、他のブロックに最新のデータが書き込まれたとき、旧となるブロックの新旧フラグとして割り当てられたビットに追加の書き込みが行われる。 This new / old flag is assigned a specific bit in the block, and is set in an unwritten state when data is first written. When data is updated and the latest data is written in another block, additional writing is performed on the bits assigned as the old / new flag of the old block.
パーソナルコンピュータなどの電子機器をホストとして、メモリカードにデータを書き込んだり、読み出したりする場合、ホストとなる機器で定義するアドレスと、フラッシュメモリが取り扱うアドレスは異なっていて、ホストがデータ処理で取り扱うアドレスを論理アドレスと呼んでいる。フラッシュメモリは、NAND型やNOR型などデバイス固有の構造に合わせたアドレスが振り当てられていて、これを物理アドレスと呼んでいる。 When data is written to or read from a memory card using an electronic device such as a personal computer as the host, the address defined by the host device and the address handled by the flash memory are different, and the address handled by the host for data processing Is called a logical address. The flash memory is assigned an address according to a device-specific structure such as a NAND type or a NOR type, and this is called a physical address.
フラッシュメモリにデータを書き込んだときのデータ構造を図8に示す。フラッシュメモリ800の記憶領域は複数のブロック801で構成され、それぞれに物理アドレス802が与えられている。データ領域803はメイン領域804とスペア領域805に分けられ、メイン領域804にホストから送られてくるデータを記憶する。スペア領域805には、論理アドレス806、新旧フラグ807、およびエラー訂正情報などその他808の情報を記憶している。論理アドレス“579”のデータは物理アドレス“7901”と“7908”のブロックに記憶されているが、物理アドレス“7901”のブロックの新旧フラグ807には“1”の旗が立っていて、旧のデータであることを示している。
FIG. 8 shows the data structure when data is written to the flash memory. The storage area of the flash memory 800 is composed of a plurality of
上記からわかるようにメイン領域804、およびスペア領域805の中の論理アドレス806とその他808には、このブロックに最初にデータを書き込んだときに同時にその値画がデータとして書き込まれる。しかし、新旧フラグ807は、任意の論理アドレスに関連づけられたデータが更新されて、未使用のブロックに書き込まれるとき、旧いデータが保持されているブロックの新旧フラグ807に旧の値が書き込まれる。(特許文献1参照)
このように、従来のフラッシュメモリは、一度データが書き込まれたブロックに対しても新旧フラグに対応したビットを未書き込みの状態で用意しておけば、旧のデータになった時点で該当するブロックの新旧フラグの対応するビットを選択して書き込むことができる。従って、データの更新が繰り返されて、同じ論理アドレスのデータが複数存在しても常に最新のデータが書き込まれたブロックを容易に特定することができる。
As can be seen from the above, in the
As described above, in the conventional flash memory, if a bit corresponding to the new and old flags is prepared in an unwritten state even for a block in which data has been written once, the corresponding block at the time when the old data is obtained. The corresponding bits of the old and new flags can be selected and written. Therefore, the data update is repeated, so that even if there are a plurality of pieces of data having the same logical address, it is possible to easily identify a block in which the latest data is always written.
また、この情報は不揮発性メモリであるフラッシュメモリに保持されているのでメモリカードの電源が切られた後も保持されている。 Further, since this information is held in the flash memory which is a non-volatile memory, it is also held after the memory card is turned off.
近年フラッシュメモリの記憶密度を向上する手段として、多値技術が開発され利用されるようになってきた。多値技術とは、1つのメモリセルに従来のように“0”、“1”の1ビットだけの情報を記憶させるのではなく、注入された電荷の量の多寡についても情報として加え、2ビット以上の情報を記憶させる技術である。図9を用いて多値フラッシュメモリセルの記憶原理について説明する。1つのメモリセルの電荷が注入されることによって、セルの閾値電圧Vthが変化する。図9では、そのVthのレベルを注入されていない消去された状態と合わせて4段階に分割し、2ビットの情報を記憶する例を示している。縦軸はメモリセルの閾値電圧Vthを示し、V1、V2、V3はメモリセルの記憶状態を判定する電圧を示している。横軸はメモリセルの各状態の分布状況を示している。“ ”で挟んだ2つの数字の、左側が上位ビットの値を示し、右側が下位ビットの値を示している。 In recent years, multivalue technology has been developed and used as means for improving the storage density of flash memory. In the multi-value technique, information of only one bit of “0” and “1” is not stored in one memory cell as in the past, but the amount of injected charge is added as information. This is a technique for storing information of bits or more. The storage principle of the multilevel flash memory cell will be described with reference to FIG. When the charge of one memory cell is injected, the threshold voltage Vth of the cell changes. FIG. 9 shows an example in which the Vth level is divided into four stages together with the erased state that is not injected, and 2-bit information is stored. The vertical axis indicates the threshold voltage Vth of the memory cell, and V1, V2, and V3 indicate voltages for determining the memory state of the memory cell. The horizontal axis shows the distribution of each state of the memory cell. Of the two numbers between “”, the left side indicates the value of the upper bit and the right side indicates the value of the lower bit.
消去された状態、すなわち、Vth<V1のとき、2ビットの値を“11”とし、V1<Vth<V2を“10”、V2<Vth<V3を“01”、V3<Vthを“00”と定義することができる。このようにメモリセルの閾値レベルを細かく区分することで2ビットの情報を記憶できることがわかる。 In the erased state, that is, when Vth <V1, the 2-bit value is “11”, V1 <Vth <V2 is “10”, V2 <Vth <V3 is “01”, and V3 <Vth is “00”. Can be defined as Thus, it can be seen that 2-bit information can be stored by finely dividing the threshold level of the memory cell.
ところが、既にデータが書き込まれたブロックで特定のビットの値を書き込むときには手数がかかることになる。例えば、下位ビットの値を“1”から“0”に書換える場合、上位ビットの値が“1”の場合は狙いとする閾値Vthの値がV1<Vth<V2となり、上位ビットの値が“0”の場合は狙いとする閾値Vth<V3となる。このように特定のビットに書き込みを行うためにはメモリセルを共有する他方のビットの値を読み出してから書き込みレベルを指定しなければならない。従って、1ビットの値を単独に書換えることは手間のかかる作業となる。 However, it takes time to write a specific bit value in a block in which data has already been written. For example, when the value of the lower bit is rewritten from “1” to “0”, when the value of the upper bit is “1”, the target threshold value Vth is V1 <Vth <V2, and the value of the upper bit is In the case of “0”, the target threshold value Vth <V3. Thus, in order to write to a specific bit, the write level must be designated after reading the value of the other bit sharing the memory cell. Therefore, rewriting a 1-bit value independently is a laborious operation.
しかも、V1<Vth<V2値を“01”の組合せを選択することも可能であるが、一般に市販のフラッシュメモリではこのようなメモリセルの状態と各ビットの値の関係は公開されていない。また、一般に多値のフラッシュメモリは外部端子から見た仕様は従来の単値のメモリと同じになるように作られているため、メモリカードを設計するメモリの使用者には組み合わせられているビットの関係を知ることができないため、より困難である。 Moreover, it is possible to select a combination of V01 <Vth <V2 values of “01”, but generally, in a commercially available flash memory, the relationship between the state of such a memory cell and the value of each bit is not disclosed. In general, multi-level flash memory is designed so that the specifications viewed from the external terminal are the same as the conventional single-level memory. Therefore, this bit is combined with the memory user who designs the memory card. It is more difficult because you cannot know the relationship.
このように、多値のフラッシュメモリを用いたフラッシュカードを使用する場合、旧のデータを更新して古いデータが書かれたブロックの新旧フラグを表す特定のビットに“0”のデータを書き込むことが困難になる。
フラッシュメモリを用いたメモリカードなどのようなファイルストレージデバイスの新旧データの管理方法について、データの更新時にはフラッシュメモリは消去されて未使用のブロックへ新しいデータを書き込み、旧のデータがかかれたブロックのスペア領域に設けられている新旧ビットの値を未書き込みの状態“1”から“0”の値に書き込むことで、新旧のデータの識別を行っている。 Regarding the management method of new and old data of file storage devices such as memory cards using flash memory, when updating data, the flash memory is erased and new data is written to unused blocks. The new and old data are identified by writing the value of the new and old bits provided in the spare area from the unwritten state “1” to the value “0”.
しかし、記憶媒体として多値のフラッシュメモリを使用する場合、一つのメモリセルに2ビットのアドレスを振り当てられていため、従来行っていたように既にデータが書き込まれたブロックの中の特定のビットにデータを書き込むことが容易ではなくなる。従来のように、旧のデータが書き込まれたブロック内の特定ビットが割り当てられた新旧フラグに旧のフラグをあらわす値を書き込む場合は、対をなす他方のビットの値を求め、その組合せとして得られたVthの値を狙って書き込む必要がある。 However, when a multi-level flash memory is used as a storage medium, since a 2-bit address is assigned to one memory cell, a specific bit in a block in which data has already been written as has been done conventionally. It is not easy to write data in When writing a value representing the old flag to a new and old flag to which a specific bit in a block in which old data is written is assigned as in the past, the value of the other bit in the pair is obtained and obtained as a combination thereof. It is necessary to write with the target Vth value.
従って、一度データが書き込まれたブロックに追加の書き込みを行うことなく、更新された新旧のデータの中から最も新しいデータを見つけ出す方法が求められている。 Accordingly, there is a need for a method of finding the newest data from the new and old data that has been updated without performing additional writing to the block in which the data has been written.
上記課題に対して本発明では、フラッシュメモリのブロックの一つに既に書き込まれたデータを更新する場合、新たに書き込まれた新のデータの物理アドレスが常に旧のデータが書き込まれた物理アドレスより昇順方向にあり、新旧データが書き込まれた物理アドレスの間には常に使用可能でかつ未使用のブロックが存在しないように書き込みを管理することで解決している。
すなわち、論理アドレスと該論理アドレスに関連づけられたデータを、物理アドレスに関連づけられたブロックに格納するフラッシュメモリの、前記データを新たなデータに変えて格納する更新を、前記データを格納するブロックの物理アドレスを求め、該物理アドレスの値を順次、昇順方向に増加して物理アドレスを生成し、順次、該生成された物理アドレスに関連づけられたブロックが使用可能で未使用のブロックか否かを検証し、該検証結果が使用可能で未使用のブロックであるとき、該ブロックに前記論理アドレスと、前記新たなデータを格納することによって行われる。
In the present invention, when the data already written in one of the blocks of the flash memory is updated, the physical address of the newly written new data is always higher than the physical address where the old data is written. The problem is solved by managing writing so that there is no unused block that is always available between the physical addresses where the old and new data are written in the ascending order.
That is, the update of the flash memory that stores the logical address and the data associated with the logical address in the block associated with the physical address is stored in the block that stores the data. A physical address is obtained, a physical address is generated by sequentially increasing the value of the physical address in the ascending order, and it is sequentially determined whether or not the block associated with the generated physical address is usable and unused. Verification is performed by storing the logical address and the new data in the block when the verification result is a usable and unused block.
このようにして更新されたデータは、所定の論理アドレスに関連づけられて格納されたデータの新旧を、使用可能で未使用のブロックの物理アドレスの中の最大値を求め、該最大値から順次、降順方向に減じて物理アドレスを生成し、順次、該生成された物理アドレスのブロックが格納する論理アドレスを検証し、検証した論理アドレスが前記所定の論理アドレスと一致したとき、該ブロックに格納されたデータが最新のデータと判断される。 The data updated in this way is used to determine the oldest and newest data stored in association with a predetermined logical address, obtain the maximum value among the physical addresses of usable and unused blocks, and sequentially from the maximum value, Decrease in the descending direction to generate a physical address, sequentially verify the logical address stored in the block of the generated physical address, and when the verified logical address matches the predetermined logical address, it is stored in the block Data is determined to be the latest data.
このようにフラッシュメモリにアクセスすることで、フラッシュメモリのブロックに新旧フラグを書き込むことなしに新旧の判断を行うことができる。 By accessing the flash memory in this way, it is possible to make a new / old determination without writing a new / old flag in the block of the flash memory.
さらに、データの更新では前記昇順方向に増加して生成した物理アドレスが、前記物理アドレスの最大値を超えたとき、該生成された物理アドレスを、0に置き換え、新旧の判断では、前記降順方向に減じて生成した物理アドレスが、負の値となったとき、該生成された物理アドレスを、前記物理アドレスの最大値に置き換えることで、最新のデータを保持するブロックが使用可能で未使用のブロックの物理アドレスの最大値より大きな物理アドレスを持っていた場合にも見つけ出すことができる。すなわち、物理アドレスの昇順方向で最大値の次を0の値に設定することによって、データの更新時の昇順方向、新旧の判断時の降順方向に物理アドレス値の生成する手順で、開始する物理アドレスの値にかかわらず全ての物理アドレスを生成することができる。従って全てのブロックについて検出することが可能になる。 Further, in the data update, when the generated physical address increases in the ascending order exceeds the maximum value of the physical address, the generated physical address is replaced with 0, and in the old and new judgment, the descending direction When the generated physical address becomes a negative value, the generated physical address is replaced with the maximum value of the physical address, so that the block holding the latest data can be used and unused. It can also be found when the physical address is larger than the maximum physical address of the block. That is, by setting the value next to the maximum value to 0 in the ascending order of the physical address, the physical address starting in the procedure of generating the physical address value in the ascending order at the time of data update and the descending order at the time of new / old judgment All physical addresses can be generated regardless of the address value. Therefore, it is possible to detect all blocks.
また、前記ブロックが格納する論理アドレスに関連づけられて格納されたデータの新旧の判断を、前記フラッシュメモリの始動し、前記フラッシュメモリが格納する情報を揮発性メモリで作成した管理テーブルに転送し、前記管理テーブルの情報を揮発性メモリで作成された判定テーブルを用いて最新データを格納する物理アドレスを判断し、前記判断結果を前記管理テーブルに新の表示を行うことで、始動された後の通常の動作時には、前記管理テーブルを参照することで速やかに最新データを保持するブロックを見つけ出すことが可能となる。 In addition, the new and old judgment of the data stored in association with the logical address stored in the block is started, the flash memory is started, the information stored in the flash memory is transferred to the management table created in the volatile memory, The management table information is determined using a determination table created in a volatile memory to determine a physical address for storing the latest data, and the determination result is newly displayed on the management table. During normal operation, it is possible to quickly find a block that holds the latest data by referring to the management table.
さらに、前記管理テーブルに前記新の表示に応じて、前記管理テーブル上の前記論理アドレスを保持する他の物理アドレスに旧の表示を行うことで、更新される前のデータが保持されたブロックの物理アドレスの全てに旧の表示を行うことができる。また、前記フラッシュメモリのデータの更新を繰り返すことで使用可能で未使用のブロックの数が減少し、所定の数より少なくなると旧のデータを保持したブロックのメモリセルを消去して未使用の状態にすることが必要になる。このときは、前記フラッシュメモリの消去動作が、前記管理テーブル上に旧の値を書き込まれたブロックを全て選択し、選択された全てのブロックを消去する。このように一括消去された後には更新される前の旧のデータを保持するブロックは存在しなくなる。従って、消去によって新たに使用可能で未使用のブロックが生じても、旧のブロックの全てがなくなっているので、前に述べた、新と旧のブロックの間には使用可能で未使用のブロックが存在しない、とういう条件を維持することができる。 Further, according to the new display in the management table, the old display is performed on the other physical address that holds the logical address on the management table, so that the data before the update is stored The old display can be made on all physical addresses. In addition, the number of usable and unused blocks is reduced by repeatedly updating the data in the flash memory. When the number of unused blocks decreases, the memory cells of the blocks holding the old data are erased and unused. It is necessary to make it. At this time, the erase operation of the flash memory selects all the blocks in which old values are written on the management table, and erases all the selected blocks. After such batch erasure, there is no block that holds old data before being updated. Therefore, even if a new usable and unused block is generated by erasing, all of the old blocks are lost, so the usable and unused blocks between the new and old blocks described above can be used. It is possible to maintain the condition that no exists.
本発明は、メモリカードに多値フラッシュメモリを用いたとき、更新されて旧になったブロックに旧を示すフラグを書き込むことなく新旧の判断を可能にする。 According to the present invention, when a multi-level flash memory is used for a memory card, it is possible to make a new / old determination without writing an old flag in an updated block.
新旧の判断は、カードの始動時にフラッシュメモリのスペア領域に保持された情報を揮発性メモリに生成された管理テーブルに転送し、この管理テーブル上で判断が行われるため余計な待ち時間を要しない。 The old and new judgment is made by transferring the information held in the spare area of the flash memory at the time of starting the card to the management table generated in the volatile memory and making the judgment on this management table, so that no extra waiting time is required. .
また、データの更新や読み出す際の最新のデータもこの管理テーブル上で判別できるため高速の動作が可能になる。
In addition, since the latest data when data is updated or read can be determined on the management table, high-speed operation is possible.
以下に、本発明におけるフラッシュメモリカードの新旧データを判別するために、メモリカードの構成を示し、データを更新する際にフラッシュメモリにデータを格納する方法、フラッシュメモリに格納されたデータの中から最新のデータを始動時に判定するための設定方法、ブロック消去の方法、および読み出し方法について述べる。 The following shows the configuration of a memory card for discriminating between old and new data of a flash memory card in the present invention, a method of storing data in the flash memory when updating data, and data stored in the flash memory A setting method, a block erasing method, and a reading method for determining the latest data at start-up will be described.
図1はフラッシュメモリを用いたメモリカードがホストに接続されたメモリカードシステムを示している。 FIG. 1 shows a memory card system in which a memory card using flash memory is connected to a host.
メモリカードシステム100はメモリカード101とホスト151とで構成されている。ホスト151はホストI/F152を備え、データバス153を介して論理アドレスと、データをメモリカードとの間で送受信する。
The
メモリカード101はフラッシュメモリ102とコントローラ103で構成され、データバス104を介して物理アドレスとデータをフラッシュメモリ102とコントローラ103との間で送受する。コントローラ103は、ホスト151との間でデータを交換するメモリカードI/F110、アドレスレジスタ111、データレジスタ112、管理テーブル113、新旧判定テーブル114、空きブロックカウンタ115、およびコントローラを制御するCPU116を備えている。
The
メモリカード101にデータを書き込む場合は、ホスト151から送られてきた論理アドレスと、データはそれぞれアドレスレジスタ111とデータレジスタ112に格納される。CPU116はアドレスレジスタ111に格納された論理アドレスを管理テーブル113で参照し、格納しようとするフラッシュメモリの物理アドレスを決定する。データレジスタ112に格納されたデータはフラッシュメモリの決定された物理アドレスのブロックにデータバス153を経由して書き込まれる。
When writing data to the
管理テーブル113は揮発性メモリで構成され、フラッシュメモリ102に書き込まれるデータの論理アドレスと物理アドレスの対応関係や、データが更新されているとき新旧の表示などの管理情報を保持している。また、新旧判定テーブル114は揮発性メモリで構成されている。
The management table 113 is composed of a volatile memory, and holds management information such as the correspondence between the logical address and the physical address of data written to the
フラッシュメモリ102は多値構造のセルが用いられている。そのため、前記のようにブロックに一度データを書き込んだ後には、再び同じブロックに新旧フラグに相当する特定のビットに書き込む動作は行っていない。そのため、フラッシュメモリのスペア領域のどこにもデータの新旧を表す記号は書かれていない。新旧の判断は以下で詳しく説明する。
The
管理テーブル113は、メモリカード101の始動時にフラッシュメモリ102が格納する情報を元に作成され、データの書き込み、消去動作に応じて内容が修正される。始動時に更新されたデータの新旧の判断は新旧判定テーブルを用いて行われる。
The management table 113 is created based on information stored in the
NAND型のフラッシュメモリ102は複数のブロックで構成され、さらに、各ブロックは複数のページで構成されている。読み出しと書き込み動作はページ単位で行われ、消去動作はブロックを単位に一括消去が行われる。それぞれのブロックには物理アドレスが付与れ、各ブロックのデータ領域にはデータと、論理アドレスなどのスペア情報が格納される。
The
図2は多値フラッシュメモリ102のデータ構造を示し、
ブロック121にはそれぞれに物理アドレス122が付与されている。データ領域123はメイン領域124とスペア領域125に分けられ、メイン領域124にホストから送られてくるデータを記憶する。スペア領域125には、論理アドレス126、およびエラー訂正情報などその他127の情報を記憶している。基本的構成は図8で示したデータ構造と同じであるが、新旧フラグに相当する領域はなく、それぞれのブロックを構成するメモリ領域は一度値を書き込まれた後は、データが更新された場合も再び書き込まれることはない。
FIG. 2 shows the data structure of the
Each
物理アドレスの“0”と“1”は予め用途が予約された予約ブロックであって、物理アドレス“0”のブロックのメイン領域には欠陥があるブロックのアドレスが書き込まれている。また、物理アドレス“1”のブロックのメイン領域にはブートデータが書き込まれていて、メモリカードの始動時に自動的に読み出される。 The physical addresses “0” and “1” are reserved blocks whose use has been reserved in advance, and the address of the defective block is written in the main area of the block of the physical address “0”. Further, boot data is written in the main area of the block having the physical address “1”, and is automatically read when the memory card is started.
物理アドレス“2”以降は一般に使用されるブロックで、昇順方向に数字が振り当てられ、図2の例では物理アドレス“9999”が最大値で、最終アドレスと定義する。メイン領域で(未使用)と書かれているブロックは、欠陥がなく予約もされていない使用可能で未使用のブロックであることを表している。 The physical address “2” and later are generally used blocks, and numbers are assigned in the ascending order. In the example of FIG. 2, the physical address “9999” is the maximum value and is defined as the final address. A block written as (unused) in the main area represents a usable and unused block that has no defect and is not reserved.
物理アドレス“2”、“3”のブロックは、一度所用された後に消去されることでランダムに発生する使用可能で未使用のブロックの例を示している。物理アドレス“7903”は欠陥があるブロックで使用することができない。物理アドレス“7900から7906”のブロックには、欠陥ブロックを除いて、論理アドレス“578”から“583”の値が論理アドレス領域126に書き込まれ、それぞれに関連するデータがメイン領域124に書き込まれている。
Blocks with physical addresses “2” and “3” are examples of usable and unused blocks that are randomly generated by being erased after being used once. The physical address “7903” cannot be used in a defective block. In the blocks of physical addresses “7900 to 7906”, except for defective blocks, the values of logical addresses “578” to “583” are written in the
物理アドレス“7907”にはその後に書き込まれた論理アドレス“810”のデータが書かれている。物理アドレス“7908”のブロックのデータの論理アドレスも“579”であって、物理アドレス“7901”のブロックと同じ値になっている。以下で説明する本発明の判断方法に従えば、物理アドレス“7908”のデータが最新のデータであることがわかる。 In the physical address “7907”, data of the logical address “810” written thereafter is written. The logical address of the data of the block with the physical address “7908” is also “579”, which is the same value as the block with the physical address “7901”. According to the determination method of the present invention described below, it can be seen that the data at the physical address “7908” is the latest data.
図2に示したように、同じ論理アドレスのデータが書き込まれた複数のブロックが存在するが、フラッシュメモリそのものにはどのブロックに最新のデータが書き込まれているかを示す情報は備えていない。 As shown in FIG. 2, there are a plurality of blocks in which data of the same logical address is written, but the flash memory itself does not have information indicating in which block the latest data is written.
次に、管理テーブル113の構成を図3に示す。管理テーブル113は、メモリカードの始動時にフラッシュメモリ102が保持する情報をもとに作成され、論理アドレスと物理アドレスの関係を保持し、動作中のデータの読み出し、書き込み、消去時のフラッシュメモリ102のアドレス情報を管理している。物理アドレス131の“0”から最終アドレス“9999”に対応した行があり、それぞれの行に、論理アドレス132、新旧フラグ133、欠陥フラグ134、および予約フラグ135の値が保持されている。図3では、図2に対応して表示されていて、物理アドレス“7901”の新旧フラグ133には“旧”の表示があり、物理アドレス“7908”には“新”の表示がなされている。この表示方法については、後で説明する。
Next, the configuration of the management table 113 is shown in FIG. The management table 113 is created based on information held in the
以下に、データの更新があったときのフラッシュメモリへの書き込む方法、更新された複数の同じ論理アドレスが異なる物理アドレスのブロックに保持されている場合、最新の更新されたデータがどのブロックに保持されているかを決定する方法について順に述べる。 The following shows how to write to the flash memory when data is updated. When multiple updated logical addresses are stored in different physical address blocks, the latest updated data is stored in which block. The method for determining whether or not it is done will be described in order.
<データの更新>先ず、メモリカードが始動されていて通常の動作状態にあるとき、ホスト151から、既にフラッシュメモリ102に書き込まれている論理アドレスを割り当てられたデータを更新する要求がなされた場合について説明する。ホスト151から更新するデータの論理アドレスと書き込みデータはホストI/F152、データバス153を経由してメモリカード101に送られ、メモリカードI/F110を経由してアドレスレジスタ111、およびデータレジスタ112に保存される。
<Updating data> First, when the memory card is started and in a normal operation state, the
フラッシュメモリ102に更新される新しいデータを書き込むために、管理テーブル113上から、更新する前までは最新のデータが書き込まれているブロックの物理アドレスを求める。そして、物理アドレスを昇順方向にたどって、最初に見つかった使用可能で未使用のブロックに新しいデータを書き込む。同時に、管理テーブルの値を書換えて、最新の状態に書換えてデータの更新を完了する。図2および図3の例では、物理アドレス“7901”には論理アドレス“579”の更新する前の最新のデータが格納されていて、物理アドレス“7901”の新旧フラグ133には”新“の表示がなされている。この段階では物理アドレス“7908”のブロックは未使用の状態で、ここに論理アドレス“579”の更新された最新のデータが書き込まれる。
In order to write new data to be updated in the
上記のデータの更新の手順を図4のフローチャートを用いて説明する。先ず、管理テーブル113上で、論理アドレス132の中から更新する論理アドレスの値を見つけ出す。論理アドレスに対応する物理アドレスが複数個ある場合、その中から新旧フラグ133が“新”になっている行の物理アドレス131を見つけ出し、Nの値をその物理アドレスに設定する(S111)。さらに、新旧フラグ133の値を“新”から“旧”に変更する(S112)。
The procedure for updating the data will be described with reference to the flowchart of FIG. First, a logical address value to be updated is found from the
次に、Nの値をN=N+1に昇順方向に置き換える(S113)。置き換えたNの値と最終ブロックの値を比較する(S114)。Nの値が最終ブロックの値より大きくなったときは、Nの値をN=0に置き換える(S115)。このステップは、物理アドレスを昇順方向に順次増加させたときの、最終ブロックの次を“0”と定義しているからである。 Next, the value of N is replaced with N = N + 1 in the ascending order (S113). The replaced N value is compared with the final block value (S114). When the value of N becomes larger than the value of the last block, the value of N is replaced with N = 0 (S115). This step is because “0” is defined next to the last block when the physical address is sequentially increased in the ascending order.
次に、管理テーブル113上で、物理アドレスがNのブロックが使用可能で未使用かどうかを検証する(S116)。該当しない場合は、再びステップS113にもどり、物理アドレスを昇順方向に使用可能で未使用のブロックが見つかるまでこれを繰り返す。 Next, it is verified on the management table 113 whether the block with the physical address N is usable and unused (S116). If not, the process returns again to step S113, and this is repeated until an unused block that can use the physical address in the ascending order is found.
ステップS116で使用可能で未使用のブロックに該当したとき、このブロックに更新する新しいデータを書き込む。すなわち、フラッシュメモリ102の物理アドレスがNのブロックの論理アドレス126にアドレスレジスタ111に保持されている論理アドレスを書き込み、データレジスタ112に保持されたデータをメイン領域124に書き込む(S117)。
When it corresponds to a usable and unused block in step S116, new data to be updated is written in this block. That is, the logical address held in the address register 111 is written into the
引き続いて管理テーブル113の物理アドレスがNの行の論理アドレス132にアドレスレジスタ111に保持されている論理アドレスを書き込み、さらに新旧フラグ133を“新”に変更する(S118)。
Subsequently, the logical address held in the address register 111 is written to the
次に空きブロックカウンタ115の値Mを1減じてM=M−1に置き換える(S119)。そして、置き換えられたMの値が指定されている最小値Mminと比較して(S120)大きいか等しい場合ステップS123に進んでデータの更新を完了する。 Next, the value M of the empty block counter 115 is decremented by 1 and replaced with M = M−1 (S119). If the replaced M value is greater than or equal to the designated minimum value Mmin (S120), the process proceeds to step S123 to complete the data update.
ステップS120でMの値が最小値Mminよりも小さくなったときは、管理テーブル113の新旧フラグ133に“旧”の表示がある物理アドレスのブロックを全て消去する(S121)。次いで、管理テーブル上の消去したブロックに該当する行の論理アドレス132、新旧フラグ133のデータを削除する(S122)。こうしてデータの更新を完了する(S123)。
When the value of M becomes smaller than the minimum value Mmin in step S120, all blocks of physical addresses having “old” displayed in the new /
メモリカード101がホスト151に接続された使用状態で引き続きデータを読み出す場合は更新された最新のデータは、管理テーブル113の上の新旧フラグ133に“新”の表示があるので正しく識別できる。しかし、一度メモリカード101の電源が一度切断されると、揮発性メモリで構成された管理テーブル113のデータは消滅する。従って、始動時にはフラッシュメモリ102が保持している情報をもとに管理テーブル113を作成する必要がある。以下に始動時に管理テーブルに管理情報を設定する方法について説明する。
When data is continuously read while the
<始動時の設定>メモリカード101をホスト151に接続するとコントローラ103が起動し、フラッシュメモリ102の予約ブロックから、ブートデータを読み出してCPU116にメモリカードの管理プログラムを与える。次にフラッシュメモリ102のそれぞれのブロックのスペアエリア125の情報を順次読み出し、管理テーブル113に転送する。
<Setting at Startup> When the
フラッシュメモリの予約ブロックのメイン領域124と、各ブロックのスペア領域125に書き込まれたデータを順番に読み出してコントローラに転送し、管理テーブルを作成する手順を図5に示すフローチャートを用いて説明する。
The procedure for sequentially reading out the data written in the
先ず、フラッシュメモリの物理アドレス“0”のブロックに書き込まれている欠陥アドレス情報を読み出して、管理テーブル113の対応する物理アドレスの行の欠陥フラグ134の列に欠陥表示を書き込む。引き続き、予約ブロックの予約フラグ134に予約の表示を行う。(S131)
次に、物理アドレスを指定するNの値をN=0に設定し(S132)、次いで、空きブロックカウンタ115の値Mをフラッシュメモリ102のブロックの数に設定する(S133)。次に、物理アドレスがNのブロックが、使用可能なブロックかどうかを判断する(S134)。ここで、使用可能なブロックとは、欠陥が無くかつ予約されていないブロックである。使用可能なブロックであれば、そのブロックが既に使用済みであるかどうかを判断する(S135)。既に使用済みであれば、割り当てられている論理アドレス126の値を管理テーブル113の論理アドレス132に保管する(S136)。この場合、空きブロックの数が1減少しているので、Mの値をM=M−1に置き換える(S137)。
First, the defect address information written in the block of the physical address “0” of the flash memory is read, and the defect indication is written in the column of the
Next, the value of N designating the physical address is set to N = 0 (S132), and then the value M of the free block counter 115 is set to the number of blocks in the flash memory 102 (S133). Next, it is determined whether or not the block whose physical address is N is a usable block (S134). Here, the usable block is a block which has no defect and is not reserved. If it is a usable block, it is determined whether the block is already used (S135). If already used, the value of the assigned
次に、Nの値が最終アドレスの値に等しいかどうかを判断する(S138)。等しくないときは、Nの値をN=N−1に置き換えて(S139)ステップS134に戻って、再び同じ判断を繰り返す。ステップS134で物理アドレスNのブロックが使用可能でない場合は、ステップS137に跳び、空きブロックの数Mを1減じる。 Next, it is determined whether the value of N is equal to the value of the final address (S138). If they are not equal, the value of N is replaced with N = N−1 (S139), the process returns to step S134, and the same determination is repeated again. If the block of the physical address N is not usable in step S134, the process jumps to step S137, and the number M of free blocks is reduced by one.
また、ステップS135で物理アドレスNのブロックが未使用の場合は、ステップS138に跳び、Nの値が最終アドレスと一致していないかどうかを判定する。 If the block at the physical address N is unused in step S135, the process jumps to step S138 to determine whether the value of N does not match the final address.
ステップS138でNの値が最終アドレスと一致すれば、全ての物理アドレスに対する調査が終わり、始動時にフラッシュメモリ102から管理情報を転送する管理テーブル113の作成が完了する(S140)。
If the value of N matches the final address in step S138, the investigation for all physical addresses is completed, and the creation of the management table 113 for transferring management information from the
次に、同一論理アドレスが指定された複数のブロックが存在したとき、どちらのブロックのデータが最新のデータであるかを判断する必要がある。以下に、管理テーブル113に読み出した情報を用いて、新旧フラグ133の列にフラグを立てる手順を図6のフローチャートを用いて説明する。
Next, when there are a plurality of blocks to which the same logical address is specified, it is necessary to determine which block data is the latest data. Hereinafter, a procedure for setting a flag in the column of the new and
本フローにおいては、揮発性メモリ上に設けた新旧判定テーブル114を用いる。新旧判定テーブル114は図7に示すように、論理アドレス141、最新物理ブロック142、および最新ブロック発見済みフラグ143から構成されていて、上記図5のフローチャートに従って作成された管理テーブル113を用いて作成し、論理アドレス141の昇順方向に並べておく。同じ論理アドレスが複数個ある場合は物理アドレス142は昇順方向に並べ、最初の状態では最新ブロック発見済みフラグ143は全て値が未入力にしておく。
In this flow, an old / new determination table 114 provided on a volatile memory is used. As shown in FIG. 7, the new / old determination table 114 includes a
先ず、図6の最初のステップS151でNの値をN=最終アドレスに設定する。通常の場合は、図5の管理テーブル作成手順に引き続いて行うのでNは最終アドレスに設定された状態で終了している。次に、管理テーブル113を参照して物理アドレスの値がNのブロックが使用可能でかつ未使用のブロックかどうかを判断する(S152)。いずれにも該当しない場合はNの値をN=N−1に置き換え(S153)、再びステップS152の判断を繰り返す。このようにして、物理アドレスの値Nを最大値から降順方向に1ずつ減じながら設定して点検し、使用可能で未使用の条件に最初に該当するブロックを見つけ出す。 First, in the first step S151 in FIG. 6, the value of N is set to N = final address. In a normal case, the process is performed subsequent to the management table creation procedure of FIG. 5, and thus N is completed with the final address set. Next, referring to the management table 113, it is determined whether or not the block whose physical address value is N is usable and unused (S152). If none of these apply, the value of N is replaced with N = N−1 (S153), and the determination in step S152 is repeated again. In this way, the value N of the physical address is set and inspected while decreasing by 1 in the descending order from the maximum value, and a block corresponding to the usable and unused condition is found first.
ステップS152で該当するブロックが見つかったとき、そのNの値をNstartとする(S154)。このようにして定めたNstartは、使用可能で未使用のブロックの中で最大の物理アドレスであって一意的に定めることができ、この物理アドレスを起点にして以下の手順に従って最新のデータが格納されたブロックを判断していく。 When the corresponding block is found in step S152, the value of N is set to Nstart (S154). The Nstart thus determined is the largest physical address among usable and unused blocks and can be uniquely determined. The latest data is stored in accordance with the following procedure starting from this physical address. Judge the block that was made.
メモリカードの使用開始時点では、このNstartは最終アドレスとは一致するが、データの更新と、ブロックの消去を繰り返すことで、最終アドレスまで使用され、未使用のブロックの物理アドレスの値が小さくなる状態が生じるが、上記の手順で求めることで対処することが可能となっている。 At the start of use of the memory card, this Nstart coincides with the final address. However, by repeating the data update and the block erasing, the Naddress is used up to the final address, and the physical address value of the unused block becomes small. Although a situation arises, it can be dealt with by obtaining the above procedure.
ステップS154に続いて、Nの値をN=N−1に降順方向に置き換える(S155)。そして置き換えたNの値が負かどうかを判定し(S156)、負になっていない場合、引き続きNの値とNstartとを比較し(S157)、等しくない場合、ステップS159で物理アドレスがNのブロックが使用可能でかつ論理アドレスが書き込まれているブロックかどうかを判断する。判定条件に一致しない場合は、ステップS155にもどる。使用可能で論理アドレスがある場合は、新旧判定テーブル114の論理アドレス141と新旧ブロック発見済みフラグ143を参照し、該当する論理アドレスの物理ブロックが既に見つかっているかどうかを判断する(S160)。その論理アドレスが発見済みではない場合、ステップS162に移り、管理テーブル113の新旧フラグ133に“新”の表示を行い、新旧判定テーブル114の最新ブロック発見済みフラグ143に“済み”を表示する。そして、再びステップS155にもどる。
Subsequent to step S154, the value of N is replaced in the descending order by N = N−1 (S155). Then, it is determined whether or not the replaced N value is negative (S156). If it is not negative, the N value is continuously compared with Nstart (S157). If not, the physical address is N in step S159. Determine if the block is usable and has a logical address written to it. If the determination condition is not met, the process returns to step S155. If the logical address is usable and there is a logical address, the
ステップS160で該当する論理アドレスが発見済みの場合、管理テーブル113の該当するブロックの新旧フラグ133を“旧”の表示に変更し、新旧判定テーブル114の最新ブロック発見済みフラグを済みに表示する。
If the corresponding logical address has been found in step S160, the new /
図7に示した新旧判定テーブル114の場合、論理アドレス“579”に対応する物理アドレスの新旧判断では、降順方向に物理アドレスをたどり、物理アドレス“7908”で論理アドレス“579”を始めて発見したので、管理テーブル113の新旧フラグ133に“新”の表示がされている。同時に新旧判定テーブル114の最新ブロック発見済みフラグには済みの表示がされる。従って、さらに物理アドレスの値を降順方向に減じて、“7901”になったときには、該当する論理アドレス“579”は既に発見済みになっているので、管理テーブル113の新旧フラグ133には”旧“の表示がされている。
In the case of the new / old determination table 114 shown in FIG. 7, in the new / old determination of the physical address corresponding to the logical address “579”, the physical address is traced in the descending order, and the logical address “579” is first discovered with the physical address “7908”. Therefore, “new” is displayed in the new /
ステップS155で降順方向にNの値を1ずつ減じる操作を繰り返していると、ついにはNが負の値が生成される。この場合、ステップS156の判定でステップS158へ進み、ここでNの値を最終アドレスの値に置き換える。そして引き続きステップS157へ進みフローに従った手順が繰り返される。 If the operation of decreasing the value of N by 1 in the descending order is repeated in step S155, finally a negative value of N is generated. In this case, the determination in step S156 proceeds to step S158, where the value of N is replaced with the value of the final address. Then, the process proceeds to step S157 and the procedure according to the flow is repeated.
そして、Nの値がN=Nstartになったとき、ステップS157で全ての物理アドレスの検証が終了したと判断し、管理テーブル113の新旧フラグ133への書き込みが完了する(S163)。
When the value of N becomes N = Nstart, it is determined in step S157 that all physical addresses have been verified, and writing to the new /
ステップS156でNが負の値になったときにNの値を最終アドレスの値に置き換えることで物理アドレスを連続して降順方向に順番に置き換えることができる。そして、ステップS157でN=Nstartと判定されたとき、全物理アドレスの降順方向の検証が行われたことが判る。 When N becomes a negative value in step S156, the physical address can be sequentially replaced in the descending order by replacing the value of N with the value of the final address. When it is determined in step S157 that N = Nstart, it is understood that all physical addresses have been verified in the descending order.
データ更新の項で説明したように、同じ論理アドレスのデータを保持しているブロックが複数個あった場合、更新された最新のデータの物理アドレスは必ず更新される前の物理アドレスから昇順方向にたどるブロックの中の最初の使用可能で未使用のブロックに書き込まれている。従って、データの更新が複数回繰り返して行われた場合も、最も旧のデータが保持されているブロックと最新のデータが保持されているブロックの間には使用可能で未使用のブロックは存在しないことがわかる。 As explained in the section on data update, if there are multiple blocks holding data of the same logical address, the physical address of the latest updated data is always in ascending order from the physical address before the update. It is written to the first available and unused block in the block to follow. Therefore, even when data is updated several times, there is no usable and unused block between the block holding the oldest data and the block holding the latest data. I understand that.
このような順番で新旧のデータが保持されているので、複数箇所に保持された論理アドレスの最新のデータは、使用可能で未使用のブロックから物理アドレスを降順方向にたどって最初に発見されたブロックに保持されていることがわかる。さらに、使用可能で未使用のブロックが多数、分散して存在する状態が存在する。このような場合、使用可能で未使用のブロックの中で物理アドレスが最大値を持ったブロックを起点にすることで、一意的に見つけ出すことができる。 Since the old and new data are held in this order, the latest data of the logical address held in multiple locations was first discovered by tracing the physical address in descending order from the available and unused block. It can be seen that it is held in the block. Furthermore, there exists a state in which many usable and unused blocks are distributed. In such a case, it is possible to uniquely find a block having a maximum physical address among usable and unused blocks as a starting point.
次に、ブロック消去について説明する。 Next, block erase will be described.
<ブロック消去>ステップS122で示したように空きブロックカウンタ115の値が規定値より少なくなった場合は、旧のデータが格納されたブロックの消去を行う。消去動作は管理テーブル113の新旧フラグ133の中で旧の表示がある全ての物理アドレスを指定し、フラッシュメモリ102が備えるブロック消去機能を利用し一括消去する。消去動作はデータの読み出しや、書き込みに比べて時間を要するので、必ずしもステップS122の時に限らず、メモリカードが待ちの状態にあるときを利用して行っても良い。
<Block Erase> When the value of the empty block counter 115 becomes smaller than the specified value as shown in step S122, the block in which the old data is stored is erased. In the erase operation, all the physical addresses having the old display are designated in the new and
この消去動作で注意を要するのは、管理テーブル113上の新旧フラグ133の中で“旧”の表示があるブロックを全て消去しなければならないという点である。なぜなら、フラッシュメモリのスペア領域には新旧フラグに相当する記録がないため、同じ論理アドレスの表示を持つ物理アドレスが複数存在するとき、データが保持されているブロックの物理アドレスの順序が厳しく限定されているからである。
What should be noted in this erasing operation is that all blocks with “old” displayed in the new /
すなわち、データの更新のところで述べたように、同じ論理アドレスのデータを記憶したブロックが複数存在する場合は、最新のデータが書き込まれたブロックと更新される前の旧のデータが書き込まれたブロックとの間には、使用可能で未使用のブロックが存在しないということを基本条件としている。消去動作で旧のブロックの一部が消去されずに残った場合、旧のデータを保持する物理ブロックと新のデータを保持するブロックの間にあった別の旧のデータを保持するブロックが消去され使用可能で未使用のブロックとなって、上記の前提条件が満たせなくなってしまうからである。 That is, as described in the data update, when there are a plurality of blocks storing data of the same logical address, the block in which the latest data is written and the block in which the old data before the update is written are written. The basic condition is that there are no usable and unused blocks. If a part of the old block remains unerased during the erase operation, another block that holds the old data between the physical block that holds the old data and the block that holds the new data is erased and used This is because the block becomes possible and unused, and the above preconditions cannot be satisfied.
<データの読み出し>次に、メモリカードからデータを読み出すときの手順について説明する。メモリカード101はホスト151からは読み出すデータの論理アドレスをインターフェース152を経由して受信し、アドレスレジスタ111に保持する。管理テーブル113の中から保存された論理アドレスと一致し、新旧フラグ133に新の表示のあるブロックの物理アドレス131を見つけ出す。そして、フラッシュメモリ102から対応するブロックのデータを読み出し、データレジスタ112に保持する。引き続きインターフェース110を経由してホスト151へ読み出したデータを送る。
<Reading Data> Next, the procedure for reading data from the memory card will be described. The
以上述べたように、本発明では、フラッシュメモリのデータの更新を旧のデータを保持するブロックから物理アドレスの昇順方向にある使用可能で未使用の最初のブロックに書き込むことに特徴がある。従って、最新のデータが使用可能で未使用のブロックの中で物理アドレスが最大のブロックを降順方向にたどり、最初に目的とする論理アドレスを保持するブロックが最新のデータを保持していることがわかる。 As described above, the present invention is characterized in that the update of the data in the flash memory is written from the block holding the old data to the first usable and unused block in the ascending order of the physical address. Therefore, the latest data can be used and the block with the largest physical address in the unused block is traced in the descending order, and the block that holds the target logical address first holds the latest data. Recognize.
なお、本発明の実施において、昇順方向と降順方向を置き換えて実施してもなんら問題がないことも明らかである。 It is obvious that there is no problem even if the ascending order and descending direction are replaced in the practice of the present invention.
フラッシュメモリを用いたメモリカードなどのファイルシステムでは、多値フラッシュメモリの利用が拡大している。しかし、多値フラッシュメモリは一度データを書き込まれたブロックの特定のビットに対してデータを追記することが困難である。本発明によれば、データの更新が繰り返されることで、同じ論理アドレスを持った複数のブロックの新旧判断を従来のように、旧になったブロックに追記することなく、容易に新旧を判断することができる。新旧の情報はメモリカードに記録されたデータの物理アドレスの順番によって判断されるので、電源の供給が無くても保持することができ、また物理アドレスの順番から新旧の判断はメモリカードが備えるコントローラによって自動的に行われる。 In a file system such as a memory card using a flash memory, the use of a multi-value flash memory is expanding. However, it is difficult for a multi-level flash memory to add data to a specific bit of a block in which data has been written once. According to the present invention, by repeatedly updating data, it is possible to easily determine whether a plurality of blocks having the same logical address are new or old without adding the old and new blocks to the old block as in the prior art. be able to. Since the old and new information is judged by the order of the physical addresses of the data recorded on the memory card, it can be held without power supply, and the old and new judgment can be made from the order of the physical addresses. Done automatically.
100 メモリカードシステム
101 メモリカード
102 フラッシュメモリ
103 コントローラ
104 データバス
110 メモリカードI/F
111 アドレスレジスタ113 管理テーブル
112 データレジスタ
113 管理テーブル
114 新旧判定テーブル
115 空きブロックカウンタ
116 CPU
151 ホスト
153 データバス
100
111 Address register 113 management table 112 data register 113 management table 114 old / new determination table 115
151
Claims (5)
前記データを格納するブロックの物理アドレスを求め、
該物理アドレスの値を順次、昇順方向に増加して物理アドレスを生成し、
順次、該生成された物理アドレスに関連づけられたブロックが使用可能で未使用のブロックか否かを検証し、
該検証結果が使用可能で未使用のブロックであるとき、該ブロックに前記論理アドレスと、前記新たなデータを格納することによって行い、
所定の論理アドレスに関連づけられて格納されたデータの新旧を、
使用可能で未使用のブロックの物理アドレスの中の最大値を求め、
該最大値から順次、降順方向に減じて物理アドレスを生成し、
順次、該生成された物理アドレスのブロックが格納する論理アドレスを検証し、
検証した論理アドレスが前記所定の論理アドレスと一致したとき、該ブロックに格納されたデータが最新のデータとすることによって判断することを特徴とするフラッシュメモリのアクセス方法。 Update of a flash memory that stores a logical address and data associated with the logical address in a block associated with a physical address, and stores the data instead of the new data.
Find the physical address of the block that stores the data,
Generate the physical address by sequentially increasing the value of the physical address in the ascending order direction,
Sequentially, verify whether the block associated with the generated physical address is a usable and unused block,
When the verification result is a usable and unused block, the logical address and the new data are stored in the block,
The old and new data stored in association with a given logical address
Find the maximum physical address of available and unused blocks,
A physical address is generated by sequentially subtracting from the maximum value in the descending order direction,
Sequentially, the logical address stored in the generated block of physical addresses is verified,
An access method for a flash memory, characterized in that, when a verified logical address matches the predetermined logical address, the data stored in the block is determined to be the latest data.
前記フラッシュメモリの始動し、
前記フラッシュメモリが格納する情報を揮発性メモリで作成した管理テーブルに転送し、
前記管理テーブルの情報を揮発性メモリで作成された判定テーブルを用いて最新データを格納する物理アドレスを判断し、
前記判断結果を前記管理テーブルに新の表示を行うことを特徴とする請求項1乃至3のいずれかに記載のフラッシュメモリのアクセス方法。 New or old judgment of data stored in association with the logical address stored in the block,
Starting the flash memory;
Transfer the information stored in the flash memory to a management table created in volatile memory,
Determine the physical address for storing the latest data using the determination table created in the volatile memory for the information in the management table,
4. The flash memory access method according to claim 1, wherein the determination result is newly displayed in the management table.
前記管理テーブル上の前記論理アドレスを保持する他の物理アドレスに旧の表示を行い、
前記フラッシュメモリの消去動作が、前記管理テーブル上に旧の値を書き込まれたブロックを全て選択し、
選択された全てのブロックを消去することを特徴とする請求項1乃至4のいずれかに記載のフラッシュメモリのアクセス方法。
According to the new display in the management table,
Perform the old display on the other physical address holding the logical address on the management table,
The erase operation of the flash memory selects all blocks in which old values are written on the management table,
5. The flash memory access method according to claim 1, wherein all the selected blocks are erased.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004232153A JP2006048585A (en) | 2004-08-09 | 2004-08-09 | Flash memory access method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004232153A JP2006048585A (en) | 2004-08-09 | 2004-08-09 | Flash memory access method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006048585A true JP2006048585A (en) | 2006-02-16 |
Family
ID=36027033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004232153A Withdrawn JP2006048585A (en) | 2004-08-09 | 2004-08-09 | Flash memory access method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006048585A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008159013A (en) * | 2006-11-28 | 2008-07-10 | Hitachi Ltd | Semiconductor memory device |
US7685356B2 (en) | 2006-05-30 | 2010-03-23 | Tdk Corporation | Chronological identification in flash memory using cyclic numbers |
JP2010198592A (en) * | 2009-01-29 | 2010-09-09 | Nec Corp | Mobile terminal apparatus, software update method, operation control method, and program |
CN102880562A (en) * | 2011-05-20 | 2013-01-16 | 株式会社东海理化电机制作所 | Flash memory device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1091490A (en) * | 1996-09-12 | 1998-04-10 | Sanyo Electric Co Ltd | Storage device using flash memory |
JPH11272444A (en) * | 1998-03-25 | 1999-10-08 | Sony Corp | Device and method for writing data in nonvolatile memory |
JPH11511879A (en) * | 1995-09-27 | 1999-10-12 | メモリー・コーポレーシヨン・ピー・エル・シー | Memory system |
WO2003030180A1 (en) * | 2001-09-28 | 2003-04-10 | M-Systems Flash Disk Pioneers Ltd. | Flash management system using only sequential write |
JP2003208352A (en) * | 2002-01-17 | 2003-07-25 | Fujitsu Ltd | Flash memory with limited number of writes and wear leveling |
-
2004
- 2004-08-09 JP JP2004232153A patent/JP2006048585A/en not_active Withdrawn
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11511879A (en) * | 1995-09-27 | 1999-10-12 | メモリー・コーポレーシヨン・ピー・エル・シー | Memory system |
JPH1091490A (en) * | 1996-09-12 | 1998-04-10 | Sanyo Electric Co Ltd | Storage device using flash memory |
JPH11272444A (en) * | 1998-03-25 | 1999-10-08 | Sony Corp | Device and method for writing data in nonvolatile memory |
WO2003030180A1 (en) * | 2001-09-28 | 2003-04-10 | M-Systems Flash Disk Pioneers Ltd. | Flash management system using only sequential write |
JP2003208352A (en) * | 2002-01-17 | 2003-07-25 | Fujitsu Ltd | Flash memory with limited number of writes and wear leveling |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7685356B2 (en) | 2006-05-30 | 2010-03-23 | Tdk Corporation | Chronological identification in flash memory using cyclic numbers |
JP2008159013A (en) * | 2006-11-28 | 2008-07-10 | Hitachi Ltd | Semiconductor memory device |
JP2010198592A (en) * | 2009-01-29 | 2010-09-09 | Nec Corp | Mobile terminal apparatus, software update method, operation control method, and program |
CN102880562A (en) * | 2011-05-20 | 2013-01-16 | 株式会社东海理化电机制作所 | Flash memory device |
US9021184B2 (en) | 2011-05-20 | 2015-04-28 | Kabushiki Kaisha Tokai Rika Denki Seisakusho | Flash memory device |
CN102880562B (en) * | 2011-05-20 | 2015-08-05 | 株式会社东海理化电机制作所 | Flash memory device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105701021B (en) | Data storage device and data writing method thereof | |
CN103425588B (en) | Block management method of data storage device and flash memory | |
US9645895B2 (en) | Data storage device and flash memory control method | |
US9019770B2 (en) | Data reading method, and control circuit, memory module and memory storage apparatus and memory module using the same | |
JP2008009919A (en) | Card controller | |
CN103577342B (en) | Method for managing data stored in flash memory and related memory device and controller | |
US20140082259A1 (en) | Data storing method, memory controller and memory storage apparatus | |
KR101731408B1 (en) | Method for writing data into flash memory and associated memory device and flash memory | |
CN107015886A (en) | The method and operation for operating storage device include the method for its data handling system | |
US9563508B2 (en) | Memory management method, memory control circuit unit and memory storage apparatus | |
US20140068383A1 (en) | Method of storing system data, and memory controller and memory storage apparatus using the same | |
CN106598479A (en) | Method and device for fail-safe erase of flash memory | |
US9009442B2 (en) | Data writing method, memory controller and memory storage apparatus | |
JP2005190288A (en) | Memory controller, flash memory system therewith, and method for controlling flash memory | |
US9383929B2 (en) | Data storing method and memory controller and memory storage device using the same | |
CN106445401B (en) | Table updating method, memory storage device, and memory control circuit unit | |
JP4158526B2 (en) | Memory card and data writing method to memory | |
JP4153535B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
CN104102598B (en) | Data reading method, control circuit, memory module and memory storage device | |
JP2006048585A (en) | Flash memory access method | |
CN103984635A (en) | Data writing method, memory controller and memory storage device | |
US9021184B2 (en) | Flash memory device | |
US7500081B2 (en) | Power-up implementation for block-alterable memory with zero-second erase time | |
US20090300272A1 (en) | Method for increasing reliability of data accessing for a multi-level cell type non-volatile memory | |
CN103425586B (en) | Storage unit management method, memory controller and memory storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070720 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20080731 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100921 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100928 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101119 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20101203 |