JP4702387B2 - MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD - Google Patents

MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Download PDF

Info

Publication number
JP4702387B2
JP4702387B2 JP2008090948A JP2008090948A JP4702387B2 JP 4702387 B2 JP4702387 B2 JP 4702387B2 JP 2008090948 A JP2008090948 A JP 2008090948A JP 2008090948 A JP2008090948 A JP 2008090948A JP 4702387 B2 JP4702387 B2 JP 4702387B2
Authority
JP
Japan
Prior art keywords
block
physical
defective
reservation
blocks
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.)
Active
Application number
JP2008090948A
Other languages
Japanese (ja)
Other versions
JP2009245163A (en
Inventor
直樹 向田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TDK Corp
Original Assignee
TDK 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 TDK Corp filed Critical TDK Corp
Priority to JP2008090948A priority Critical patent/JP4702387B2/en
Publication of JP2009245163A publication Critical patent/JP2009245163A/en
Application granted granted Critical
Publication of JP4702387B2 publication Critical patent/JP4702387B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)

Description

本発明は、メモリコントローラ、メモリコントローラを備えるフラッシュメモリシステム、並びにフラッシュメモリの制御方法に関する。   The present invention relates to a memory controller, a flash memory system including the memory controller, and a flash memory control method.

フラッシュメモリを記憶媒体として用いた記憶装置では、特許文献1に記載されているように、ホストシステムから与えられるユーザーデータの他に、アドレス変換テーブルのような、記憶データを管理するための情報が、フラッシュメモリに書き込まれる。従って、このような管理情報を保存するための領域が、フラッシュメモリ内に確保される。   In a storage device using a flash memory as a storage medium, as described in Patent Document 1, in addition to user data provided from a host system, information for managing storage data such as an address conversion table is provided. , Written to flash memory. Therefore, an area for storing such management information is secured in the flash memory.

また、フラッシュメモリを記憶媒体として用いた記憶装置では、特許文献2や特許文献3に記載されているように、アクセス効率を向上させるため、異なるフラッシュメモリに属する物理ブロックを複数個集めた物理ブロック群(グループ)を構成し、同一の物理ブロック群に属する物理ブロックに対して並行して、又はインターリーブ方式でアクセスする場合がある。   Further, in a storage device using a flash memory as a storage medium, as described in Patent Document 2 and Patent Document 3, a physical block in which a plurality of physical blocks belonging to different flash memories are collected in order to improve access efficiency. There are cases where a group is formed and physical blocks belonging to the same physical block group are accessed in parallel or in an interleaved manner.

特開2001−142774号公報JP 2001-142774 A 特開2000−132982号公報JP 2000-132982 A 国際公開第2002/046929号パンフレットInternational Publication No. 2002/046929 Pamphlet

フラッシュメモリを記憶媒体として用いたフラッシュメモリシステムでは、管理情報の書き込み先の領域を、フラッシュメモリ内に適宜設定することができる。従って、管理情報の書き込み先の物理ブロックを固定せずに、任意の物理ブロックを管理情報の書き込み先として使用したり、ユーザーデータの書き込み先として使用したりするようにしてもよい。しかしながら、このように管理情報の書き込み先の物理ブロックを固定しなかった場合、管理情報の書き込み先の物理ブロックの管理が煩雑になる。   In a flash memory system using a flash memory as a storage medium, a management information write destination area can be appropriately set in the flash memory. Therefore, an arbitrary physical block may be used as a management information write destination or a user data write destination without fixing the management information write destination physical block. However, if the physical block to which the management information is written is not fixed in this way, management of the physical block to which the management information is written becomes complicated.

また、異なるフラッシュメモリに属する物理ブロックを複数個集めた物理ブロック群を構成する場合、同じ物理ブロック群に含まれる物理ブロックのアドレスが同一であることが好ましい。しかしながら、異なるフラッシュメモリに属するアドレスが同一の物理ブロックで物理ブロック群を構成するようにした場合、不良ブロックが含まれる物理ブロック群ついては、ユーザーデータの書き込み先として使用することができなくなる。   When configuring a physical block group in which a plurality of physical blocks belonging to different flash memories are collected, it is preferable that the addresses of the physical blocks included in the same physical block group are the same. However, when a physical block group is configured with physical blocks having the same address belonging to different flash memories, a physical block group including a defective block cannot be used as a user data write destination.

上記のような問題点は、管理情報に代えて又は加えて、他種のシステムデータ(例えば、複数個のフラッシュメモリに対するアクセスを制御するためのファームウェア)を物理ブロックに書き込む場合にも有り得る問題点である。   The above-mentioned problems may occur when other types of system data (for example, firmware for controlling access to a plurality of flash memories) are written in a physical block instead of or in addition to management information. It is.

そこで、本発明は、システムデータの書き込み先の物理ブロックの管理を容易にし、且つ、不良ブロックが含まれる物理ブロック群内の良品ブロックを有効に使用できる記憶領域管理技術を提供することを目的とする。   Therefore, an object of the present invention is to provide a storage area management technique that facilitates management of a physical block to which system data is written and that can effectively use a good block in a physical block group including a defective block. To do.

本発明の第一の観点に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
複数個の前記フラッシュメモリ内の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータの書き込み先として使用するシステムブロックとして予約する予約手段と、
前記予約手段によって予約された前記システムブロックに対して前記システムデータを書き込むシステムデータ書き込み手段と、
前記アクセス指示で指定されるアドレスが割り当てられているセクタ単位の領域が複数個含まれる論理ブロックと、異なる前記フラッシュメモリに含まれるアドレスが同一の物理ブロックを複数個集めた物理ブロック群との対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック群に、前記アクセス指示と共に与えられるデータを書き込むデータ書き込み手段と
を備える。前記予約手段は、不良ブロックが含まれる前記物理ブロック群内の良品ブロックを、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックよりも優先的に前記システムブロックとして予約する。
A memory controller according to a first aspect of the present invention is a memory controller that controls access to a plurality of flash memories to be erased in physical block units in accordance with an access instruction given from a host system,
Reserving means for reserving physical blocks in the plurality of flash memories as system blocks used as system data write destinations for controlling or managing access to the plurality of flash memories;
System data writing means for writing the system data to the system block reserved by the reservation means;
Correspondence between a logical block including a plurality of sector unit areas to which an address specified by the access instruction is allocated and a physical block group including a plurality of physical blocks having the same address included in different flash memories A block management means for managing the relationship;
Data writing means for writing data given together with the access instruction to the physical block group corresponding to the logical block to which the logical access area designated as the access target area by the access instruction belongs. The reservation means reserves a non-defective block in the physical block group including a defective block as the system block preferentially over a physical block in the physical block group not including a defective block.

好適な実施形態では、前記予約手段は、新たな不良ブロックが検出された場合に、前記新たな不良ブロックが含まれる前記物理ブロック群内の良品ブロックを、前記システムブロックとして追加予約する。   In a preferred embodiment, when the new defective block is detected, the reservation unit additionally reserves a non-defective block in the physical block group including the new defective block as the system block.

好適な実施形態では、メモリコントローラが、前記システムブロックの予約を解除する予約解除手段を更に備える。前記予約解除手段は、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックに対する前記システムブロックの予約を、不良ブロックが含まれる前記物理ブロック群内の良品ブロックに対する前記システムブロックの予約よりも優先的に解除する。   In a preferred embodiment, the memory controller further comprises reservation cancellation means for canceling the reservation of the system block. The reservation canceling means reserves the system block for a physical block in the physical block group that does not include a defective block, and reserves the system block for a non-defective block in the physical block group that includes a defective block. Cancel with priority.

好適な実施形態では、前記予約手段は、前記物理ブロック群単位で前記システムブロックの予約を行う。前記予約解除手段は、前記物理ブロック群単位で前記システムブロックの予約を解除する。   In a preferred embodiment, the reservation unit reserves the system block in units of the physical block group. The reservation canceling unit cancels the reservation of the system block in units of the physical block group.

本発明の第二の観点に従うフラッシュメモリシステムは、前記第一の観点に従うメモリコントローラ(又は、前述した複数の好適な実施形態のうちのいずれかでのメモリコントローラ)と、前記メモリコントローラによってアクセスされる複数個のフラッシュメモリとを備える。   A flash memory system according to a second aspect of the present invention is accessed by a memory controller according to the first aspect (or a memory controller in any of the preferred embodiments described above) and the memory controller. A plurality of flash memories.

本発明の第三の観点に従う制御方法は、ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリの制御方法であって、
複数個の前記フラッシュメモリ内の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータの書き込み先として使用するシステムブロックとして予約する予約ステップと、
前記予約ステップによって予約された前記システムブロックに対して前記システムデータを書き込むシステムデータ書き込みステップと、
前記アクセス指示で指定されるアドレスが割り当てられているセクタ単位の領域が複数個含まれる論理ブロックと、異なる前記フラッシュメモリに含まれるアドレスが同一の物理ブロックを複数個集めた物理ブロック群との対応関係を管理するブロック管理ステップと、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック群に、前記アクセス指示と共に与えられるデータを書き込むデータ書き込みステップと
を備える。前記予約ステップでは、不良ブロックが含まれる前記物理ブロック群内の良品ブロックが、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックよりも優先的に前記システムブロックとして予約される。
A control method according to a third aspect of the present invention is a method for controlling a plurality of flash memories that are erased in units of physical blocks in accordance with an access instruction given from a host system,
Reserving step of reserving a physical block in a plurality of flash memories as a system block to be used as a system data write destination for controlling or managing access to the plurality of flash memories;
A system data writing step of writing the system data to the system block reserved by the reservation step;
Correspondence between a logical block including a plurality of sector unit areas to which an address specified by the access instruction is allocated and a physical block group including a plurality of physical blocks having the same address included in different flash memories A block management step to manage the relationship;
A data writing step of writing data given together with the access instruction to the physical block group corresponding to the logical block to which the logical access area designated as the access target area by the access instruction belongs. In the reservation step, a non-defective block in the physical block group including a defective block is reserved as the system block preferentially over a physical block in the physical block group including no defective block.

好適な実施形態では、前記システムブロックの予約を解除する予約解除ステップが更に備えられる。前記予約解除ステップでは、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックに対する前記システムブロックの予約が、不良ブロックが含まれる前記物理ブロック群内の物理ブロックに対する前記システムブロックの予約よりも優先的に解除される。   In a preferred embodiment, a reservation canceling step for canceling the reservation of the system block is further provided. In the reservation canceling step, the reservation of the system block for the physical block in the physical block group not including the defective block is more than the reservation of the system block for the physical block in the physical block group including the defective block. It is released with priority.

システムデータの書き込み先の物理ブロックの管理を容易にし、且つ、不良ブロックが含まれる物理ブロック群内の良品ブロックを有効に使用できる。   Management of the physical block to which the system data is written can be facilitated, and a good block in the physical block group including the defective block can be used effectively.

図1は、本発明の一実施形態に係るフラッシュメモリシステム1を概略的に示すブロック図である。   FIG. 1 is a block diagram schematically showing a flash memory system 1 according to an embodiment of the present invention.

