JP4710918B2 - 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
JP4710918B2
JP4710918B2 JP2008038983A JP2008038983A JP4710918B2 JP 4710918 B2 JP4710918 B2 JP 4710918B2 JP 2008038983 A JP2008038983 A JP 2008038983A JP 2008038983 A JP2008038983 A JP 2008038983A JP 4710918 B2 JP4710918 B2 JP 4710918B2
Authority
JP
Japan
Prior art keywords
blocks
flash memory
data
flash memories
block
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
JP2008038983A
Other languages
Japanese (ja)
Other versions
JP2009199242A (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 JP2008038983A priority Critical patent/JP4710918B2/en
Publication of JP2009199242A publication Critical patent/JP2009199242A/en
Application granted granted Critical
Publication of JP4710918B2 publication Critical patent/JP4710918B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

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

フラッシュメモリを記憶媒体として用いた情報記憶装置(フラッシュメモリシステム)では、ホストシステムからアクセス指示と共に与えられるユーザデータ以外のデータもフラッシュメモリに書き込まれることが多くなっている。フラッシュメモリに書き込まれるユーザデータ以外のデータとしては、例えば、アドレス変換テーブルのようなユーザデータを管理するために必要な情報(管理情報)や、フラッシュメモリに対するアクセスを制御するコントローラのファームウェアがある。例えば、特許文献1には、ファームウェアをフラッシュメモリに書き込む技術が開示されている。特許文献2には、論理ブロックと物理ブロックとの対応関係を示したアドレス変換テーブルをフラッシュメモリに書き込む技術が開示されている。   In an information storage device (flash memory system) using a flash memory as a storage medium, data other than user data given together with an access instruction from a host system is often written to the flash memory. Examples of data other than user data written to the flash memory include information necessary for managing user data such as an address conversion table (management information) and firmware of a controller that controls access to the flash memory. For example, Patent Document 1 discloses a technique for writing firmware into a flash memory. Patent Document 2 discloses a technique for writing an address conversion table indicating a correspondence relationship between a logical block and a physical block into a flash memory.

特開2004−280287号公報JP 2004-280287 A 特開2001−142774号公報JP 2001-142774 A

ところで、フラッシュメモリシステムに対するホストシステムからのアクセス速度を向上させるために、複数のフラッシュメモリを備え、これらのフラッシュメモリに並行して、又はインターリーブ方式でアクセスできるようにしたフラッシュメモリシステムが知られている。このようなフラッシュメモリシステムでは、例えば、異なるフラッシュメモリに属する複数個の物理ブロックで仮想ブロックが形成され、この仮想ブロックに対して論理ブロックが割り当てられる。この場合、各フラッシュメモリに含まれるユーザデータ用ブロック(ユーザデータの書き込み先として使用することができる物理ブロック)の個数は、均等であることが好ましい。   By the way, in order to improve the access speed from the host system to the flash memory system, there is known a flash memory system which includes a plurality of flash memories and can access these flash memories in parallel or in an interleaved manner. Yes. In such a flash memory system, for example, a virtual block is formed by a plurality of physical blocks belonging to different flash memories, and a logical block is allocated to the virtual block. In this case, the number of user data blocks (physical blocks that can be used as user data write destinations) included in each flash memory is preferably equal.

また、上述したような仮想ブロックが形成されない場合であっても、各フラッシュメモリに対して同じ容量の論理的な領域が割り当てられるような場合には、各フラッシュメモリに含まれるユーザデータ用ブロックの個数は均等であることが好ましい。   Even when the virtual block as described above is not formed, if a logical area of the same capacity is allocated to each flash memory, the user data block included in each flash memory The number is preferably equal.

そこで、本発明は、各フラッシュメモリに含まれるユーザデータ用ブロックの個数が均等になるように記憶領域を管理する技術を提供することを目的とする。   Accordingly, an object of the present invention is to provide a technique for managing storage areas so that the number of user data blocks included in each flash memory is equal.

本発明の第一の観点に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
それぞれの前記フラッシュメモリに含まれる不良ブロックの個数を計数する計数手段と、
複数個の前記フラッシュメモリ内の一部の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータが書き込まれるシステムブロックに割り当てるシステムブロック管理手段と、
1個又は複数個の前記システムブロックに、1個のデータとして又は複数個のデータに分割して前記システムデータを書き込むシステムデータ書き込み手段と、
前記システムブロックから前記システムデータを読み出すシステムデータ読み出し手段と、
前記システムデータに基づいて複数個の前記フラッシュメモリに対するアクセスを制御するアクセス制御手段と、
を備える。前記システムブロック管理手段は、それぞれの前記フラッシュメモリに含まれる不良ブロックの個数と前記システムブロックの個数との総和が均等化されるように、前記システムブロックの割り当てを行う。
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,
Counting means for counting the number of defective blocks included in each of the flash memories;
System block management means for allocating some physical blocks in the plurality of flash memories to system blocks in which system data for controlling or managing access to the plurality of flash memories is written;
System data writing means for writing the system data into one or a plurality of the system blocks as one data or divided into a plurality of data;
System data reading means for reading the system data from the system block;
Access control means for controlling access to the plurality of flash memories based on the system data;
Is provided. The system block management means assigns the system blocks so that the sum of the number of defective blocks and the number of system blocks included in each flash memory is equalized.

好適な実施形態では、前記システムデータには、複数個の前記フラッシュメモリに対するアクセスを制御するためのファームウェアが含まれる。前記システムデータ読み出し手段は、起動時に前記システムブロックから前記ファームウェアを読み出す。   In a preferred embodiment, the system data includes firmware for controlling access to the plurality of flash memories. The system data reading means reads the firmware from the system block at startup.

好適な実施形態では、前記アクセス制御手段は、異なる前記フラッシュメモリに属する複数個の物理ブロックを含むグループ単位で、複数個の前記フラッシュメモリに対するアクセスを制御する。   In a preferred embodiment, the access control means controls access to the plurality of flash memories in a group unit including a plurality of physical blocks belonging to different flash memories.

好適な実施形態では、前記システムブロック管理手段は、複数個の前記フラッシュメモリに含まれる不良ブロックの個数が変化したときに、それぞれの前記フラッシュメモリに含まれる不良ブロックの個数と前記システムブロックの個数との総和が均等化されるように、前記システムブロックの割り当てを変更する。   In a preferred embodiment, when the number of defective blocks included in a plurality of the flash memories is changed, the system block management unit is configured to determine the number of defective blocks and the number of system blocks included in each of the flash memories. The allocation of the system blocks is changed so that the sum of the system blocks is equalized.

本発明の第二の観点に従うフラッシュメモリシステムは、上述のメモリコントローラと、前記メモリコントローラによってアクセスされる複数個のフラッシュメモリとを備える。   A flash memory system according to a second aspect of the present invention includes the above-described memory controller and a plurality of flash memories accessed by the memory controller.

本発明の第三の観点に従う制御方法は、ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリの制御方法であって、
それぞれの前記フラッシュメモリに含まれる不良ブロックの個数を計数する計数ステップと、
複数個の前記フラッシュメモリ内の一部の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータが書き込まれるシステムブロックに割り当てるシステムブロック管理ステップと、
1個又は複数個の前記システムブロックに、1個のデータとして又は複数個のデータに分割して前記システムデータを書き込むシステムデータ書き込みステップと、
前記システムブロックから前記システムデータを読み出すシステムデータ読み出しステップと、
前記システムデータに基づいて複数個の前記フラッシュメモリに対するアクセスを制御するアクセス制御ステップと、
を備える。前記システムブロック管理ステップでは、それぞれの前記フラッシュメモリに含まれる不良ブロックの個数と前記システムブロックの個数との総和が均等化されるように、前記システムブロックの割り当てが行われる。
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,
A counting step for counting the number of defective blocks included in each of the flash memories;
A system block management step for allocating some physical blocks in the plurality of flash memories to system blocks in which system data for controlling or managing access to the plurality of flash memories is written;
A system data writing step of writing the system data into one or a plurality of system blocks as one data or divided into a plurality of data;
A system data read step for reading the system data from the system block;
An access control step for controlling access to the plurality of flash memories based on the system data;
Is provided. In the system block management step, the system blocks are allocated so that the sum of the number of defective blocks and the number of system blocks included in each flash memory is equalized.

各フラッシュメモリに含まれるユーザデータ用ブロックの個数を均等にすることができる。   The number of user data blocks included in each flash memory can be made equal.

図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に示すように、マイクロプロセッサ6が読み込むプログラムコードが格納されるファームウェア領域Aと、フラッシュメモリインターフェースブロック10が読み込むシーケンスコードが格納されるファームウェア領域Bと、アドレス変換テーブルや空きブロック検索テーブル等が保持されるワーク領域とがSRAM8上に割り当てられる。ここで、アドレス変換テーブルは、論理ブロックと物理ブロックとの対応関係を示したテーブルであり、空きブロック検索テーブルは、消去状態の物理ブロック(又は、有効なデータが保存されていない物理ブロック)を検索するためのテーブルである。   An SRAM (Static Random Access Memory) 8 is a volatile storage element and is used as an area for storing firmware or an area for temporarily storing data necessary for controlling the flash memory 2. . For example, as shown in FIG. 2, a firmware area A in which a program code read by the microprocessor 6 is stored, a firmware area B in which a sequence code read by the flash memory interface block 10 is stored, an address conversion table and an empty block search A work area in which a table or the like is held is allocated on the SRAM 8. Here, the address conversion table is a table showing the correspondence between logical blocks and physical blocks, and the free block search table is an erased physical block (or a physical block in which valid data is not stored). This is a table for searching.

ROM12は、不揮発性の記憶素子であり、本実施形態では、起動時に必要な最低限のプログラムコードとシーケンスコードだけが保存されている。フラッシュメモリ2の制御に必要な全てのプログラムコードとシーケンスコードは、フラッシュメモリ2に保存されている。従って、フラッシュメモリ2の制御に必要な全てのプログラムコードとシーケンスコードは、起動時に、フラッシュメモリ2から読み出され、SRAM8上のファームウェア領域に格納される。つまり、ROM12には、フラッシュメモリ2から読み出されたプログラムコードとシーケンスコードがSRAM8上のファームウェア領域に格納されるまでの間に、マイクロプロセッサ6とフラッシュメモリインターフェースブロック10に読み込まれるプログラムコードとシーケンスコードだけが保存されている。   The ROM 12 is a non-volatile storage element, and in this embodiment, only the minimum program code and sequence code required at the time of activation are stored. All program codes and sequence codes necessary for controlling the flash memory 2 are stored in the flash memory 2. Accordingly, all program codes and sequence codes necessary for controlling the flash memory 2 are read from the flash memory 2 and stored in the firmware area on the SRAM 8 at the time of activation. In other words, the ROM 12 stores the program code and sequence read by the microprocessor 6 and the flash memory interface block 10 until the program code and sequence code read from the flash memory 2 are stored in the firmware area on the SRAM 8. Only the code is stored.

尚、ROM12に、フラッシュメモリ2の制御に必要な全てのプログラムコードとシーケンスコードが格納されているような場合には、SRAM8上にファームウェア領域を割り当てなくてもよい。   In the case where all program codes and sequence codes necessary for controlling the flash memory 2 are stored in the ROM 12, a firmware area may not be allocated on the SRAM 8.

バッファ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は、SRAM8上のファームウェア領域B又はROM12から読み込んだシーケンスコードに従って、フラッシュメモリ2に対する各種の処理を実行する。この処理では、フラッシュメモリインターフェースブロック10とフラッシュメモリ2との間で、データ、アドレス情報、ステータス情報、内部コマンド等の授受が、内部バス14を介して行なわれる。ここで、内部コマンドとは、メモリコントローラ3がフラッシュメモリ2に処理の実行を指示するためのコマンドであり、フラッシュメモリ2は、メモリコントローラ3から与えられる内部コマンドに従って動作する。   The flash memory interface block 10 executes various processes for the flash memory 2 according to the sequence code read from the firmware area B on the SRAM 8 or the ROM 12. In this process, 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は、SRAM8上のファームウェア領域A又はROM12から読み込んだプログラムコードに従って、メモリコントローラ3の全体の動作を制御する。   The microprocessor 6 controls the entire operation of the memory controller 3 in accordance with the program code read from the firmware area A on the SRAM 8 or the ROM 12.

フラッシュメモリ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個の物理ページで構成されている。冗長領域は、誤り訂正符号(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 is composed of a 2048-byte user area and a 64-byte redundant area, and one physical block is composed of 64 physical pages. 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 to which data cannot be normally written includes an initial defective physical block that is defective from the time of shipment, and a late defective physical block that has deteriorated to become a defective block after use. There are blocks. For an initial defective physical block, a block status (flag) indicating a defective block is written by the manufacturer. Some manufacturers also write a block status (flag) indicating the initial defective physical block in the user area.

本実施形態では、異なるフラッシュメモリ2A,2Bに属する2個の物理ブロックで仮想ブロックが形成され、この仮想ブロックに対して、論理ブロックが割り当てられる。従って、ホストシステム4から書き込みを指示するアクセス指示が与えられた場合、メモリコントローラ3は、そのアクセス指示で指定されるアクセス対象の領域が属する論理ブロックと対応関係にある仮想ブロックを特定し、その仮想ブロックを形成する2個の物理ブロックに対して、そのアクセス指示に対応するデータを書き込む。このデータ書き込み処理で、メモリコントローラ3は、フラッシュメモリ2Aに属する物理ブロック対するデータの書き込みとフラッシュメモリ2Bに属する物理ブロック対するデータの書き込みを並行して行っても良いし、フラッシュメモリ2Aに属する物理ブロック対するデータの書き込みとフラッシュメモリ2Bに属する物理ブロック対するデータの書き込みを交互に行っても良い。後者は、いわゆるインターリーブ方式であり、この方式では、一方のフラッシュメモリがビジー状態のときにビジー状態ではない他方のフラッシュメモリに対するデータの書き込みが行われる。   In this embodiment, a virtual block is formed by two physical blocks belonging to different flash memories 2A and 2B, and a logical block is assigned 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 the physical controller belonging to the flash memory 2A. Data writing to a block and data writing to a 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.

次に、SRAM8のファームウェア領域に格納されるファームウェアについて、図2を参照して説明する。なお、以下の説明では、ROM12に予め保存されている、起動時に必要な最低限のファームウェアを、フラッシュメモリ2に保存されるファームウェアと区別するために、「起動用ファームウェア」と言う。   Next, firmware stored in the firmware area of the SRAM 8 will be described with reference to FIG. In the following description, the minimum firmware necessary for startup stored in the ROM 12 in advance is referred to as “startup firmware” in order to distinguish it from firmware stored in the flash memory 2.

本実施形態では、起動時に必要な最低限のファームウェア(起動用ファームウェア)だけしかROM12に保存されていない。従って、メモリコントローラ3は、起動時に、起動用ファームウェアを実行することで、フラッシュメモリ2に保存されているファームウェアを読み出し、SRAM8のファームウェア領域に格納しなければならない。その後、メモリコントローラ3は、SRAM8のファームウェア領域に格納されたファームウェアに基づいて動作する。尚、ファームウェアをROM12に保存するか又はフラッシュメモリ2に保存するかについては、メモリコントローラ3を設計する際に設計者が適宜することができる。また、本実施形態では、マイクロプロセッサ6が読み込むプログラムコードと、フラッシュメモリインターフェースブロック10が読み込むシーケンスコードとが含まれるファームウェアがフラッシュメモリ2に保存されるが、このファームウェアのうちのプログラムコードだけ又はシーケンスコードだけがフラッシュメモリ2に保存されるようにしてもよい。   In the present embodiment, only the minimum firmware (startup firmware) necessary at the time of startup is stored in the ROM 12. Therefore, the memory controller 3 must read the firmware stored in the flash memory 2 by executing the startup firmware at the time of startup and store it in the firmware area of the SRAM 8. Thereafter, the memory controller 3 operates based on the firmware stored in the firmware area of the SRAM 8. Whether the firmware is stored in the ROM 12 or the flash memory 2 can be appropriately determined by the designer when designing the memory controller 3. In this embodiment, firmware including a program code read by the microprocessor 6 and a sequence code read by the flash memory interface block 10 is stored in the flash memory 2, but only the program code or the sequence of the firmware is stored. Only the code may be stored in the flash memory 2.

SRAM8のファームウェア領域Aに格納されるプログラムコードは、マイクロプロセッサ6に読み込まれるファームウェアであり、マイクロプロセッサ6は、このプログラムコードに基づいて動作する。例えば、マイクロプロセッサ6は、このプログラムコードに基づいて、ホストシステムから与えられるアクセス指示によって特定されるアクセス対象の領域が属する論理ブロック及びこの論理ブロックと対応する物理ブロックを求めたり、データの書き込み先となる空きブロックを検索したりする。   The program code stored in the firmware area A of the SRAM 8 is firmware that is read into the microprocessor 6, and the microprocessor 6 operates based on this program code. For example, the microprocessor 6 obtains the logical block to which the access target area specified by the access instruction given from the host system belongs and the physical block corresponding to the logical block based on the program code, or writes the data write destination. Search for free blocks.

SRAM8のファームウェア領域Bに格納されるシーケンスコードは、フラッシュメモリインターフェースブロック10に読み込まれるファームウェアであり、フラッシュメモリインターフェースブロック10は、このシーケンスコードに基づいて動作する。シーケンスコードは、フラッシュメモリインターフェースブロック10が実行するシーケンス処理毎に設定された複数個のコードから成るコードセットを複数セット含んでおり、フラッシュメモリインターフェースブロック10は、このコードセットに基づいてフラッシュメモリ2A,2Bに対する各種のシーケンス処理を実行する。フラッシュメモリインターフェースブロック10がシーケンス処理を実行するときは、実行する処理に応じたコードセットが選択され、選択されたコードセットに含まれるコードがフラッシュメモリインターフェースブロック10に読み込まれる。   The sequence code stored in the firmware area B of the SRAM 8 is firmware that is read into the flash memory interface block 10, and the flash memory interface block 10 operates based on this sequence code. The sequence code includes a plurality of code sets composed of a plurality of codes set for each sequence process executed by the flash memory interface block 10, and the flash memory interface block 10 uses the flash memory 2A based on this code set. , 2B, various sequence processes are executed. When the flash memory interface block 10 executes a sequence process, a code set corresponding to the process to be executed is selected, and a code included in the selected code set is read into the flash memory interface block 10.

各コードセットは、フォーマット処理、書き込み処理等のシーケンス処理に対応している。コードセットに含まれる各コードには、フラッシュメモリ2A,2Bに対して制御信号、コマンド、アドレス又は書き込みデータ等を出力することを指示するものや、分岐条件に基づいた分岐先を指示するものや、フラッシュメモリ2A,2Bのビジー状態が解除されるのを待つことを指示するもの等がある。   Each code set corresponds to sequence processing such as formatting processing and writing processing. Each code included in the code set is for instructing the flash memory 2A, 2B to output a control signal, command, address, write data, or the like, or for instructing a branch destination based on the branch condition, There is an instruction to wait for the busy state of the flash memories 2A and 2B to be released.

また、コードセットに含まれるコードは、通常はアドレスの順番で読み出されるが、分岐先を指示するコードが含まれている場合は、分岐先を指示するコマンドコードに従って次に読み出すコードが決定される。   In addition, codes included in the code set are normally read in the order of addresses, but when a code indicating a branch destination is included, a code to be read next is determined according to a command code indicating a branch destination. .

どのコードセットも、最終的に終了コードに分岐するようになっている。この終了コードに分岐することにより、各コードセットに対応するシーケンス処理は終了する。   Every code set finally branches to an exit code. By branching to this end code, the sequence processing corresponding to each code set ends.

以下、本実施形態のメモリコントローラ3の動作を説明する。   Hereinafter, the operation of the memory controller 3 of the present embodiment will be described.

メモリコントローラ3は、起動時に、ROM12に記憶されている起動用ファームウェアに基づいて動作し、ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれているかどうかを判断する。例えば、フラッシュメモリ2A又は2Bの先頭ブロックに、ファームウェアが書き込まれている場所(例えば、ファームウェアが書き込まれている物理ブロックが属するフラッシュメモリのチップ番号及びその物理ブロックの物理ブロックアドレス)を示す情報(以下、「ファームウェア場所情報」と言う)が書き込まれているか否かにより判断する。つまり、ファームウェア場所情報が書き込まれている場合には、ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれていると判断され、ファームウェア場所情報が書き込まれていない場合には、ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれていないと判断される。なお、フラッシュメモリ2A又は2Bの先頭ブロックにファームウェア場所情報が書き込まれるのは、一般に、先頭ブロックは、不良ブロックではないことが製造メーカによって保証されているためである。このため、通常、先頭ブロックには、属性情報(例えば、フラッシュメモリシステム1がどういうものであって、どういうフラッシュメモリが幾つ搭載されているか等を表す情報)が書き込まれていることが多く、先頭ブロックにユーザデータ(ホストシステムから与えられるアクセス指示に従って書き込まれるデータ)書き込まれることは殆ど無い。   At startup, the memory controller 3 operates based on the startup firmware stored in the ROM 12, and determines whether the firmware is written in the flash memory 2A and / or 2B. For example, information indicating the location where the firmware is written in the first block of the flash memory 2A or 2B (for example, the chip number of the flash memory to which the physical block to which the firmware is written and the physical block address of the physical block) Hereinafter, this is referred to as “firmware location information”). That is, when the firmware location information is written, it is determined that the firmware is written in the flash memory 2A and / or 2B. When the firmware location information is not written, the firmware is stored in the flash memory 2A and the flash memory 2A. It is determined that data is not written in 2B. Note that the firmware location information is written in the first block of the flash memory 2A or 2B because, in general, the manufacturer guarantees that the first block is not a defective block. 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 to the block.

以下、その後の動作を、ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれていると判断された場合と、書き込まれていないと判断された場合とに分けて、説明する。   Hereinafter, the subsequent operation will be described separately for the case where it is determined that the firmware is written in the flash memory 2A and / or 2B and the case where it is determined that the firmware is not written.

<ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれていないと判断された場合>。   <When it is determined that the firmware has not been written in the flash memory 2A and / or 2B>.

メモリコントローラ3は、ホストシステム4からファームウェアが与えられるのを待つ待機状態になる。
図3Aに示すように、ホストシステム4からファームウェアが与えられると、メモリコントローラ3は、そのファームウェアを、バッファ9を介してSRAM8内のファームウェア領域に書き込む。この後は、メモリコントローラ3は、SRAM8に書き込まれたファームウェアに基づいて動作する。
The memory controller 3 enters a standby state waiting for the firmware from the host system 4.
As shown in FIG. 3A, when the firmware is given from the host system 4, the memory controller 3 writes the firmware into the firmware area in the SRAM 8 via the buffer 9. Thereafter, the memory controller 3 operates based on the firmware written in the SRAM 8.

次に、ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれていないと判断された場合に行われる(処理A)乃至(処理C)について説明する。   Next, (Processing A) to (Processing C) performed when it is determined that the firmware has not been written in the flash memory 2A and / or 2B will be described.

(処理A)フラッシュメモリ2のフォーマット処理が済んでいるか否かが判断される。フラッシュメモリ2のフォーマット処理が済んでいない場合は、フラッシュメモリ2のフォーマット処理が行われる。このフォーマット処理では、フラッシュメモリ2に対するアクセスを管理するために必要な管理情報(例えば、不良ブロックテーブル等)が作成され、作成された管理情報がフラッシュメモリ2に書き込まれる。例えば、管理情報として不良ブロックテーブルを作成する場合について説明する。この作成処理では、フラッシュメモリ2A,2B内の各物理ブロックの冗長領域に記憶されているブロックステータス(フラグ)が順次読み出され、読み出されたブロックステータス(フラグ)に基づいてフラッシュメモリ2A,2B内の各物理ブロックが不良ブロックであるか否かが判断される。不良ブロックであると判断された物理ブロックの物理ブロックアドレス及びその物理ブロックが属するフラッシュメモリ2を示す情報がSRAM8のワーク領域に書き込まれる。このようにして不良ブロックを管理するための不良ブロックテーブルが作成される。この不良ブロックテーブルにより、それぞれのフラッシュメモリ2A,2B内の不良ブロックが特定され、更に、それぞれのフラッシュメモリ2A,2Bに含まれる不良ブロックの個数が求められる。   (Processing A) It is determined whether or not the formatting process of the flash memory 2 has been completed. If the formatting process of the flash memory 2 has not been completed, the formatting process of the flash memory 2 is performed. In this formatting process, management information (for example, a defective block table) necessary for managing access to the flash memory 2 is created, and the created management information is written to the flash memory 2. For example, a case where a bad block table is created as management information will be described. In this creation process, the block status (flag) stored in the redundant area of each physical block in the flash memory 2A, 2B is sequentially read, and the flash memory 2A, 2A, 2B is read based on the read block status (flag). It is determined whether each physical block in 2B is a bad block. The physical block address of the physical block determined to be a bad block and information indicating the flash memory 2 to which the physical block belongs are written in the work area of the SRAM 8. In this way, a bad block table for managing bad blocks is created. From this defective block table, defective blocks in the respective flash memories 2A and 2B are specified, and the number of defective blocks included in the respective flash memories 2A and 2B is obtained.

(処理B)ファームウェア及び管理情報が、図3Aに示すように、バッファ9を介して、1個のデータとして又は複数個のデータとして、2個のフラッシュメモリ2A及び2B内の1個又は複数個の物理ブロックに書き込まれる。ここで、ファームウェアについては、プログラムコードとシーケンスコードが同じ物理ブロックに書き込まれるようにしても良いが、プログラムコードとシーケンスコードが別の物理ブロックに書き込まれるようにしてもよい。管理情報について、不良ブロックテーブル、空きブロック検索テーブル及びアドレス変換テーブル等の各テーブルがテーブル毎に異なる物理ブロックに書き込まれるようにしてもよい。更に、アドレス変換テーブルのようなサイズの大きいテーブルについては、複数のテーブルに分割して異なる物理ブロックに書き込まれるようにしてもよい。ファームウェア及び管理情報を書き込むときには、それぞれのフラッシュメモリ2A,2Bに含まれる不良ブロックの個数と、管理情報及び/又はファームウェアが書き込まれる物理ブロックの個数との総和が、均等化されるように、管理情報及びファームウェアの書き込み先となるフラッシュメモリ2A又は2B内の物理ブロックが決定される。つまり、不良ブロックの個数と管理情報及び/又はファームウェアが書き込まれる物理ブロックの個数に関するフラッシュメモリ2A内の総和と、フラッシュメモリ2B内の総和とが均等化されるように、管理情報及びファームウェアの書き込み先となる物理ブロックの割り振りが決定される。   (Processing B) As shown in FIG. 3A, the firmware and management information are one or more in the two flash memories 2A and 2B via the buffer 9 as one data or as a plurality of data. Written to the physical block. Here, as for the firmware, the program code and the sequence code may be written in the same physical block, but the program code and the sequence code may be written in different physical blocks. Regarding the management information, each table such as a bad block table, a free block search table, and an address conversion table may be written in a different physical block for each table. Furthermore, a large table such as an address conversion table may be divided into a plurality of tables and written in different physical blocks. When writing firmware and management information, management is performed so that the sum of the number of defective blocks included in each of the flash memories 2A and 2B and the number of physical blocks to which management information and / or firmware is written is equalized. A physical block in the flash memory 2A or 2B to which information and firmware are written is determined. In other words, the management information and the firmware are written so that the total in the flash memory 2A and the total in the flash memory 2B are equalized with respect to the number of defective blocks and the management information and / or the number of physical blocks to which the firmware is written. The allocation of the physical block ahead is determined.

例えば、図4に示すように、フラッシュメモリ2Aに、不良ブロックが2個存在し、フラッシュメモリ2Bに、不良ブロックが1個存在しているとする。また、ファームウェアを保存するために2個の物理ブロックが使用され、管理情報を保存するために3個の物理ブロックが使用されるとする。物理ブロックの容量に合わせて、ファームウェアは、2個のデータ(ファームウェアパート#0及び#1)に分割され、管理情報は、3個のデータ(管理情報パート#0〜#2)に分割される。但し、頻繁に更新される管理情報については物理ページ容量に合わせて分割され、更新される毎に、更新された管理情報が同じ物理ブロック内の空きページ(データが書き込まれていない物理ページ)に順次書き込まれていくようにすることが好ましい。   For example, as shown in FIG. 4, it is assumed that two defective blocks exist in the flash memory 2A and one defective block exists in the flash memory 2B. Further, it is assumed that two physical blocks are used for storing firmware and three physical blocks are used for storing management information. The firmware is divided into two data (firmware parts # 0 and # 1) according to the capacity of the physical block, and the management information is divided into three data (management information parts # 0 to # 2). . However, frequently updated management information is divided in accordance with the physical page capacity, and each time the management information is updated, the updated management information is divided into empty pages (physical pages in which no data is written) in the same physical block. It is preferable to write sequentially.

この例では、フラッシュメモリ2Aの方がフラッシュメモリ2Bより不良ブロックの個数が1個多いため、フラッシュメモリ2Bに属する物理ブロックの方がフラッシュメモリ2Aに属する物理ブロックより1個多くなるように、ファームウェア又は管理情報の書き込み先として使用される物理ブロックが決定される。つまり、これら5個の物理ブロックのうち、2個の物理ブロックがフラッシュメモリ2Aに属し、残りの3個の物理ブロックがフラッシュメモリ2Bに属するように、ファームウェア及び管理情報の書き込み先の物理ブロックが決定される。このようにファームウェア及び管理情報の書き込み先の物理ブロックが決定された場合、不良ブロックの個数と、管理情報及び/又はファームウェアが書き込まれる物理ブロックの個数との総和は、フラッシュメモリ2Aもフラッシュメモリ2Bも4個になる。   In this example, the flash memory 2A has one more defective block than the flash memory 2B. Therefore, the firmware blocks so that the physical block belonging to the flash memory 2B is one more than the physical block belonging to the flash memory 2A. Alternatively, a physical block used as a management information write destination is determined. That is, among these five physical blocks, two physical blocks belong to the flash memory 2A and the remaining three physical blocks belong to the flash memory 2B. It is determined. When the physical block to which the firmware and management information is written is thus determined, the sum of the number of defective blocks and the number of physical blocks to which the management information and / or firmware is written is determined by the flash memory 2A and the flash memory 2B. Will also be four.

仮に、フラッシュメモリ2Aの不良ブロックの個数がフラッシュメモリ2Bの不良ブロックの個数より3個多いとすれば、フラッシュメモリ2Bに属する物理ブロックの方がフラッシュメモリ2Aに属する物理ブロックより3個多くなるように、ファームウェア又は管理情報の書き込み先として使用される物理ブロックが決定される。   If the number of defective blocks in the flash memory 2A is three more than the number of defective blocks in the flash memory 2B, the number of physical blocks belonging to the flash memory 2B is three more than the physical blocks belonging to the flash memory 2A. In addition, a physical block to be used as a firmware or management information write destination is determined.

尚、フォーマット処理の際には作成されていない管理情報(例えば、アドレス変換テーブル)の書き込み先となる物理ブロックについては、書き込み先の物理ブロックが予約されるだけで、フォーマット処理のときに管理情報の書き込みが行われない。このような管理情報については、管理情報が作成されたときに、予約されていた物理ブロックにその管理情報が書き込まれるようにすればよい。   For the physical block that becomes the write destination of the management information (for example, the address conversion table) that has not been created at the time of the format process, only the write destination physical block is reserved, and the management information at the time of the format process Is not written. With respect to such management information, the management information may be written into the reserved physical block when the management information is created.

また、ファームウェア全体をROM12に保存する場合には、フラッシュメモリ2A,2Bに含まれる不良ブロックの個数と、管理情報が書き込まれる物理ブロックの個数との総和が、均等化されるように、管理情報の書き込み先となるフラッシュメモリ2A又は2B内の物理ブロックが決定される。   When the entire firmware is stored in the ROM 12, the management information is set so that the sum of the number of defective blocks included in the flash memories 2A and 2B and the number of physical blocks to which management information is written is equalized. The physical block in the flash memory 2A or 2B to be written to is determined.

また、管理情報がフラッシュメモリ2ではなく別途設けられた不揮発性メモリに保存されるような場合には、フラッシュメモリ2A,2Bに含まれる不良ブロックの個数と、ファームウェアが書き込まれる物理ブロックの個数との総和が、均等化されるように、ファームウェアの書き込み先となるフラッシュメモリ2A又は2B内の物理ブロックが決定される。   Further, when the management information is stored in a non-volatile memory provided separately from the flash memory 2, the number of defective blocks included in the flash memories 2A and 2B, the number of physical blocks in which firmware is written, The physical block in the flash memory 2A or 2B to which the firmware is to be written is determined so that the sum of the two is equalized.

(処理C)フラッシュメモリ2A又はフラッシュメモリ2Bの先頭ブロックに、管理情報が書き込まれている場所を示す情報(以下、管理情報場所情報)と、ファームウェアが書き込まれている場所を示すファームウェア場所情報が書き込まれる。管理情報場所情報は、管理情報の書き込み先として決定された物理ブロックを特定するための情報であり、例えば、その物理ブロックが属するフラッシュメモリのチップ番号及びその物理ブロックの物理ブロックアドレスを示す情報が含まれる。ファームウェア場所情報は、ファームウェアの書き込み先として決定されて物理ブロックを特定するための情報であり、例えば、その物理ブロックが属するフラッシュメモリのチップ番号及びその物理ブロックの物理ブロックアドレスを示す情報が含まれる。   (Process C) Information indicating the location where management information is written in the first block of the flash memory 2A or the flash memory 2B (hereinafter referred to as management information location information) and firmware location information indicating the location where the firmware is written Written. The management information location information is information for specifying the physical block determined as the management information write destination. For example, the information indicating the chip number of the flash memory to which the physical block belongs and the physical block address of the physical block. included. The firmware location information is information for determining a physical block determined as a firmware write destination, and includes, for example, information indicating the chip number of the flash memory to which the physical block belongs and the physical block address of the physical block. .

尚、フラッシュメモリ2の先頭ブロックに保存される属性情報も管理情報に含まれるが、本実施形態では、フラッシュメモリ2Aとフラッシュメモリ2Bの双方の先頭ブロックが属性情報の書き込み先として使用されるため(それぞれのフラッシュメモリ2に属性情報の書き込み先の物理ブロックが1個ずつ割り当てられるため)、属性情報が保存される物理ブロックに関する説明を割愛した。   Note that the attribute information stored in the head block of the flash memory 2 is also included in the management information. However, in this embodiment, the head blocks of both the flash memory 2A and the flash memory 2B are used as attribute information write destinations. The description of the physical block in which the attribute information is stored has been omitted (because one physical block to which attribute information is written is assigned to each flash memory 2).

<ファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれていると判断された場合>。   <When it is determined that the firmware is written in the flash memory 2A and / or 2B>.

図3Bに示すように、フラッシュメモリ2A又はフラッシュメモリ2Bの先頭ブロックに書き込まれているファームウェア場所情報に基づいてファームウェアが書き込まれている場所が特定され、特定された場所からファームウェアが読み出されSRAM8のファームウェア領域に書き込まれる。   As shown in FIG. 3B, the location where the firmware is written is specified based on the firmware location information written in the first block of the flash memory 2A or the flash memory 2B, and the firmware is read out from the specified location. Written to the firmware area.

尚、管理情報については、その都度、必要な管理情報だけがフラッシュメモリ2A及び/又は2Bから読み出され、SRAM8のワーク領域に書き込まれる。読み出された管理情報の内容がSRAM8上で更新された場合には、更新された管理情報がフラッシュメモリ2A及び/又は2に書き込まれる。管理情報につては、このような更新処理が行われるため、通常、管理情報を保存するために必要な最低限の物理ブロックの個数よりも管理情報の書き込み先として使用可能な物理ブロックの個数の方が多く割り当てられる。つまり、管理情報の書き込み先の物理ブロックについては、予備の物理ブロックを含めて管理情報の書き込み先の物理ブロックが決定される。   As for the management information, only the necessary management information is read from the flash memory 2A and / or 2B each time and written into the work area of the SRAM 8. When the content of the read management information is updated on the SRAM 8, the updated management information is written to the flash memories 2A and / or 2. Since such update processing is performed for management information, the number of physical blocks that can be used as the write destination of management information is usually larger than the minimum number of physical blocks necessary for storing management information. Is assigned more. That is, for the management information write destination physical block, the management information write destination physical block including the spare physical block is determined.

以上、本発明の実施形態を説明したが、これは本発明の説明のための例示であって、本発明の範囲をこの実施形態にのみ限定する趣旨ではない。本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。   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.

例えば、フラッシュメモリ2A及び/又は2Bに管理情報及びファームウェアが書き込まれた後に、フラッシュメモリ2A,2Bにおいて不良ブロックの個数が増え、フラッシュメモリ2Aに含まれる不良ブロックの個数とフラッシュメモリ2Bに含まれる不良ブロックの個数の差が変化することがある。そこで、メモリコントローラ3は、管理情報及びファームウェアがフラッシュメモリ2A及び/又は2Bに書き込まれた後、フラッシュメモリ2Aに含まれる不良ブロックの個数とフラッシュメモリ2Bに含まれる不良ブロックの個数の差が変化した場合には、それぞれのフラッシュメモリ2A,2Bに含まれる不良ブロックの個数と、管理情報及び/又はファームウェアが書込まれている物理ブロックの個数との総和が、均等化されているように、管理情報及び/又はファームウェアの書き込み先となる物理ブロックの割り当てが変更されるようにしてもよい。この変更では、均等化するために必要な最低限の個数の物理ブロックだけが変更されることが好ましい。また、この変更により管理情報及び/又はファームウェアの書き込み先でなくなった物理ブロックの記憶データは、この変更により新たに管理情報及び/又はファームウェアの書き込み先になった物理ブロックに、又はこの変更に関わらず管理情報及び/又はファームウェアの書き込み先のままであった物理ブロックに転送されることが好ましい。   For example, after management information and firmware are written in the flash memories 2A and / or 2B, the number of defective blocks in the flash memories 2A and 2B increases, and the number of defective blocks included in the flash memory 2A and the flash memory 2B are included. The difference in the number of bad blocks may change. Therefore, the memory controller 3 changes the difference between the number of defective blocks included in the flash memory 2A and the number of defective blocks included in the flash memory 2B after management information and firmware are written into the flash memories 2A and / or 2B. In this case, the total sum of the number of defective blocks included in the respective flash memories 2A and 2B and the number of physical blocks in which management information and / or firmware is written is equalized. Management information and / or allocation of a physical block to which firmware is written may be changed. In this change, it is preferable that only the minimum number of physical blocks necessary for equalization is changed. Also, the storage data of the physical block that is no longer the management information and / or firmware write destination due to this change is transferred to or related to the physical block that is newly the management information and / or firmware write destination due to this change. It is preferable that the management information and / or the firmware is transferred to the physical block that has remained the writing destination.

尚、上述のように、不良ブロックには、出荷時から不良である初期不良の物理ブロックと、使用開始後に劣化して不良ブロックになった後発不良の物理ブロックがある。この後発不良の物理ブロックの判断基準については、設計の際に設計者が適宜設定することができる。例えば、書き込み又は消去を行った際にフラッシュメモリから与えられる処理ステータスがフェイルであった場合、読み出したデータに予め定められた閾値以上の誤りが含まれていた場合、又はこれらの組み合わせにより後発不良の物理ブロックであると判断されるようにしてもよい。   As described above, the defective blocks include an initial defective physical block that is defective from the time of shipment, and a late defective physical block that has deteriorated into a defective block after the start of use. The criteria for determining the physical block of the subsequent failure 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, or a combination of these errors causes a late failure It may be determined that the physical block is.

本発明の一実施形態によるフラッシュメモリシステムの概略構成を示すブロック図である。1 is a block diagram showing a schematic configuration of a flash memory system according to an embodiment of the present invention. SRAM及びファームウェアの構成を示す。The structure of SRAM and firmware is shown. 図3Aは、ファームウェアのフラッシュメモリへの書き込みを示す。図3Bは、フラッシュメモリからのファームウェアの読み出しを示す。FIG. 3A shows the writing of firmware to the flash memory. FIG. 3B shows the reading of firmware from the flash memory. 不良ブロックの個数とファームウェア及び管理情報が書き込まれている物理ブロックの個数との総和が、ファームウェア及び管理情報の書き込みが終了したときにそれぞれのフラッシュメモリ間で均等化されている様子を示す。A state is shown in which the sum of the number of defective blocks and the number of physical blocks in which firmware and management information are written is equalized between the flash memories when the writing of the firmware and management information is completed.

符号の説明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 (6)

ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
それぞれの前記フラッシュメモリに含まれる不良ブロックの個数を計数する計数手段と、
複数個の前記フラッシュメモリ内の一部の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータが書き込まれるシステムブロックに割り当てるシステムブロック管理手段と、
1個又は複数個の前記システムブロックに、1個のデータとして又は複数個のデータに分割して前記システムデータを書き込むシステムデータ書き込み手段と、
前記システムブロックから前記システムデータを読み出すシステムデータ読み出し手段と、
前記システムデータに基づいて複数個の前記フラッシュメモリに対するアクセスを制御するアクセス制御手段と、
を備え、
前記システムブロック管理手段は、それぞれの前記フラッシュメモリに含まれる不良ブロックの個数と前記システムブロックの個数との総和が均等化されるように、前記システムブロックの割り当てを行う、
ことを特徴とするメモリコントローラ。
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,
Counting means for counting the number of defective blocks included in each of the flash memories;
System block management means for allocating some physical blocks in the plurality of flash memories to system blocks in which system data for controlling or managing access to the plurality of flash memories is written;
System data writing means for writing the system data into one or a plurality of the system blocks as one data or divided into a plurality of data;
System data reading means for reading the system data from the system block;
Access control means for controlling access to the plurality of flash memories based on the system data;
With
The system block management means assigns the system blocks so that the sum of the number of defective blocks and the number of system blocks included in each flash memory is equalized.
A memory controller characterized by that.
前記システムデータには、複数個の前記フラッシュメモリに対するアクセスを制御するためのファームウェアが含まれ、
前記システムデータ読み出し手段は、起動時に前記システムブロックから前記ファームウェアを読み出す
ことを特徴とする請求項1記載のメモリコントローラ。
The system data includes firmware for controlling access to the plurality of flash memories,
2. The memory controller according to claim 1, wherein the system data reading unit reads the firmware from the system block at the time of activation.
前記アクセス制御手段は、異なる前記フラッシュメモリに属する複数個の物理ブロックを含むグループ単位で、複数個の前記フラッシュメモリに対するアクセスを制御する、
ことを特徴とする請求項1乃至2のうちのいずれか1項に記載のメモリコントローラ。
The access control means controls access to the plurality of flash memories in a group unit including a plurality of physical blocks belonging to different flash memories.
The memory controller according to claim 1, wherein the memory controller is a memory controller.
前記システムブロック管理手段は、複数個の前記フラッシュメモリに含まれる不良ブロックの個数が変化したときに、それぞれの前記フラッシュメモリに含まれる不良ブロックの個数と前記システムブロックの個数との総和が均等化されるように、前記システムブロックの割り当てを変更する、
ことを特徴とする請求項1乃至3のうちのいずれか1項に記載のメモリコントローラ。
The system block management means equalizes the sum of the number of defective blocks and the number of system blocks included in each flash memory when the number of defective blocks included in the plurality of flash memories changes. To change the allocation of the system blocks,
The memory controller according to claim 1, wherein the memory controller is a memory controller.
請求項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.
ホストシステムから与えられるアクセス指示に従って、物理ブロック単位で消去が行われる複数個のフラッシュメモリの制御方法であって、
それぞれの前記フラッシュメモリに含まれる不良ブロックの個数を計数する計数ステップと、
複数個の前記フラッシュメモリ内の一部の物理ブロックを、複数個の前記フラッシュメモリに対するアクセスを制御又は管理するためのシステムデータが書き込まれるシステムブロックに割り当てるシステムブロック管理ステップと、
1個又は複数個の前記システムブロックに、1個のデータとして又は複数個のデータに分割して前記システムデータを書き込むシステムデータ書き込みステップと、
前記システムブロックから前記システムデータを読み出すシステムデータ読み出しステップと、
前記システムデータに基づいて複数個の前記フラッシュメモリに対するアクセスを制御するアクセス制御ステップと、
を備え、
前記システムブロック管理ステップでは、それぞれの前記フラッシュメモリに含まれる不良ブロックの個数と前記システムブロックの個数との総和が均等化されるように、前記システムブロックの割り当てが行われる、
ことを特徴とするフラッシュメモリの制御方法。
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,
A counting step for counting the number of defective blocks included in each of the flash memories;
A system block management step for allocating some physical blocks in the plurality of flash memories to system blocks in which system data for controlling or managing access to the plurality of flash memories is written;
A system data writing step of writing the system data into one or a plurality of system blocks as one data or divided into a plurality of data;
A system data read step for reading the system data from the system block;
An access control step for controlling access to the plurality of flash memories based on the system data;
With
In the system block management step, the system blocks are allocated so that the sum of the number of defective blocks and the number of system blocks included in each of the flash memories is equalized.
A method for controlling a flash memory.
JP2008038983A 2008-02-20 2008-02-20 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Active JP4710918B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008038983A JP4710918B2 (en) 2008-02-20 2008-02-20 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008038983A JP4710918B2 (en) 2008-02-20 2008-02-20 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Publications (2)

Publication Number Publication Date
JP2009199242A JP2009199242A (en) 2009-09-03
JP4710918B2 true JP4710918B2 (en) 2011-06-29

Family

ID=41142686

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008038983A Active JP4710918B2 (en) 2008-02-20 2008-02-20 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Country Status (1)

Country Link
JP (1) JP4710918B2 (en)

Families Citing this family (3)

* 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
JP2012173778A (en) * 2011-02-17 2012-09-10 Sony Corp Management device and management method
JP7077151B2 (en) 2018-06-06 2022-05-30 キオクシア株式会社 Memory system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000035919A (en) * 1998-07-17 2000-02-02 Victor Co Of Japan Ltd Flash type memory, management device therefor and management method therefor
JP2001142774A (en) * 1999-11-11 2001-05-25 Toshiba Corp Memory card and address converting method to be applied to it
JP2003015947A (en) * 2001-07-05 2003-01-17 Tdk Corp Memory controller, flash memory system with memory controller and flash memory control method
JP2004280287A (en) * 2003-03-13 2004-10-07 Matsushita Electric Ind Co Ltd Memory card
JP2008021333A (en) * 2007-09-28 2008-01-31 Renesas Technology Corp Non-volatile memory system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000035919A (en) * 1998-07-17 2000-02-02 Victor Co Of Japan Ltd Flash type memory, management device therefor and management method therefor
JP2001142774A (en) * 1999-11-11 2001-05-25 Toshiba Corp Memory card and address converting method to be applied to it
JP2003015947A (en) * 2001-07-05 2003-01-17 Tdk Corp Memory controller, flash memory system with memory controller and flash memory control method
JP2004280287A (en) * 2003-03-13 2004-10-07 Matsushita Electric Ind Co Ltd Memory card
JP2008021333A (en) * 2007-09-28 2008-01-31 Renesas Technology Corp Non-volatile memory system

Also Published As

Publication number Publication date
JP2009199242A (en) 2009-09-03

Similar Documents

Publication Publication Date Title
JP4844639B2 (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
US20060013048A1 (en) Memory systems including defective block management and related methods
JP4632180B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4666081B2 (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
JP5093294B2 (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
JP4840415B2 (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
JP4702703B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4655034B2 (en) Memory controller, flash memory system, and flash memory control method
JP4594944B2 (en) Memory control device
JP4636046B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4697146B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4177292B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM, AND FLASH MEMORY CONTROL METHOD
JP2012068764A (en) Memory controller, nonvolatile memory system with memory controller, and control method of nonvolatile memory
JP2010086106A (en) Memory controller, flash memory system with memory controller, and method for controlling flash memory
JP3934659B1 (en) Memory controller and flash memory system
JP2006318132A (en) Memory controller, flash memory system, and control method for flash memory
JP6260395B2 (en) Memory controller, memory system, and memory control method
JP4569554B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4760826B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2010092200A (en) Memory controller, flash memory system equipped with memory controller and method of controlling flash memory

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110215

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110307

R150 Certificate of patent or registration of utility model

Ref document number: 4710918

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150