図1に示すように、フラッシュメモリシステム1は、2個のフラッシュメモリ2A,2Bと、それを制御するメモリコントローラ3とで構成されている。フラッシュメモリの個数は、2個より多くても良い(例えば、好ましくは2個(mは自然数))。また、以下の説明では、2個のフラッシュメモリ2A、2Bを総称して「フラッシュメモリ2」と言うことがある。 As shown in FIG. 1, the flash memory system 1 is composed of two flash memories 2A and 2B and a memory controller 3 for controlling the flash memories 2A and 2B. The number of flash memories may be greater than two (for example, preferably 2 m (m is a natural number)). In the following description, the two flash memories 2A and 2B may be collectively referred to as “flash memory 2”.

フラッシュメモリシステム1は、外部バス13を介してホストシステム4と接続されている。ホストシステム4は、ホストシステム4の全体の動作を制御するためのCPU(Central Processing Unit)、フラッシュメモリシステム1との情報の授受を担うコンパニオンチップ等から構成されている。ホストシステム4は、例えば、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置であってもよい。   The flash memory system 1 is connected to the host system 4 via the external bus 13. The host system 4 is composed of a CPU (Central Processing Unit) for controlling the entire operation of the host system 4, a companion chip for transferring information to and from the flash memory system 1, and the like. The host system 4 may be various information processing apparatuses such as a personal computer and a digital still camera that process various types of information such as characters, sounds, and image information.

メモリコントローラ3は、図1に示すように、マイクロプロセッサ6と、ホストインターフェースブロック7と、SRAM8と、バッファ9と、フラッシュメモリインターフェースブロック10と、ECC(Error-correcting code)ブロック11と、ROM(Read Only Memory)12とから構成される。メモリコントローラ3は、内部バス14を介してフラッシュメモリ2と接続されている。これら機能ブロックによって構成されるメモリコントローラ3は、一つの半導体チップ上に集積される。以下、各機能ブロックについて説明する。   As shown in FIG. 1, the memory controller 3 includes a microprocessor 6, a host interface block 7, an SRAM 8, a buffer 9, a flash memory interface block 10, an ECC (Error-correcting code) block 11, and a ROM ( Read Only Memory) 12. The memory controller 3 is connected to the flash memory 2 via the internal bus 14. The memory controller 3 constituted by these functional blocks is integrated on one semiconductor chip. Hereinafter, each functional block will be described.

ホストインターフェースブロック7は、ホストシステム4との間でデータ、アドレス情報、ステータス情報、外部コマンド等の授受を行なう。外部コマンドとは、ホストシステム4がフラッシュメモリシステム1に対して処理の実行を指示するためのコマンドである。ホストシステム4よりフラッシュメモリシステム1に供給されるデータ等は、ホストインターフェースブロック7を入口としてフラッシュメモリシステム1の内部(例えば、バッファ9)に取り込まれる。また、フラッシュメモリシステム1からホストシステム4に供給されるデータ等は、ホストインターフェースブロック7を出口としてホストシステム4に供給される。   The host interface block 7 exchanges data, address information, status information, external commands and the like with the host system 4. The external command is a command for the host system 4 to instruct the flash memory system 1 to execute processing. Data or the like supplied from the host system 4 to the flash memory system 1 is taken into the flash memory system 1 (for example, the buffer 9) using the host interface block 7 as an entrance. Data supplied from the flash memory system 1 to the host system 4 is supplied to the host system 4 through the host interface block 7 as an exit.

SRAM(Static Random Access Memory)8は、揮発性の記憶素子であり、フラッシュメモリ2の制御に必要なデータを一時的に格納するためのワーク領域として使用される。ワーク領域には、例えば、不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルが記憶される。本実施形態においてフラッシュメモリ2に書き込まれるシステムデータ(フラッシュメモリ2に対するアクセスを制御又は管理するためのシステムデータであり、管理情報及びファームウェア等のデータが含まれる)は、これら3種類のテーブルである。ここで、不良ブロックテーブルは、不良ブロックを示す情報を保持するテーブルである。アドレス変換テーブルは、論理ブロックと物理ブロックとの対応関係を示したテーブルである。空きブロックテーブルは、消去状態の物理ブロック(又は、有効なデータが書き込まれていない物理ブロック)を検索するためのテーブルである。なお、SRAM8には、ワーク領域に加えて、ファームウェアを格納するためのファームウェア領域が設けられても良い。   An SRAM (Static Random Access Memory) 8 is a volatile storage element, and is used as a work area for temporarily storing data necessary for controlling the flash memory 2. In the work area, for example, a defective block table, an address conversion table, and an empty block table are stored. In this embodiment, the system data written to the flash memory 2 (system data for controlling or managing access to the flash memory 2 and including data such as management information and firmware) is these three types of tables. . Here, the bad block table is a table that holds information indicating a bad block. The address conversion table is a table showing the correspondence between logical blocks and physical blocks. The empty block table is a table for searching for an erased physical block (or a physical block to which valid data is not written). The SRAM 8 may be provided with a firmware area for storing firmware in addition to the work area.

ROM12は、不揮発性の記憶素子である。ROM12には、フラッシュメモリ2の制御に必要なファームウェアが書き込まれている。なお、ROM12には、起動時に必要な最低限のファームウェア(以下、「起動用ファームウェア」と言う)だけが書き込まれていても良い。この場合、フラッシュメモリ2の制御に必要なファームウェアは、フラッシュメモリ2に書き込まれ、起動時に、メモリコントローラ3が起動用ファームウェアに基づいて動作することによって、フラッシュメモリ2から読み出され、SRAM8に設けられているファームウェア領域に格納される。   The ROM 12 is a nonvolatile storage element. Firmware required for controlling the flash memory 2 is written in the ROM 12. It should be noted that only the minimum firmware necessary for starting up (hereinafter referred to as “startup firmware”) may be written in the ROM 12. In this case, the firmware necessary for controlling the flash memory 2 is written into the flash memory 2, and is read from the flash memory 2 when the memory controller 3 operates based on the startup firmware at startup, and is provided in the SRAM 8. Stored in the firmware area.

バッファ9は、ホストシステム4から与えられたデータやフラッシュメモリ2から読み出されたデータを一時的に保持する。例えば、フラッシュメモリ2に書き込まれるデータは、フラッシュメモリ2が書き込み可能な状態になるまでバッファ9に保持される。また、フラッシュメモリ2から読み出されたデータは、ホストシステム4が受け取り可能な状態になるまでバッファ9に保持される。   The buffer 9 temporarily holds data given from the host system 4 or data read from the flash memory 2. For example, data written to the flash memory 2 is held in the buffer 9 until the flash memory 2 is in a writable state. The data read from the flash memory 2 is held in the buffer 9 until the host system 4 can receive the data.

フラッシュメモリインターフェースブロック10は、ROM12(又はSRAM8上のファームウェア領域)からシーケンスコードを読み込み、読込んだシーケンスコードに従って、フラッシュメモリ2に対する各種の処理を実行する。シーケンスコードは、フラッシュメモリインターフェースブロック10に読み込まれるファームウェアである。このシーケンスコードは、フラッシュメモリインターフェースブロック10が実行するシーケンス処理毎に設定された複数個のコードから成るコードセットを複数セット含んでいる。このシーケンスコードに基づいて実行される処理では、フラッシュメモリインターフェースブロック10とフラッシュメモリ2との間で、データ、アドレス情報、ステータス情報、内部コマンド等の授受が、内部バス14を介して行なわれる。ここで、内部コマンドとは、メモリコントローラ3がフラッシュメモリ2に処理の実行を指示するためのコマンドであり、フラッシュメモリ2は、メモリコントローラ3から与えられる内部コマンドに従って動作する。   The flash memory interface block 10 reads a sequence code from the ROM 12 (or firmware area on the SRAM 8), and executes various processes for the flash memory 2 in accordance with the read sequence code. The sequence code is firmware that is read into the flash memory interface block 10. The sequence code includes a plurality of code sets including a plurality of codes set for each sequence process executed by the flash memory interface block 10. In processing executed based on this sequence code, data, address information, status information, internal commands, etc. are exchanged between the flash memory interface block 10 and the flash memory 2 via the internal bus 14. Here, the internal command is a command for the memory controller 3 to instruct the flash memory 2 to execute processing, and the flash memory 2 operates in accordance with the internal command given from the memory controller 3.

ECCブロック11は、フラッシュメモリ2に書き込むデータに付加される誤り訂正符号(ECC:Error-correcting code))を生成するとともに、読み出したデータに付加されている誤り訂正符号に基づいて、読み出したデータに含まれる誤りを検出・訂正する。   The ECC block 11 generates an error correction code (ECC) added to the data to be written to the flash memory 2 and reads the read data based on the error correction code added to the read data. Detect and correct errors contained in.

マイクロプロセッサ6は、ROM12(又はSRAM8上のファームウェア領域)から読み込んだプログラムコードに従って、メモリコントローラ3の全体の動作を制御する。プログラムコードとは、マイクロプロセッサ6に読み込まれるファームウェアである。例えば、マイクロプロセッサ6は、読込んだプログラムコードに基づいて、ホストシステム4から与えられるアクセス指示によって特定されるアクセス対象の領域が属する論理ブロック及びこの論理ブロックと対応する物理ブロックを求めたり、データの書き込み先となる空きブロックを検索したりする。   The microprocessor 6 controls the overall operation of the memory controller 3 in accordance with the program code read from the ROM 12 (or the firmware area on the SRAM 8). The program code is firmware that is read into the microprocessor 6. For example, the microprocessor 6 obtains a logical block to which an access target area specified by an access instruction given from the host system 4 belongs and a physical block corresponding to the logical block based on the read program code, Or search for a free block to write to.

フラッシュメモリ2A,2Bは、それぞれ、NAND型フラッシュメモリからなる。NAND型フラッシュメモリは、レジスタと、複数のメモリセルが2次元的に配列されたメモリセルアレイを備えている。メモリセルアレイは、複数のメモリセル群と、ワード線とを備える。ここで、メモリセル群は、複数のメモリセルが直列に接続されたものである。各ワード線は、メモリセル群の特定のメモリセルを選択するためのものである。このワード線を介して選択されたメモリセルとレジスタとの間で、レジスタから選択されたメモリセルへのデータの書き込み又は選択されたメモリセルからレジスタへのデータの読み出しが行われる。各フラッシュメモリ2A,2Bは、レジスタからメモリセルへのデータの書き込み、メモリセルからレジスタへのデータの読み出し又はメモリセルに記憶されているデータの消去が行われている間、内部コマンド等の入力を受け付けないビジー状態となる。   Each of the flash memories 2A and 2B is a NAND flash memory. The NAND flash memory includes a register and a memory cell array in which a plurality of memory cells are two-dimensionally arranged. The memory cell array includes a plurality of memory cell groups and word lines. Here, the memory cell group is a group in which a plurality of memory cells are connected in series. Each word line is for selecting a specific memory cell in the memory cell group. Data is written from the register to the selected memory cell or data is read from the selected memory cell to the register between the selected memory cell and the register via the word line. Each flash memory 2A, 2B inputs an internal command or the like while data is written from the register to the memory cell, data is read from the memory cell to the register, or data stored in the memory cell is being erased. Is in a busy state.

NAND型フラッシュメモリでは、データの読み出し及び書き込みはページ(物理ページ)単位で行われ、データの消去はブロック(物理ブロック)単位で行われる。物理ブロックは、複数のページ(物理ページ)で構成される。例えば、1個の物理ページは、所定サイズ(例えば2048バイト)のユーザ領域と、所定サイズ(例えば64バイト)の冗長領域とで構成され、1個の物理ブロックは、所定個数(例えば64個)の物理ページで構成されている。1個の物理ページのユーザ領域は、所定個数(例えば4個)の物理セクタ領域で構成されている。冗長領域は、誤り訂正符号(ECC:Error-correcting code))、論理アドレス情報、ブロックステータス(フラグ)等の付加データが記憶される領域である。   In the NAND flash memory, data reading and writing are performed in units of pages (physical pages), and data erasing is performed in units of blocks (physical blocks). A physical block is composed of a plurality of pages (physical pages). For example, one physical page includes a user area having a predetermined size (for example, 2048 bytes) and a redundant area having a predetermined size (for example, 64 bytes), and one physical block has a predetermined number (for example, 64). It consists of physical pages. The user area of one physical page is composed of a predetermined number (for example, four) of physical sector areas. The redundant area is an area for storing additional data such as error-correcting code (ECC), logical address information, and block status (flag).

冗長領域に書き込まれる論理アドレス情報は、物理ブロックと論理ブロックの対応関係を判別するための情報である。ブロックステータス(フラグ)は、物理ブロックの良否を示すフラグである。尚、正常にデータの書き込み等を行うことができない物理ブロックである不良ブロックには、出荷時から不良である初期不良の物理ブロック(以下、「初期不良ブロック」と言う)と、使用開始後に劣化して不良ブロックになった後発不良の物理ブロック(以下、「後発不良ブロック」と言う)がある。初期不良ブロックについては、不良ブロックであることを示すブロックステータス(フラグ)が製造メーカによって書き込まれている。また、この初期不良ブロックを示すブロックステータス(フラグ)を、ユーザ領域に書き込んでいる製造メーカもある。後発不良ブロックの判断基準については、設計の際に設計者が適宜設定することができる。例えば、書き込み又は消去を行った際にフラッシュメモリから与えられる処理ステータスがフェイルであった場合、読み出したデータに予め定められた閾値以上の誤りが含まれていた場合、又はこれらの組合せにより、後発不良理ブロックであるとの判断が行われてもよい。   The logical address information written in the redundant area is information for determining the correspondence between the physical block and the logical block. The block status (flag) is a flag indicating pass / fail of the physical block. In addition, a defective block that is a physical block that cannot normally perform data writing, etc. includes an initial defective physical block that is defective from the time of shipment (hereinafter referred to as “initial defective block”), and deterioration after the start of use. Thus, there is a late defective physical block (hereinafter referred to as a “late defective block”) that has become a defective block. For the initial defective block, a block status (flag) indicating a defective block is written by the manufacturer. There is also a manufacturer that writes a block status (flag) indicating the initial defective block in the user area. The criteria for determining the late defective block can be appropriately set by the designer at the time of designing. For example, when the processing status given from the flash memory at the time of writing or erasing is “fail”, when the read data includes an error exceeding a predetermined threshold value, or a combination of these, It may be determined that the block is defective.

本実施形態では、図2に示すように、互いに異なるフラッシュメモリ2A,2Bに属する2個の物理ブロックで仮想ブロックが形成され、この仮想ブロックに対して、論理ブロックが割り当てられる。従って、ホストシステム4から書き込みを指示するアクセス指示が与えられた場合、メモリコントローラ3は、そのアクセス指示で指定されるアクセス対象の領域が属する論理ブロックと対応関係にある仮想ブロックを特定し、その仮想ブロックを形成する2個の物理ブロックに対して、そのアクセス指示に対応するデータを書き込む。このデータ書き込み処理で、メモリコントローラ3は、フラッシュメモリ2Aに属する物理ブロック対するデータの書き込みとフラッシュメモリ2Bに属する物理ブロック対するデータの書き込みとを並行して行っても良いし、フラッシュメモリ2Aに属する物理ブロック対するデータの書き込みとフラッシュメモリ2Bに属する物理ブロック対するデータの書き込みとを交互に行っても良い。後者は、いわゆるインターリーブ方式であり、この方式では、一方のフラッシュメモリがビジー状態のときにビジー状態ではない他方のフラッシュメモリに対するデータの書き込みが行われる。   In this embodiment, as shown in FIG. 2, a virtual block is formed by two physical blocks belonging to different flash memories 2A and 2B, and a logical block is allocated to this virtual block. Accordingly, when an access instruction for instructing writing is given from the host system 4, the memory controller 3 identifies a virtual block corresponding to the logical block to which the area to be accessed designated by the access instruction belongs, Data corresponding to the access instruction is written into the two physical blocks forming the virtual block. In this data writing process, the memory controller 3 may perform the writing of data to the physical block belonging to the flash memory 2A and the writing of data to the physical block belonging to the flash memory 2B in parallel, or belong to the flash memory 2A. Data writing to the physical block and data writing to the physical block belonging to the flash memory 2B may be alternately performed. The latter is a so-called interleave method. In this method, when one flash memory is busy, data is written to the other flash memory that is not busy.

ホストシステム4側のアドレス空間は、セクタ(512バイト)単位で分割した領域(以下、「論理セクタ領域」と言う)に付けた通番であるLBA(Logical Block Address)で管理されている。メモリコントローラ3内で行われるアドレス管理では、複数個の論理セクタ領域で論理ブロックが形成され、この論理ブロックに対して、仮想ブロックが割り当てられる。本実施形態では、1個の物理ブロックが、256個の物理セクタ領域で構成されており、仮想ブロックが、2個の物理ブロックで形成されている。このため、図3に示したように、LBAが連続する512個の論理セクタ領域をまとめたものが論理ブロックとされ、この論理ブロックに、通し番号が付されている。以下、論理ブロックに付された通し番号を、「論理ブロック番号(LBN)」と言う。例えば、LBA#0−#511の512個の論理セクタ領域は、LBN#0の論理ブロックに属する。   The address space on the host system 4 side is managed by an LBA (Logical Block Address) which is a serial number assigned to an area (hereinafter referred to as “logical sector area”) divided in units of sectors (512 bytes). In address management performed in the memory controller 3, a logical block is formed by a plurality of logical sector areas, and a virtual block is assigned to the logical block. In the present embodiment, one physical block is composed of 256 physical sector areas, and a virtual block is composed of two physical blocks. For this reason, as shown in FIG. 3, a group of 512 logical sector areas with continuous LBAs is a logical block, and a serial number is assigned to this logical block. Hereinafter, the serial number assigned to the logical block is referred to as “logical block number (LBN)”. For example, 512 logical sector areas of LBA # 0 to # 511 belong to the logical block of LBN # 0.

また、本実施形態では、図2に示すように、仮想ブロックを形成する2個の物理ブロックは、物理ブロックアドレス(PBA)が同一の物理ブロックである。すなわち、仮想ブロックは、互いに異なるフラッシュメモリ2A,2Bに属するPBAが同一の物理ブロックで構成される。このようにすることにより、PBAが異なる2個の物理ブロックで仮想ブロックが形成される場合に比べて、仮想ブロックの管理が容易になる。つまり、PBAが異なる2個の物理ブロックで仮想ブロックが形成される場合、各論理ブロックにはPBAが異なる物理ブロックが割り当てられるので、2個のフラッシュメモリ2A,2Bの両方について、論理ブロックと物理ブロックの対応関係(LBNとPBAの対応関係)が管理される必要がある。しかし、本実施形態のように、PBAが同一の2個の物理ブロックで仮想ブロックが形成されれば、各論理ブロックには必ずPBAが同一の物理ブロックが割り当てられるので、2個のフラッシュメモリ2A,2Bのうちの一方についてのみ、論理ブロックと物理ブロックの対応関係(LBNとPBAの対応関係)が管理されれば良い。   In the present embodiment, as shown in FIG. 2, the two physical blocks forming the virtual block are physical blocks having the same physical block address (PBA). That is, the virtual block is composed of physical blocks having the same PBA belonging to different flash memories 2A and 2B. By doing so, the management of the virtual block becomes easier as compared with the case where the virtual block is formed by two physical blocks having different PBAs. That is, when a virtual block is formed by two physical blocks having different PBAs, physical blocks having different PBAs are allocated to the respective logical blocks. Therefore, both of the two flash memories 2A and 2B have a logical block and a physical block. The correspondence between blocks (correspondence between LBN and PBA) needs to be managed. However, if a virtual block is formed by two physical blocks having the same PBA as in the present embodiment, a physical block having the same PBA is always assigned to each logical block. , 2B, the correspondence between logical blocks and physical blocks (correspondence between LBN and PBA) need only be managed.

図2に示すように、仮想ブロックには、不良ブロック(図2で“NG”と記載された物理ブロック)が含まれていない仮想ブロック(以下、「不良無し仮想ブロック」と言う)と、不良ブロックが含まれている仮想ブロック(以下、「不良有り仮想ブロック」と言う)との2種類がある。   As shown in FIG. 2, the virtual block does not include a defective block (physical block described as “NG” in FIG. 2) (hereinafter referred to as “virtual block without defect”) and a defective block. There are two types of virtual blocks including blocks (hereinafter referred to as “virtual blocks with defects”).

不良無し仮想ブロック(例えば、PBA#2の2個の物理ブロックで構成される仮想ブロック)は、ユーザーデータの書き込み先として使用可能な仮想ブロックである。言い換えれば、不良無し仮想ブロックは、論理ブロック(例えば、LBN#0の論理ブロック)に割り当てられ得る仮想ブロックである。   A defect-free virtual block (for example, a virtual block composed of two physical blocks of PBA # 2) is a virtual block that can be used as a user data write destination. In other words, the defect-free virtual block is a virtual block that can be assigned to a logical block (for example, a logical block of LBN # 0).

一方、不良有り仮想ブロック(例えば、PBA#6の2個の物理ブロックで構成される仮想ブロック)は、ユーザーデータの書き込み先として使用不可能な仮想ブロックである。言い換えれば、不良有り仮想ブロックは、論理ブロックに割り当てられることのない仮想ブロックである。   On the other hand, a defective virtual block (for example, a virtual block composed of two physical blocks of PBA # 6) is a virtual block that cannot be used as a user data write destination. In other words, the defective virtual block is a virtual block that is not assigned to a logical block.

本実施形態では、不良有り仮想ブロック内の良品ブロック(不良ブロックでない物理ブロック)が、システムデータの書き込み先として使用される物理ブロック(以下、「システムブロック」と言う)として優先的に予約される。つまり、不良有り仮想ブロックに含まれる良品ブロックが、不良無し仮想ブロックに含まれる物理ブロックよりも優先的にシステムブロックとして予約される。このようにすることにより、不良有り仮想ブロックに含まれる良品ブロックを有効に活用することができる。   In this embodiment, a non-defective block (a physical block that is not a defective block) in a virtual block with a defect is preferentially reserved as a physical block (hereinafter referred to as a “system block”) used as a system data write destination. . That is, the non-defective block included in the defective virtual block is reserved as a system block preferentially over the physical block included in the defective virtual block. By doing so, the non-defective block included in the defective virtual block can be effectively used.

システムブロックの予約は、フォーマット(初期化)の際に行われることが好ましい。本実施形態では、フォーマット(初期化)の際に、メモリコントローラ3によって、不良ブロックが検出され、検出された不良ブロックが含まれる不良有り仮想ブロック内の良品ブロックが、不良無し仮想ブロックに含まれる物理ブロックよりも優先的にシステムブロックとして予約される。システムブロックとして予約される物理ブロックの個数については、フラッシュメモリシステム1がホストシステム4の記憶装置として使用されたときに格納され得るシステムデータの容量を考慮して決定される。更に、この物理ブロックの個数を決定するときには、システムデータの更新処理やシステムブロックとして予約された物理ブロックが後発不良ブロックになること等も考慮される。フォーマット(初期化)の際には、これらのことを考慮して決定された所定個数の物理ブロックがシステムブロックとして予約される。   The reservation of the system block is preferably performed at the time of formatting (initialization). In the present embodiment, a defective block is detected by the memory controller 3 during formatting (initialization), and a non-defective virtual block in the defective virtual block including the detected defective block is included in the defective virtual block. Reserved as a system block in preference to a physical block. The number of physical blocks reserved as system blocks is determined in consideration of the capacity of system data that can be stored when the flash memory system 1 is used as a storage device of the host system 4. Furthermore, when determining the number of physical blocks, it is also considered that the system data update process, a physical block reserved as a system block becomes a late defective block, and the like. At the time of formatting (initialization), a predetermined number of physical blocks determined in consideration of these matters are reserved as system blocks.

ここで、もし、不良有り仮想ブロック内の良品ブロックだけでは、所定個数の物理ブロックをシステムブロックとして予約することが不可能であれば(つまり、不良有り仮想ブロック内の良品ブロックの総数が所定個数に満たなければ)、不良無し仮想ブロック内の物理ブロックが、システムブロックとして予約される。   Here, if it is impossible to reserve a predetermined number of physical blocks as system blocks only with good blocks in the defective virtual block (that is, the total number of good blocks in the defective virtual block is the predetermined number). If this is not the case, the physical block in the non-defective virtual block is reserved as a system block.

なお、システムブロックとして予約された物理ブロックは、ユーザーデータの書き込み先として使用されないので、仮想ブロックに含まれる一部の物理ブロックだけがシステムブロックとして予約されたとしても、その仮想ブロックに含まれる残りの物理ブロックがユーザーデータの書き込み先として使用されることはない。この点を考慮すれば、システムブロックの予約は、仮想ブロック単位で行われることが好ましい。従って、不良無し仮想ブロック内の物理ブロックがシステムブロックとして予約される場合には、その不良無し仮想ブロックに含まれる全ての物理ブロック(本実施形態では2個の物理ブロック)がシステムブロックとして予約されるようにすることが好ましい。   Note that physical blocks reserved as system blocks are not used as user data write destinations. Therefore, even if only some physical blocks included in a virtual block are reserved as system blocks, the remaining physical blocks are included in the virtual block. Are not used as user data write destinations. Considering this point, it is preferable that the reservation of the system block is performed in units of virtual blocks. Therefore, when a physical block in a virtual block without defect is reserved as a system block, all physical blocks included in the virtual block without defect (two physical blocks in this embodiment) are reserved as system blocks. It is preferable to do so.

仮想ブロック単位でシステムブロックの予約を行ったことにより、予め決定されていた所定個数を越える個数の物理ブロックがシステムブロックとして予約されることがあっても構わない。従って、フォーマット(初期化)の際には、所定個数以上の物理ブロックがシステムブロックとして予約される。   By reserving system blocks in units of virtual blocks, a number of physical blocks exceeding a predetermined number may be reserved as system blocks. Therefore, at the time of formatting (initialization), a predetermined number or more of physical blocks are reserved as system blocks.

その後、ユーザーデータの書き込み先として使用されていた物理ブロック(良品ブロック)が劣化して後発不良ブロックになったときには、その後発不良ブロックが含まれる不良有り仮想ブロック内の良品ブロックが、システムブロックとして追加予約される。この追加予約により、システムブロックの個数が増加する。その結果、不良無し仮想ブロック内の物理ブロックがシステムブロックとして予約されている必要がなくなった場合には、不良無し仮想ブロック内の物理ブロックに対する予約が、不良有り仮想ブロック内の良品ブロックに対する予約よりも優先的に解除される。なお、不良有り仮想ブロック内の良品ブロックはユーザーデータの書き込み先として使用されないので、不良有り仮想ブロック内の良品ブロックに対するシステムブロックの予約の解除は行われなくてもよい。つまり、システムブロックとして予約されている物理ブロックが全て不良有り仮想ブロック内の良品ブロックであれば、システムブロックの予約の解除は行われなくても良い。   Then, when the physical block (good product block) used as the user data write destination deteriorates and becomes a late defective block, the good block in the defective virtual block that contains the subsequent defective block becomes a system block. Additional reservations are made. This additional reservation increases the number of system blocks. As a result, when the physical block in the virtual block without defect need not be reserved as a system block, the reservation for the physical block in the virtual block without defect is more reserved than the reservation for the good block in the virtual block without defect. Is also released preferentially. Since the non-defective block in the defective virtual block is not used as the user data write destination, the system block reservation for the non-defective virtual block in the defective virtual block may not be released. That is, if all the physical blocks reserved as system blocks are non-defective blocks in the virtual block having a defect, the system block reservation need not be released.

また、システムブロックの予約の解除も仮想ブロック単位で行われることが好ましい。従って、仮想ブロック単位でシステムブロックの予約の解除が行われたときに、システムブロックとして予約されている物理ブロックの個数が所定個数以下になってしまうような場合は、システムブロックの予約の解除は行われない。不良無し仮想ブロック内の全ての物理ブロックに対するシステムブロックの予約が解除された場合、その不良無し仮想ブロックはユーザーデータの書き込み先として使用可能な状態になる。   Further, it is preferable that the reservation of the system block is canceled in units of virtual blocks. Therefore, if the number of physical blocks reserved as system blocks falls below a predetermined number when system block reservation is canceled in virtual block units, system block reservation cancellation Not done. When the reservation of the system block for all the physical blocks in the non-defective virtual block is canceled, the non-defective virtual block becomes usable as a user data write destination.

本実施形態では、前述したように、不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルの3種類のテーブルがシステムデータとしてフラッシュメモリ2に保存される。である。以下、各種テーブルについて説明する。   In the present embodiment, as described above, three types of tables, that is, a defective block table, an address conversion table, and an empty block table are stored in the flash memory 2 as system data. It is. Hereinafter, various tables will be described.

図3は、不良ブロックテーブルを示す。   FIG. 3 shows a bad block table.

不良ブロックテーブルは、不良ブロック(初期不良又は後発不良の物理ブロック)を示す情報を保持するテーブルである。不良ブロックテーブルには、不良ブロックを示す情報として、例えば、不良ブロックが属するフラッシュメモリ2A,2Bの識別子(以下、「チップ番号」と言う)と、その不良ブロックのPBAとが書き込まれる。   The bad block table is a table that holds information indicating a bad block (physical block of initial failure or late failure). In the bad block table, as information indicating the bad block, for example, an identifier (hereinafter referred to as “chip number”) of the flash memories 2A and 2B to which the bad block belongs and the PBA of the bad block are written.

不良ブロックテーブルは、フォーマット(初期化)の際に作成される。例えば、フォーマット(初期化)の際に不良ブロックの検索が行われ、検出された不良ブロックが属するフラッシュメモリ2A,2Bのチップ番号及びその不良ブロックのPBAが、SRAM8のワーク領域上に確保された不良ブロックテーブルの作成領域に書き込まれる。このようにして不良ブロックテーブルが作成された後に、作成された不良ブロックテーブルに基づいて上述のシステムブロックの予約が行われる。そして、SRAM8のワーク領域上に作成された不良ブロックテーブルは、不良ブロックテーブルの書き込み先として予約されているシステムブロックに書き込まれる。その後、後発不良ブロックが新たに検出されたときには、SRAM8のワーク領域上で不良ブロックテーブルが更新され(その新たに検出された後発不良ブロックに対応したチップ番号及びPBAが不良ブロックテーブルに追加され)、更新後の不良ブロックテーブルが、再び、不良ブロックテーブルの書き込み先として予約されているシステムブロックに書き込まれる。   The bad block table is created at the time of formatting (initialization). For example, a bad block is searched at the time of formatting (initialization), and the chip numbers of the flash memories 2A and 2B to which the detected bad block belongs and the PBA of the bad block are secured in the work area of the SRAM 8. Written in the bad block table creation area. After the defective block table is created in this way, the above-described system block reservation is made based on the created bad block table. Then, the defective block table created on the work area of the SRAM 8 is written into a system block reserved as a writing destination of the defective block table. Thereafter, when a new defective block is detected, the defective block table is updated in the work area of the SRAM 8 (a chip number and PBA corresponding to the newly detected subsequent defective block are added to the defective block table). The updated defective block table is written again to the system block reserved as the defective block table write destination.

図4は、論理グループとアドレス変換テーブルの対応関係を示す。   FIG. 4 shows the correspondence between logical groups and address conversion tables.

論理グループとは、論理ブロックを複数個まとめることで形成されたグループである。以下、論理グループに付けられた通し番号を、「論理グループ番号(LGN)」と言う。図4の例では、LBNが連続する論理ブロックが、異なる論理グループに順次振り分けられるようにして、論理グループが形成されている。例えば、LBN#0の論理ブロックはLGN#0の論理グループに、LBN#1の論理ブロックはLGN#1の論理グループに、LBN#2の論理ブロックはLGN#2の論理グループにという順番で、LBN#0−#7の論理ブロックがLGN#0−#7の論理グループに順次振り分けられていく。以下、同様に、LBN#8の論理ブロックがLGN#0の論理グループに、LBN#9の論理ブロックがLGN#1の論理グループに、LBN#10の論理ブロックがLGN#2の論理グループに振り分けられていく。このようにして、8個の論理グループが形成される。   A logical group is a group formed by collecting a plurality of logical blocks. Hereinafter, a serial number assigned to a logical group is referred to as a “logical group number (LGN)”. In the example of FIG. 4, logical groups are formed such that logical blocks having consecutive LBNs are sequentially distributed to different logical groups. For example, the logical block of LBN # 0 is in the logical group of LGN # 0, the logical block of LBN # 1 is in the logical group of LGN # 1, the logical block of LBN # 2 is in the logical group of LGN # 2, The logical blocks of LBN # 0- # 7 are sequentially allocated to the logical groups of LGN # 0- # 7. Similarly, the logical block of LBN # 8 is assigned to the logical group of LGN # 0, the logical block of LBN # 9 is assigned to the logical group of LGN # 1, and the logical block of LBN # 10 is assigned to the logical group of LGN # 2. It will be. In this way, eight logical groups are formed.

論理グループは、図4に示すように、単なるアドレス変換テーブルの作成単位であり、各論理ブロックが割り当てられる物理ブロックは、その物理ブロックが属する論理グループに依存しない。つまり、どの論理ブロックがどの物理ブロックに割り当てられても良い。このアドレス変換テーブルは、論理ブロックと物理ブロックとの対応関係を記述したテーブルであり、図4に示した例では、各論理グループに対応する8個のテーブルに分割してアドレス変換テーブルの管理(作成、更新及び保存)を行っているが、全ての論理ブロックと物理ブロックとの対応関係を含む1個のテーブルであっても良い。   As shown in FIG. 4, the logical group is simply a unit for creating an address translation table, and the physical block to which each logical block is assigned does not depend on the logical group to which the physical block belongs. That is, which logical block may be assigned to which physical block. This address conversion table is a table that describes the correspondence between logical blocks and physical blocks. In the example shown in FIG. 4, the address conversion table is divided into eight tables corresponding to each logical group. Creation, update, and storage), but one table including the correspondence between all logical blocks and physical blocks may be used.

アドレス変換テーブルの一例として、図5に、LGN#0の論理グループに対応したアドレス変換テーブル#0を示す。図5から分かるように、アドレス変換テーブル#0には、LGN#0の論理グループに属する論理ブロックに関して、各論理ブロックに対応する物理ブロックのPBAが書き込まれている。このアドレス変換テーブル#0がシステムブロックに保存されていない場合は、アドレス変換テーブル#0はSRAM8のワーク領域上で作成された後、そのテーブルの書き込み先として予約されているシステムブロックに保存される。また、アドレス変換テーブル#0がシステムブロックに保存されている場合は、必要なときにSRAM8のワーク領域に読み出される。そして、アドレス変換テーブル#0に関する論理ブロックと物理ブロックの対応関係が変化したときは、ワーク領域上でそのテーブルが更新され、更新後のアドレス変換テーブル#0が、再び、そのテーブルの書き込み先として予約されているシステムブロックに書き込まれる。   As an example of the address conversion table, FIG. 5 shows an address conversion table # 0 corresponding to a logical group of LGN # 0. As can be seen from FIG. 5, the PBA of the physical block corresponding to each logical block is written in the address translation table # 0 for the logical block belonging to the logical group of LGN # 0. If this address conversion table # 0 is not stored in the system block, the address conversion table # 0 is created on the work area of the SRAM 8 and then stored in the system block reserved as the writing destination of the table. . If the address conversion table # 0 is stored in the system block, it is read into the work area of the SRAM 8 when necessary. When the correspondence between the logical block and the physical block relating to the address conversion table # 0 changes, the table is updated in the work area, and the updated address conversion table # 0 is again used as the writing destination of the table. Written to a reserved system block.

図6は、空きブロックテーブルを示す。   FIG. 6 shows an empty block table.

空きブロックテーブルは、各物理ブロックが空きブロックであるか否かを示すテーブルである。空きブロックテーブルは、例えば、各ビットの論理値で、各ビットに割り当てられている物理ブロックが空きブロックであるか否かを示す。つまり、この空きブロックテーブルでは、0”又は“1”のいずれか一方の論理値が空きブロック(データが消去されている物理ブロック又はデータが無効化されている物理ブロック)を示し、他方の論理値が空きブロックではない物理ブロック(例えば、有効なユーザーデータが書き込まれている物理ブロック、システムブロック又は不良ブロック)を示す。この空きブロックテーブルもSRAM8のワーク領域上で作成又は更新され、このテーブルの書き込み先として予約されているシステムブロックに保存される。   The empty block table is a table indicating whether each physical block is an empty block. The free block table is, for example, a logical value of each bit and indicates whether or not a physical block assigned to each bit is a free block. In other words, in this empty block table, one of the logical values of 0 ”or“ 1 ”indicates an empty block (a physical block from which data has been erased or a physical block from which data has been invalidated), and the other logical value. A physical block whose value is not a free block (for example, a physical block in which valid user data is written, a system block, or a bad block) This free block table is also created or updated in the work area of the SRAM 8, and this table Is saved in the system block reserved as the write destination.

図6に示した空きブロックテーブルでは、各行(8ビット)の連続した2個のビットが、一つの仮想ブロックを形成する2個の物理ブロックに対応している。つまり、フラッシュメモリ2Aに属する物理ブロックとフラッシュメモリ2Bに属する物理ブロックとが、PBAの順番で各行(8ビット)のビットに交互に割り当てられている。この物理ブロックの割り当ては、上の行から下の行に向かって、各行においては下位ビット側から上位ビット側に向かって行われる。このように、仮想ブロックを構成する各物理ブロックが空きブロックであるか否かに関する情報は、1つの空きブロックテーブル上で管理されることが好ましい。尚、本実施形態のように仮想ブロックに対して論理ブロックが割り当てられる場合には、仮想ブロック単位で空きブロックになるので、本実施形態における空きブロックテーブルは仮想ブロック単位で空きブロックであるか否かを示すようなテーブルであっても良い。つまり、本実施形態における空きブロックテーブルでは、各ビットに対して仮想ブロックが割り当てられ、各ビットの論理値がそのビットに割り当てられた仮想ブロックが空きブロックであるか否かを示すテーブルであっても良い。このように各ビットに対して仮想ブロックが割り当てられるようにすれば、空きブロックテーブルの容量を小さくすることができる。例えば、本実施形態のように2個の物理ブロックで仮想ブロックが形成されている場合、その仮想ブロックが各ビットに対して割り当てられれば、空きブロックテーブルの容量は1/2になる。   In the empty block table shown in FIG. 6, two consecutive bits in each row (8 bits) correspond to two physical blocks forming one virtual block. That is, the physical blocks belonging to the flash memory 2A and the physical blocks belonging to the flash memory 2B are alternately assigned to the bits of each row (8 bits) in the order of PBA. This physical block allocation is performed from the upper row to the lower row, and in each row, from the lower bit side to the upper bit side. Thus, it is preferable that information regarding whether or not each physical block constituting a virtual block is a free block is managed on one free block table. When logical blocks are assigned to virtual blocks as in this embodiment, empty blocks are created in units of virtual blocks. Therefore, whether the free block table in this embodiment is free blocks in units of virtual blocks or not. It is also possible to use a table that indicates the above. That is, in the empty block table in the present embodiment, a virtual block is assigned to each bit, and the logical value of each bit indicates whether or not the virtual block assigned to that bit is an empty block. Also good. If a virtual block is assigned to each bit in this way, the capacity of the free block table can be reduced. For example, when a virtual block is formed by two physical blocks as in this embodiment, if the virtual block is assigned to each bit, the capacity of the free block table is halved.

また、1個の空きブロックテーブルの容量は、1セクタ(1個の物理セクタ領域の記憶容量)又は1個の物理ページの記憶容量であることが好ましい。つまり、空きブロックテーブルは、1セクタ単位又は1ページ単位のテーブルに分割されて管理され、その単位でシステムブロックに保存されることが好ましい。   The capacity of one free block table is preferably one sector (storage capacity of one physical sector area) or storage capacity of one physical page. That is, it is preferable that the empty block table is divided and managed as a table of one sector or one page, and is stored in the system block in that unit.

以上が、不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルについての説明である。これらのテーブルの書き込み先として予約されたシステムブロックを示す情報(以下、「システムブロック情報」と言う)は、例えば、フォーマット(初期化)の際に作成され、フラッシュメモリ2A及び/又は2B内の先頭ブロックに保存される。本実施形態では、図7A乃至図7Cに示すように、不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルの書き込み先として予約されたシステムブロックを特定するためのチップ番号及びPBAがシステムブロック情報として管理される。図7Aに示す情報は、不良ブロックテーブルの書き込み先として予約されたシステムブロックを特定するためのチップ番号及びPBAを示す不良ブロックテーブル格納領域情報である。図7Bに示す情報は、アドレス変換テーブルの書き込み先として予約されたシステムブロックを特定するためのチップ番号及びPBAを示すアドレス変換テーブル毎のアドレス変換テーブル格納領域情報である。また、図7Cに示す情報は、空きブロックテーブルの書き込み先として予約されたシステムブロックを特定するためのチップ番号及びPBAを示す空きブロックテーブル毎の空きブロックテーブル格納領域情報である。このように、本実施形態におけるシステムブロックの予約は、不良ブロックテーブル格納領域情報、アドレス変換テーブル格納領域情報及び空きブロックテーブル格納領域情報を含むシステムブロック情報によって管理されている。   This completes the description of the defective block table, the address conversion table, and the empty block table. Information indicating a system block reserved as a writing destination of these tables (hereinafter referred to as “system block information”) is created, for example, at the time of formatting (initialization), and is stored in the flash memory 2A and / or 2B. Saved in the first block. In this embodiment, as shown in FIGS. 7A to 7C, the chip number and PBA for specifying the system block reserved as the write destination of the bad block table, the address conversion table, and the empty block table are managed as system block information. Is done. The information shown in FIG. 7A is bad block table storage area information indicating a chip number and PBA for specifying a system block reserved as a write destination of the bad block table. The information shown in FIG. 7B is address conversion table storage area information for each address conversion table indicating a chip number and PBA for specifying a system block reserved as a write destination of the address conversion table. The information shown in FIG. 7C is empty block table storage area information for each empty block table indicating a chip number and PBA for specifying a system block reserved as a write destination of the empty block table. As described above, the reservation of the system block in the present embodiment is managed by the system block information including the defective block table storage area information, the address conversion table storage area information, and the free block table storage area information.

各テーブルの容量は、フラッシュメモリ2における書き込み又は読み出しの処理の単位である一個の物理ページに収まる容量(例えば、物理ページと同じ容量)であり、一個の物理ページには1個のテーブルが保存されることが好ましい。このようにした場合、テーブルが更新される毎に、更新されたテーブルが物理ブロック(システムブロック)内の次の物理ページに保存されることになる。また、最新のテーブルは、物理ブロック(システムブロック)内のデータ(テーブルのデータ)が書き込まれている末尾の物理ページに保存されていることになる。   The capacity of each table is a capacity (for example, the same capacity as a physical page) that fits in one physical page that is a unit of writing or reading processing in the flash memory 2, and one table stores one table. It is preferred that In this case, every time the table is updated, the updated table is stored in the next physical page in the physical block (system block). The latest table is stored in the last physical page in which data (table data) in the physical block (system block) is written.

尚、各物理ページに対して物理セクタ領域単位でデータを書き込んでいくことができるフラッシュメモリであれば、各テーブルの容量が一個の物理セクタ領域に収まる容量(例えば、物理セクタ領域と同じ容量)であり、一個の物理セクタ領域に1個のテーブルが保存されるようにしても良い。この場合、最新のテーブルは、物理ブロック(システムブロック)内のデータ(テーブルのデータ)が書き込まれている末尾の物理セクタ領域に保存されていることになる。   If the flash memory is capable of writing data to each physical page in units of physical sector areas, the capacity of each table can be stored in one physical sector area (for example, the same capacity as the physical sector area). Thus, one table may be stored in one physical sector area. In this case, the latest table is stored in the physical sector area at the end where data (table data) in the physical block (system block) is written.

本実施形態では、各テーブルに対して、2個のシステムブロックが予約される。従って、2個のシステムブロックのうち、一方は、テーブルの書き込み先として使用されているシステムブロック(以下、「現行ブロック」と言う)になっており、他方はテーブルの書き込み先として使用されていない控えのシステムブロック(以下、「控えブロック」と言う)になっている。そして、現行ブロック内にテーブルを書き込むための空き領域(データの書き込まれていない物理ページ又は物理セクタ領域)が無くなった場合は、控えブロックが現行ブロックになり、現行ブロックが控えブロックになる。つまり、各テーブルに対して予約された2個のシステムブロックは、交互に現行ブロック(又は、控えブロック)になる。   In this embodiment, two system blocks are reserved for each table. Therefore, one of the two system blocks is a system block used as a table write destination (hereinafter referred to as “current block”), and the other is not used as a table write destination. It is a reserved system block (hereinafter referred to as “reserved block”). When there is no free area (physical page or physical sector area in which data is not written) for writing the table in the current block, the reserved block becomes the current block, and the current block becomes the reserved block. That is, the two system blocks reserved for each table alternately become the current block (or reserved block).

システムブロック情報は、起動時にフラッシュメモリ2A及び/又は2Bの先頭ブロックから読み出され、SRAM8のワーク領域に保持されている。そして、テーブルの書き込み先として予約されているシステムブロックが変更される場合、システムブロック情報は、SRAM8のワーク領域上で更新される。システムブロック情報が更新された場合は、更新後のシステムブロック情報がフラッシュメモリ2A及び/又は2Bの先頭ブロックに書き込まれる。なお、本実施形態で、フラッシュメモリ2A及び/又は2Bの先頭ブロックがシステムブロック情報の書き込み先として設定されているのは、一般に、先頭ブロックは、不良ブロックではないことが製造メーカによって保証されているためである。このため、通常、先頭ブロックには、属性情報(例えば、フラッシュメモリシステム1がどういうものであって、どういうフラッシュメモリが幾つ搭載されているか等を表す情報)が書き込まれていることが多く、先頭ブロックにユーザーデータ(ホストシステムから与えられるアクセス指示に従って書き込まれるデータ)が書き込まれることは殆ど無い。   The system block information is read from the head block of the flash memory 2A and / or 2B at the time of activation and is held in the work area of the SRAM 8. When the system block reserved as the table write destination is changed, the system block information is updated on the work area of the SRAM 8. When the system block information is updated, the updated system block information is written in the first block of the flash memory 2A and / or 2B. In the present embodiment, the first block of the flash memory 2A and / or 2B is set as the writing destination of the system block information. Generally, the manufacturer guarantees that the first block is not a defective block. Because it is. For this reason, usually, attribute information (for example, information indicating what the flash memory system 1 is and how many flash memories are mounted) is written in the first block. User data (data written according to an access instruction given from the host system) is rarely written in the block.

本実施形態では、各テーブルに対して、2個のシステムブロックが予約され、それらのシステムブロックが交互に現行ブロックになる。従って、いずれかのテーブルに対して予約されている2個のシステムブロックのうち、少なくとも一方が後発不良ブロックになってしまった場合には、そのテーブルに対して別のシステムブロックが新たに予約される必要がある。このシステムブロックの新たな予約は、システムブロックが後発不良ブロックになったときに行なわれても良いが、予め確保されている予備のシステムブロック(以下、「予備ブロック」と言う)により後発不良ブロックになったシステムブロックの補充が行われるようにしても良い。つまり、フォーマット(初期化)の際に予約されるシステムブロックに予備ブロックが含まれていても良い。   In the present embodiment, two system blocks are reserved for each table, and these system blocks alternately become the current block. Therefore, if at least one of the two system blocks reserved for any table becomes a late defective block, another system block is newly reserved for that table. It is necessary to The new reservation of the system block may be performed when the system block becomes a late defective block. However, a new defective block is reserved by a reserved system block (hereinafter referred to as “spare block”) reserved in advance. It is also possible to replenish the system block that has become. That is, a spare block may be included in a system block reserved at the time of formatting (initialization).

予備ブロックを含めてシステムブロックの予約を行った場合には、予備ブロックとして予約されたシステムブロックを特定するための情報(以下、「予備ブロック情報」と言う)もシステムブロック情報として保存される。図8に示す情報は、予備ブロックとして予約されたシステムブロックを特定するためのチップ番号及びPBAを示す予備ブロック情報である。この予備ブロック情報も不良ブロックテーブル格納領域情報、アドレス変換テーブル格納領域情報及び空きブロックテーブル格納領域情報と同様にシステムブロック情報として保存される。また、この予備ブロック情報も他のシステムブロック情報と同様に、SRAM8のワーク領域上で更新され、更新された予備ブロック情報はフラッシュメモリ2A及び/又は2Bの先頭ブロックに保存される。   When a system block including a spare block is reserved, information for specifying a system block reserved as a spare block (hereinafter referred to as “spare block information”) is also stored as system block information. The information shown in FIG. 8 is spare block information indicating a chip number and PBA for specifying a system block reserved as a spare block. This spare block information is also stored as system block information in the same manner as the defective block table storage area information, the address conversion table storage area information, and the free block table storage area information. The spare block information is also updated on the work area of the SRAM 8 like the other system block information, and the updated spare block information is stored in the first block of the flash memory 2A and / or 2B.

本実施形態では、不良ブロックテーブルについては、2個のシステムブロックが予約され、アドレス変換テーブルについては、8個のアドレス変換テーブル#0〜#7があるため(図7B参照)、8×2=16個のシステムブロックが予約され、空きブロックテーブルについては、2個の空きブロックテーブル#0及び#1があるため(図7C参照)、2×2=4個のシステムブロックが予約され、更に、予備ブロック用のシステムブロックが少なくとも1個予約される。従って、予備ブロック用のシステムブロックの個数を3個とした場合、前述したシステムブロックとして予約される物理ブロックの所定個数は、2+16+4+3=25個になる。   In the present embodiment, two system blocks are reserved for the bad block table, and there are eight address conversion tables # 0 to # 7 for the address conversion table (see FIG. 7B), so that 8 × 2 = Since 16 system blocks are reserved and there are 2 empty block tables # 0 and # 1 for the empty block table (see FIG. 7C), 2 × 2 = 4 system blocks are reserved, At least one system block for the spare block is reserved. Therefore, when the number of system blocks for spare blocks is 3, the predetermined number of physical blocks reserved as the system blocks described above is 2 + 16 + 4 + 3 = 25.

不良ブロックテーブル、アドレス変換テーブル又は空きブロックテーブルに対して予約されているシステムブロックのうち、いずれかのシステムブロックが後発不良ブロックになった場合に行われるシステムブロックの補充について説明する。通常、後発不良ブロックであるか否かの判断は、データの書き込み、データの読み出し又は記憶データの消去が実行されたときに行われる。従って、現行ブロックでデータの書き込み又はデータの読み出しが実行されたときや、控えブロックで記憶データの消去が実行されたときに、後発不良ブロックであるか否かの判断が行われることが多い。ここで、後発不良ブロックになったと判断されたシステムブロックが現行ブロックであった場合には、そのシステムブロックの代わりに補充されるシステムブロック(予備ブロックとして予約されていたシステムブロック)に最新のテーブルが書き込まれると共に、システムブロック情報の更新が行われる。一方、後発不良ブロックになったと判断されたシステムブロックが控えブロックであった場合には、システムブロック情報の更新だけが行われる。   The system block replenishment performed when any one of the system blocks reserved for the bad block table, the address conversion table, or the empty block table becomes a late defective block will be described. Usually, the determination as to whether the block is a late defective block is made when data writing, data reading, or erasing stored data is executed. Therefore, when data writing or data reading is executed in the current block, or when erasure of stored data is executed in the backup block, it is often determined whether or not it is a late defective block. Here, if the system block that has been determined to be a late defective block is the current block, the latest table is stored in the system block that is replenished instead of the system block (the system block reserved as a spare block). Is written and the system block information is updated. On the other hand, when the system block determined to have become a late defective block is a reserved block, only the system block information is updated.

システムブロック情報の更新では、不良ブロックテーブル格納領域情報、アドレス変換テーブル格納領域情報及び空きブロックテーブル格納領域情報に記載されているシステムブロックのチップ番号及びPBAのうち、後発不良ブロックになったと判断されたシステムブロックのチップ番号及びPBAが補充されるシステムブロック(予備ブロックとして予約されていたシステムブロック)のチップ番号及びPBAで置換えられる。続いて、予備ブロック情報に記載されているシステムブロックのチップ番号及びPBAから、補充されるシステムブロック(予備ブロックとして予約されていたシステムブロック)のチップ番号及びPBAが削除される。この更新はSRAM8のワーク領域上で行われ、更新されたシステムブロック情報はフラッシュメモリ2A及び/又は2Bの先頭ブロックに保存される。   In the update of the system block information, it is determined that the defective block is a late defective block among the system block chip number and PBA described in the bad block table storage area information, the address conversion table storage area information and the free block table storage area information. The system block chip number and PBA are replaced with the chip number and PBA of the system block (system block reserved as a spare block) to be supplemented. Subsequently, the chip number and PBA of the system block to be replenished (system block reserved as a spare block) are deleted from the chip number and PBA of the system block described in the spare block information. This update is performed on the work area of the SRAM 8, and the updated system block information is stored in the head block of the flash memory 2A and / or 2B.

尚、後発不良ブロックになったと判断されたシステムブロックのチップ番号及びPBAは、不良ブロックテーブルに書き込まれる。この不良ブロックテーブルの更新は、SRAM8のワーク領域上で行われ、更新された不良ブロックテーブルは、そのテーブルの書き込み先として予約されているシステムブロックに保存される。   Note that the chip number and PBA of the system block that is determined to be a late defective block are written in the defective block table. The bad block table is updated on the work area of the SRAM 8, and the updated bad block table is stored in a system block reserved as a writing destination of the table.

不良ブロックテーブル、アドレス変換テーブル又は空きブロックテーブルに対して予約されているシステムブロックのうちのいずれかのシステムブロックが後発不良ブロックになった場合には、予備ブロックによりその補充が行われるため、予備ブロック用のシステムブロックの個数が減少する。従って、予備ブロック用のシステムブロックの個数が0個になったとき、又は、予め設定した最低個数以下になったときには、予備ブロック用のシステムブロックの予約(追加予約)を行うことが好ましい。   If any of the system blocks reserved for the bad block table, address translation table, or empty block table becomes a late defective block, the spare block will replenish it. The number of system blocks for blocks is reduced. Therefore, when the number of system blocks for spare blocks becomes zero, or when the number of system blocks becomes less than the preset minimum number, it is preferable to reserve system blocks for spare blocks (additional reservation).

また、不良無し仮想ブロック内の物理ブロックが劣化して後発不良ブロックになったときには、その後発不良ブロックが含まれる仮想ブロック内の良品ブロックが、予備ブロック用のシステムブロックとして追加予約される。従って、その良品ブロックのチップ番号及びPBAは、予備ブロック情報に書き込まれる。このシステムブロックの追加予約により、予備ブロックの個数が増加し不良無し仮想ブロック内の物理ブロックをシステムブロックとして確保しておく必要がなくなった場合には、不良有り仮想ブロック内の良品ブロックに対する予約が解除される。つまり、不良無し仮想ブロック内の物理ブロックに対する予約は、不良有り仮想ブロック内の良品ブロックに対する予約よりも優先的に解除される。但し、不良有り仮想ブロック内の良品ブロックは、ユーザーデータの書き込み先として使用されることがないので、予備ブロックが全て不良有り仮想ブロック内の良品ブロックであれば、予備ブロックの個数が増加しても予備ブロック用のシステムブロックの予約は解除されなくても良い。   When a physical block in a virtual block without defect deteriorates to become a subsequent defective block, a non-defective block in the virtual block including the subsequent defective block is additionally reserved as a system block for a spare block. Therefore, the chip number and PBA of the non-defective block are written in the spare block information. If this system block additional reservation increases the number of spare blocks and it is no longer necessary to reserve the physical block in the virtual block without defect as a system block, the reservation for the non-defective virtual block in the defective virtual block is made. Canceled. That is, the reservation for the physical block in the non-defective virtual block is released with priority over the reservation for the non-defective block in the defective virtual block. However, since the non-defective blocks in the defective virtual block are not used as the user data write destination, if the spare blocks are all non-defective blocks in the defective virtual block, the number of spare blocks increases. However, the reservation of the system block for the spare block may not be canceled.

ここで、「不良無し仮想ブロック内の物理ブロックをシステムブロックとして確保しておく必要がなくなった場合」とは、例えば、予備ブロックとして予約されている物理ブロックに不良有り仮想ブロック内の良品ブロックと不良無し仮想ブロック内の良品ブロックとが含まれており、その予備ブロックの累計が、予め定められている予備ブロック用のシステムブロックの個数(以下、「所定予備個数」と言う)よりも多いことを意味している。なお、システムブロックの予約の解除は仮想ブロック単位で行われることが好ましいため、システムブロックの予約の解除は、所定予備個数を超えた予備ブロック用のシステムブロックの個数が仮想ブロックを形成する物理ブロックの個数以上(つまり、本実施形態では2個以上)になった場合に行われることが好ましい。つまり、仮想ブロック単位でシステムブロックの予約の解除が行われても、予備ブロック用のシステムブロックの個数が所定予備個数よりも少なくならないことが好ましい。   Here, “when it is no longer necessary to reserve a physical block in a virtual block without defect as a system block” means, for example, a non-defective block in a virtual block with a defect in a physical block reserved as a spare block Non-defective virtual blocks are included, and the total number of spare blocks is larger than the predetermined number of system blocks for spare blocks (hereinafter referred to as “predetermined spare number”). Means. Since it is preferable that system block reservation cancellation be performed in units of virtual blocks, system block reservation cancellation is a physical block in which the number of system blocks for spare blocks exceeding a predetermined number of spare blocks forms a virtual block. This is preferably performed when the number is equal to or greater than the number (that is, two or more in the present embodiment). That is, it is preferable that the number of system blocks for spare blocks does not become smaller than the predetermined spare number even if the reservation of system blocks is canceled in units of virtual blocks.

以下、システムブロックの予約及びその解除に関するメモリコントローラ3の動作について説明する。   Hereinafter, the operation of the memory controller 3 relating to reservation and release of the system block will be described.

フォーマット(初期化)の際、不良ブロックが検出され、検出された不良ブロックに対応したチップ番号及びPBAが、不良ブロックテーブルに書き込まれる。ここで検出される不良ブロックは、初期不良ブロックであっても後発不良ブロックであっても良い。例えば、このフォーマット(初期化)の処理が、フラッシュメモリシステム1が一旦使用された後に行われる場合には、後発不良ブロックが存在することがある。そのような場合は、初期不良ブロックだけでなく後発不良ブロックも不良ブロックとして検出される。   During formatting (initialization), a defective block is detected, and a chip number and PBA corresponding to the detected defective block are written in the defective block table. The defective block detected here may be an initial defective block or a late defective block. For example, when the format (initialization) process is performed after the flash memory system 1 is once used, there may be a late defective block. In such a case, not only the initial defective block but also the subsequent defective block are detected as defective blocks.

次に、作成された不良ブロックテーブルに基づいて不良有り仮想ブロックに含まれる良品ブロックがシステムブロックとして予約される。この際、予約されるシステムブロックは、予備ブロック用のシステムブロックよりも不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルの書き込み先となるシステムブロックに優先的に割り当てられる。不良有り仮想ブロックに含まれる良品ブロックだけでは、所定個数のシステムブロックを確保することができなかった場合は、不良無し仮想ブロックに含まれる良品ブロックがシステムブロックとして予約される。このシステムブロックの予約は、仮想ブロック単位で行われる。つまり、システムブロックの予約では、不良無し仮想ブロックよりも不良有り仮想ブロックに含まれる良品ブロックが、優先的に予約される。   Next, a non-defective block included in the defective virtual block is reserved as a system block based on the created defective block table. At this time, the reserved system block is preferentially assigned to the system block to which the defective block table, the address conversion table, and the empty block table are written, rather than the spare block system block. If only a non-defective block included in the defective virtual block cannot secure a predetermined number of system blocks, the non-defective virtual block included in the non-defective virtual block is reserved as a system block. This system block reservation is performed in units of virtual blocks. That is, in the system block reservation, the non-defective virtual block included in the defective virtual block is preferentially reserved rather than the defective virtual block.

具体的には、不良有り仮想ブロック内の良品ブロックに対応したチップ番号及びPBAが、システムブロック情報に優先的に書き込まれる。もし、不良有り仮想ブロック内の良品ブロックだけでは、所定個数のシステムブロックが確保されない場合には、不良無し仮想ブロックが適宜選択され、選択された不良無し仮想ブロックに含まれる全ての物理ブロックのチップ番号及びPBAが、システムブロック情報に書き込まれる。   Specifically, the chip number and PBA corresponding to the non-defective block in the defective virtual block are preferentially written in the system block information. If a predetermined number of system blocks are not secured only with non-defective blocks in a defective virtual block, a defective virtual block is appropriately selected, and all physical block chips included in the selected defective virtual block. The number and PBA are written in the system block information.

以上のようにして、フォーマット(初期化)の際に、所定個数以上のシステムブロックが予約される。   As described above, a predetermined number or more of system blocks are reserved at the time of formatting (initialization).

不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルがシステムブロックに保存されるときは、システムブロック情報に基づいて各テーブルの保存先のシステムブロックが特定される。尚、フォーマット(初期化)の際には作成されていないテーブル(例えば、アドレス変換テーブル)については、テーブルが作成されたときにシステムブロックに保存される。   When the bad block table, the address conversion table, and the empty block table are stored in the system block, the system block as the storage destination of each table is specified based on the system block information. Note that a table (for example, an address conversion table) that is not created at the time of formatting (initialization) is stored in the system block when the table is created.

その後、後発不良ブロックが検出されたときには、SRAM8のワーク領域上で、その後発不良ブロックに対応したチップ番号及びPBAが不良ブロックテーブルに追記され、追記後の不良ブロックテーブルが、そのテーブルに対応するシステムブロック(現行ブロック)に書き込まれる。   Thereafter, when a subsequent defective block is detected, the chip number and PBA corresponding to the subsequent defective block are additionally written in the defective block table on the work area of the SRAM 8, and the defective block table after the additional writing corresponds to the table. Written to the system block (current block).

続いて、その後発不良ブロックが含まれている仮想ブロック内の良品ブロックが予備ブロック用のシステムブロックとして追加予約される。具体的には、その良品ブロックのチップ番号及びPBAが、予備ブロック情報に書き込まれる。この追加予約により予備ブロック用のシステムブロックの個数が所定予備個数より多くなった場合には、予備ブロック用のシステムブロックとして予約されている不良無し仮想ブロック内の物理ブロックに対するシステムブロックの予約が仮想ブロック単位で解除される。具体的には、システムブロックの予約が解除される不良無し仮想ブロック内の物理ブロックのチップ番号及びPBAが、予備ブロック情報から削除される。   Subsequently, the non-defective block in the virtual block including the subsequent defective block is additionally reserved as a system block for the spare block. Specifically, the chip number and PBA of the good block are written in the spare block information. If the number of system blocks for spare blocks exceeds the predetermined spare number due to this additional reservation, the system block reservation for the physical block in the non-defective virtual block reserved as the system block for spare block is virtual. It is released in block units. Specifically, the chip number and PBA of the physical block in the non-defective virtual block whose system block reservation is released are deleted from the spare block information.

また、不良ブロックテーブル、アドレス変換テーブル又は空きブロックテーブルの保存先のシステムブロックとして不良無し仮想ブロック内の物理ブロックが割り当てられている場合には、その不良無し仮想ブロック内の物理ブロックが、予備ブロック用のシステムブロックとして予約された不良有り仮想ブロック内の物理ブロックと交換されることが好ましい。上述のようなシステムブロックの予約の解除が円滑に行われるためには、このようなシステムブロックの交換が適宜行われることが好ましい。尚、このようなシステムブロックの交換は、交換対象のシステムブロックが控えブロックになったときに行われることが好ましい。   In addition, when a physical block in a virtual block without defect is assigned as a system block as a storage destination of a defective block table, an address conversion table, or an empty block table, the physical block in the virtual block without defect is a spare block It is preferable to replace the physical block in the defective virtual block reserved as a system block for use. In order to smoothly cancel the reservation of the system block as described above, it is preferable that such replacement of the system block is appropriately performed. It should be noted that such system block replacement is preferably performed when the system block to be replaced becomes a reserve block.

システムブロックの予約が解除された不良無し仮想ブロックは、ユーザーデータの書き込み先として使用可能となる。   The defect-free virtual block whose system block reservation has been canceled can be used as a user data write destination.

以上、本発明の実施形態を説明したが、これは本発明の説明のための例示であって、本発明の範囲をこの実施形態にのみ限定する趣旨ではない。本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。例えば、フラッシュメモリ2に書き込まれるシステムデータは、不良ブロックテーブル、アドレス変換テーブル及び空きブロックテーブルのうちのいずれか一つ又は二つだけであっても良いし、それら3種類のテーブルに限らず、他種のシステムデータ(例えばファームウェア)であっても良い。また、物理ブロックを示す情報は、チップ番号及びPBAの組合せに限らず、他種の情報が採用されても良い。   As mentioned above, although embodiment of this invention was described, this is an illustration for description of this invention, Comprising: It is not the meaning which limits the scope of the present invention only to this embodiment. Of course, various modifications can be made without departing from the scope of the present invention. For example, the system data written in the flash memory 2 may be any one or two of a bad block table, an address conversion table, and an empty block table, and is not limited to these three types of tables. Other types of system data (for example, firmware) may be used. Further, the information indicating the physical block is not limited to the combination of the chip number and the PBA, and other types of information may be employed.

本発明の一実施形態によるフラッシュメモリシステムの概略構成を示すブロック図である。1 is a block diagram showing a schematic configuration of a flash memory system according to an embodiment of the present invention. 論理ブロックと物理ブロック群の対応関係を示す図である。It is a figure which shows the correspondence of a logical block and a physical block group. 不良ブロックテーブルの構成例を示す図である。It is a figure which shows the structural example of a bad block table. 論理グループとアドレス変換テーブルの対応関係を示す図である。It is a figure which shows the correspondence of a logical group and an address conversion table. アドレス変換テーブル#0の構成例を示す図である。It is a figure which shows the structural example of address conversion table # 0. 空きブロックテーブルの構成例を示す図である。It is a figure which shows the structural example of an empty block table. 図7Aは、不良ブロックテーブル格納領域情報の構成例を示す図である。図7Bは、アドレス変換テーブル格納領域情報の構成例を示す図である。図7Cは、空きブロックテーブル格納領域情報の構成例を示す図である。FIG. 7A is a diagram illustrating a configuration example of bad block table storage area information. FIG. 7B is a diagram illustrating a configuration example of address conversion table storage area information. FIG. 7C is a diagram illustrating a configuration example of empty block table storage area information. 予備ブロック情報の構成例を示す図である。It is a figure which shows the structural example of spare block information.

符号の説明Explanation of symbols

1…フラッシュメモリシステム、2A,2B…フラッシュメモリ、3…メモリコントローラ、6…マイクロプロセッサ DESCRIPTION OF SYMBOLS 1 ... Flash memory system, 2A, 2B ... Flash memory, 3 ... Memory controller, 6 ... Microprocessor

Claims (7)

ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
複数個の前記フラッシュメモリ内の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータの書き込み先として使用するシステムブロックとして予約する予約手段と、
前記予約手段によって予約された前記システムブロックに対して前記システムデータを書き込むシステムデータ書き込み手段と、
前記アクセス指示で指定されるアドレスが割り当てられているセクタ単位の領域が複数個含まれる論理ブロックと、異なる前記フラッシュメモリに含まれるアドレスが同一の物理ブロックを複数個集めた物理ブロック群との対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック群に、前記アクセス指示と共に与えられるデータを書き込むデータ書き込み手段と
を備え、
前記予約手段は、不良ブロックが含まれる前記物理ブロック群内の良品ブロックを、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックよりも優先的に前記システムブロックとして予約する、
ことを特徴とするメモリコントローラ。
A memory controller for controlling access to a plurality of flash memories to be erased in physical block units in accordance with an access instruction given from a host system,
Reserving means for reserving physical blocks in the plurality of flash memories as system blocks used as system data write destinations for controlling or managing access to the plurality of flash memories;
System data writing means for writing the system data to the system block reserved by the reservation means;
Correspondence between a logical block including a plurality of sector unit areas to which an address specified by the access instruction is allocated and a physical block group including a plurality of physical blocks having the same address included in different flash memories A block management means for managing the relationship;
Data writing means for writing data given together with the access instruction to the physical block group corresponding to the logical block to which the logical access area designated as the access target area by the access instruction belongs,
The reservation means reserves a non-defective block in the physical block group including a defective block as the system block preferentially over a physical block in the physical block group that does not include a defective block.
A memory controller characterized by that.
前記予約手段は、新たな不良ブロックが検出された場合に、前記新たな不良ブロックが含まれる前記物理ブロック群内の良品ブロックを、前記システムブロックとして追加予約する、
ことを特徴とする請求項1に記載のメモリコントローラ。
The reservation unit additionally reserves a non-defective block in the physical block group including the new defective block as the system block when a new defective block is detected;
The memory controller according to claim 1.
前記システムブロックの予約を解除する予約解除手段を更に備え、
前記予約解除手段は、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックに対する前記システムブロックの予約を、不良ブロックが含まれる前記物理ブロック群内の良品ブロックに対する前記システムブロックの予約よりも優先的に解除する、
ことを特徴とする請求項1又は2に記載のメモリコントローラ。
Reservation cancellation means for canceling the reservation of the system block,
The reservation canceling means reserves the system block for a physical block in the physical block group that does not include a defective block, and reserves the system block for a non-defective block in the physical block group that includes a defective block. Release with priority,
The memory controller according to claim 1, wherein the memory controller is a memory controller.
前記予約手段は、前記物理ブロック群単位で前記システムブロックの予約を行い、
前記予約解除手段は、前記物理ブロック群単位で前記システムブロックの予約を解除する、
ことを特徴とする請求項3に記載のメモリコントローラ。
The reservation means reserves the system block in units of the physical block group,
The reservation canceling means cancels the reservation of the system block in units of the physical block group;
The memory controller according to claim 3.
請求項1乃至4のうちのいずれか1項に記載のメモリコントローラと、
前記メモリコントローラによってアクセスされる複数個のフラッシュメモリと
を備えるフラッシュメモリシステム。
A memory controller according to any one of claims 1 to 4,
A flash memory system comprising a plurality of flash memories accessed by the memory controller.
ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリの制御方法であって、
複数個の前記フラッシュメモリ内の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータの書き込み先として使用するシステムブロックとして予約する予約ステップと、
前記予約ステップによって予約された前記システムブロックに対して前記システムデータを書き込むシステムデータ書き込みステップと、
前記アクセス指示で指定されるアドレスが割り当てられているセクタ単位の領域が複数個含まれる論理ブロックと、異なる前記フラッシュメモリに含まれるアドレスが同一の物理ブロックを複数個集めた物理ブロック群との対応関係を管理するブロック管理ステップと、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック群に、前記アクセス指示と共に与えられるデータを書き込むデータ書き込みステップと
を備え、
前記予約ステップでは、不良ブロックが含まれる前記物理ブロック群内の良品ブロックが、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックよりも優先的に前記システムブロックとして予約される、
ことを特徴とするフラッシュメモリの制御方法。
A method for controlling a plurality of flash memories in which erasure is performed in units of physical blocks in accordance with an access instruction given from a host system,
Reserving step of reserving a physical block in a plurality of flash memories as a system block to be used as a system data write destination for controlling or managing access to the plurality of flash memories;
A system data writing step of writing the system data to the system block reserved by the reservation step;
Correspondence between a logical block including a plurality of sector unit areas to which an address specified by the access instruction is allocated and a physical block group including a plurality of physical blocks having the same address included in different flash memories A block management step to manage the relationship;
A data writing step of writing data given together with the access instruction to the physical block group corresponding to the logical block to which the logical access area designated as the access target area by the access instruction belongs,
In the reservation step, the non-defective block in the physical block group including the defective block is reserved as the system block preferentially over the physical block in the physical block group not including the defective block.
A method for controlling a flash memory.
前記システムブロックの予約を解除する予約解除ステップを更に備え、
前記予約解除ステップでは、不良ブロックが含まれていない前記物理ブロック群内の物理ブロックに対する前記システムブロックの予約が、不良ブロックが含まれる前記物理ブロック群内の物理ブロックに対する前記システムブロックの予約よりも優先的に解除される、
ことを特徴とする請求項6に記載のメモリコントローラ。
A reservation cancellation step of canceling the reservation of the system block;
In the reservation canceling step, the reservation of the system block for the physical block in the physical block group not including the defective block is more than the reservation of the system block for the physical block in the physical block group including the defective block. Will be released preferentially,
The memory controller according to claim 6.
JP2008090948A 2008-03-31 2008-03-31 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Active JP4702387B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008090948A JP4702387B2 (en) 2008-03-31 2008-03-31 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008090948A JP4702387B2 (en) 2008-03-31 2008-03-31 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Publications (2)

Publication Number Publication Date
JP2009245163A JP2009245163A (en) 2009-10-22
JP4702387B2 true JP4702387B2 (en) 2011-06-15

Family

ID=41306971

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008090948A Active JP4702387B2 (en) 2008-03-31 2008-03-31 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Country Status (1)

Country Link
JP (1) JP4702387B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726952A (en) * 2018-12-03 2019-05-07 Oppo(重庆)智能科技有限公司 A kind of determination method, warehouse control system and the computer storage medium in goods yard

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4840415B2 (en) * 2008-07-22 2011-12-21 Tdk株式会社 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2012118739A (en) 2010-11-30 2012-06-21 Toshiba Corp Storage device and control method
US9268685B2 (en) 2013-03-22 2016-02-23 Kabushiki Kaisha Toshiba Memory system and constructing method of virtual block
JP6819319B2 (en) * 2017-01-27 2021-01-27 日本電気株式会社 Information processing system and control method of information processing system
JP6912240B2 (en) * 2017-03-29 2021-08-04 ラピスセミコンダクタ株式会社 Memory system and memory management method
JP7074453B2 (en) * 2017-10-30 2022-05-24 キオクシア株式会社 Memory system and control method
JP7074454B2 (en) * 2017-10-30 2022-05-24 キオクシア株式会社 Computer system and control method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000132982A (en) * 1998-10-26 2000-05-12 Sony Corp Medium element, apparatus and method for recording information, and apparatus and method for reproducing information
JP2001142774A (en) * 1999-11-11 2001-05-25 Toshiba Corp Memory card and address converting method to be applied to it
WO2002046929A1 (en) * 2000-12-06 2002-06-13 Tdk Corporation Method of controlling flash memory
JP2007286892A (en) * 2006-04-17 2007-11-01 Tdk Corp Memory controller and flash memory system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000132982A (en) * 1998-10-26 2000-05-12 Sony Corp Medium element, apparatus and method for recording information, and apparatus and method for reproducing information
JP2001142774A (en) * 1999-11-11 2001-05-25 Toshiba Corp Memory card and address converting method to be applied to it
WO2002046929A1 (en) * 2000-12-06 2002-06-13 Tdk Corporation Method of controlling flash memory
JP2007286892A (en) * 2006-04-17 2007-11-01 Tdk Corp Memory controller and flash memory system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726952A (en) * 2018-12-03 2019-05-07 Oppo(重庆)智能科技有限公司 A kind of determination method, warehouse control system and the computer storage medium in goods yard

Also Published As

Publication number Publication date
JP2009245163A (en) 2009-10-22

Similar Documents

Publication Publication Date Title
JP4844639B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4702387B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4632180B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4666080B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4245585B2 (en) Memory controller, flash memory system, and flash memory control method
US8214579B2 (en) Memory controller, flash memory system with memory controller, and method of controlling flash memory
JP2009064251A (en) Semiconductor storage device, and method of controlling semiconductor storage device
JP4666081B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP5093294B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2023044518A (en) Memory system and method
JP4737223B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4840415B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4710918B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4582232B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4720891B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4687720B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4952742B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4952741B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4636046B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2012068764A (en) Memory controller, nonvolatile memory system with memory controller, and control method of nonvolatile memory
JP2010092200A (en) Memory controller, flash memory system equipped with memory controller and method of controlling flash memory
JP4760826B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4569554B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2014026376A (en) Memory controller, flash memory system, and storage control method
JP2009301491A (en) Memory controller, flash memory system equipped with memory controller, and control method for flash memory

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110208

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110221

R150 Certificate of patent or registration of utility model

Ref document number: 4702387

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150