JP4282401B2 - Flash memory control circuit, and memory controller and flash memory system provided with the control circuit - Google Patents

Flash memory control circuit, and memory controller and flash memory system provided with the control circuit Download PDF

Info

Publication number
JP4282401B2
JP4282401B2 JP2003282199A JP2003282199A JP4282401B2 JP 4282401 B2 JP4282401 B2 JP 4282401B2 JP 2003282199 A JP2003282199 A JP 2003282199A JP 2003282199 A JP2003282199 A JP 2003282199A JP 4282401 B2 JP4282401 B2 JP 4282401B2
Authority
JP
Japan
Prior art keywords
flash memory
data
transmission
received
cbw
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003282199A
Other languages
Japanese (ja)
Other versions
JP2005050172A (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 JP2003282199A priority Critical patent/JP4282401B2/en
Publication of JP2005050172A publication Critical patent/JP2005050172A/en
Application granted granted Critical
Publication of JP4282401B2 publication Critical patent/JP4282401B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

本発明は、フラッシュメモリの制御回路、並びに、この制御回路を備えるメモリコントローラ及びフラッシュメモリシステムに係り、特にUSBインターフェース、又はこれに類するインターフェースを有するフラッシュメモリの制御回路、並びに、この制御回路を備えるメモリコントローラ及びフラッシュメモリシステムに関する。   The present invention relates to a flash memory control circuit, a memory controller including the control circuit, and a flash memory system, and more particularly to a flash memory control circuit having a USB interface or similar interface, and the control circuit. The present invention relates to a memory controller and a flash memory system.

近年、メモリカードやシリコンディスクなどのメモリシステムに用いられる半導体メモリとして、フラッシュメモリが用いられることが多い。このフラッシュメモリは不揮発性メモリの一種であり、電源が投入されているか否かに関わらず、データが保持されるていることが要求される。   In recent years, a flash memory is often used as a semiconductor memory used in a memory system such as a memory card or a silicon disk. This flash memory is a kind of non-volatile memory, and is required to retain data regardless of whether power is turned on.

ところで、上記のような装置に特に用いられることが多いNAND型フラッシュメモリは、メモリセルを消去状態(論理値の「1」)から書込状態(論理値の「0」)に変化させる場合には、メモリセル単位で行うことができるが、メモリセルを書込状態(論理値の「0」)から消去状態(論理値の「1」)に変化させる場合には、メモリセル単位で行うことができず、複数のメモリセルからなる所定の消去単位(ブロック)でしかこれを行うことができない。かかる一括消去動作は、一般的に「ブロック消去」と呼ばれている。   By the way, the NAND flash memory that is often used in the above-described devices is used when a memory cell is changed from an erased state (logical value “1”) to a written state (logical value “0”). Can be performed in units of memory cells. However, when a memory cell is changed from a written state (logical value “0”) to an erased state (logical value “1”), it must be performed in memory cells. This can only be done with a predetermined erase unit (block) consisting of a plurality of memory cells. Such a batch erase operation is generally called “block erase”.

又、消去の処理単位であるブロックは、読出し及び書込みの処理単位であるページで構成されている(例えば、1ブロックが32ページで構成されている。)。このページは、通常、512バイトのデータ領域で構成されており、ページに対する読出し及び書込みの処理は512バイト単位で行なわれる。従って、このようなフラッシュメモリに対する読出し及び書込みの処理は、512バイトのバッファ回路(例えば、512バイトのデータ領域を備えたSRAMで構成されている。)を介して行なわれる(以下、フラッシュメモリに対する読出し及び書込みの処理に使用されるバッファ回路をページバッファと言う。)。つまり、フラッシュメモリを備えたメモリシステム(以下、フラッシュメモリを備えたメモリシステムをフラッシュメモリシステムと言う。)では、ホストシステム側から書込まれるデータは、一旦ページバッファに保持され、ページバッファに保持されたデータがフラッシュメモリに書込まれる。一方、フラッシュメモリから読出されるデータは、一旦ページバッファに保持され、ページバッファに保持されたデータがホストシステム側に転送される。   A block which is an erasing processing unit is composed of pages which are processing units for reading and writing (for example, one block is composed of 32 pages). This page is usually composed of a 512-byte data area, and read and write processing for the page is performed in units of 512 bytes. Therefore, such read and write processing for the flash memory is performed via a 512-byte buffer circuit (for example, an SRAM having a 512-byte data area) (hereinafter referred to as flash memory). A buffer circuit used for reading and writing is called a page buffer.) In other words, in a memory system having flash memory (hereinafter, a memory system having flash memory is referred to as a flash memory system), data written from the host system side is temporarily held in the page buffer and then held in the page buffer. The written data is written to the flash memory. On the other hand, data read from the flash memory is once held in the page buffer, and the data held in the page buffer is transferred to the host system side.

又、近年、上記のようなメモリシステムをUSB(Universal Serial Bus)インターフェースに接続した装置(例えば、USB Mass Storage Classに準拠した装置)も提供されている。このUSBに接続された装置では、USBインターフェースを介して送受信されるデータは、一旦エンドポイントと呼ばれるバッファに保持される。つまり、ホストシステム側から送信されてくるデータを、USBインターフェースを介して受信する場合、受信したデータは、受信用エンドポイントに保持され、ホストシステム側にUSBインターフェースを介してデータを送信する場合、送信用エンドポイントに保持されているデータがホストシステム側に送信される。   In recent years, a device in which the above memory system is connected to a USB (Universal Serial Bus) interface (for example, a device compliant with USB Mass Storage Class) is also provided. In a device connected to the USB, data transmitted / received via the USB interface is once held in a buffer called an endpoint. That is, when data transmitted from the host system side is received via the USB interface, the received data is held at the reception endpoint, and when data is transmitted to the host system side via the USB interface, Data held in the transmission endpoint is transmitted to the host system side.

従って、USBインターフェースを備えたフラッシュメモリシステムでは、ホストシステム側からフラッシュメモリに書込まれるデータは、受信用エンドポイントからページバッファに転送され、ページバッファに転送されたデータがフラッシュメモリに書込まれる。又、フラッシュメモリからホストシステム側に読出されるデータは、ページバッファから送信用エンドポイントに転送され、送信用エンドポイントに転送されたデータがUSBインターフェースを介してホストシステム側に送信される。   Therefore, in a flash memory system having a USB interface, data written to the flash memory from the host system side is transferred from the receiving endpoint to the page buffer, and the data transferred to the page buffer is written to the flash memory. . The data read from the flash memory to the host system side is transferred from the page buffer to the transmission endpoint, and the data transferred to the transmission endpoint is transmitted to the host system side via the USB interface.

上記のようなUSBインターフェースを備えたフラッシュメモリシステムでは、USBインターフェース用のバッファ回路(エンドポイント)と、フラッシュメモリに対する読出し及び書込みの処理に使用されるバッファ回路(ページバッファ)を設けていたので、回路規模が大きくなるという問題があった。又、ホストシステム側からデータの読出しや書込みの処理を行なう場合に、エンドポイントとページバッファ間での転送処理が発生するため、読出しや書込みの処理効率も良くなかった。   In the flash memory system having the USB interface as described above, a buffer circuit (end point) for the USB interface and a buffer circuit (page buffer) used for reading and writing to the flash memory are provided. There was a problem that the circuit scale became large. In addition, when data read / write processing is performed from the host system side, transfer processing between the endpoint and the page buffer occurs, so read / write processing efficiency is not good.

そこで、本発明は、USBインターフェースを備えることによる回路規模の増大と処理効率の低下を抑えたフラッシュメモリの制御回路、並びに、この制御回路を備えるメモリコントローラ及びフラッシュメモリシステムを提供することを目的とする。   Accordingly, an object of the present invention is to provide a flash memory control circuit that suppresses an increase in circuit scale and a reduction in processing efficiency due to the provision of a USB interface, and a memory controller and a flash memory system including the control circuit. To do.

本発明に係る目的は、USBインターフェースを介してデータを送受信する送受信手段と、
USBインターフェースを介して受信したデータを保持する受信データ保持手段と、
前記受信データ保持手段に保持されているデータをフラッシュメモリに書込む書込み処理制御手段と、
USBインターフェースを介して送信するデータを保持する送信データ保持手段と、
フラッシュメモリに格納されているデータを前記送信データ保持手段に読出す読出し処理制御手段とを備え、
前記受信データ保持手段にフラッシュメモリの1ページ分のデータが保持された後に、前記書込み処理制御手段がフラッシュメモリへの書込み処理を開始するように構成されていることを特徴とするフラッシュメモリの制御回路によって達成される。更に、このフラッシュメモリの制御回路を備えたメモリコントローラ、又は、このフラッシュメモリの制御回路とフラッシュメモリを備えたフラッシュメモリシステムによっても達成される。
An object of the present invention is to transmit / receive data via a USB interface;
Received data holding means for holding data received via the USB interface;
Write processing control means for writing data held in the received data holding means to a flash memory;
Transmission data holding means for holding data to be transmitted via the USB interface;
Read processing control means for reading data stored in the flash memory to the transmission data holding means,
Control of the flash memory, wherein the write processing control means starts a write process to the flash memory after data for one page of the flash memory is held in the received data holding means Achieved by the circuit. Further, this can be achieved by a memory controller having the flash memory control circuit or a flash memory system having the flash memory control circuit and the flash memory.

本発明に係る目的は、USBインターフェースを介してデータを送受信する送受信手段と、
USBインターフェースを介して受信したデータを保持する受信データ保持手段と、
前記受信データ保持手段に保持されているデータをフラッシュメモリに書込む書込み処理制御手段と、
USBインターフェースを介して送信するデータを保持する送信データ保持手段と、
フラッシュメモリに格納されているデータを前記送信データ保持手段に読出す読出し処理制御手段とを備え、
前記読出し処理制御手段により、前記送信データ保持手段にフラッシュメモリの1ページ分のデータが読出された後に、前記送受信手段が送信を開始するように構成されていることを特徴とするフラッシュメモリの制御回路によって達成される。更に、このフラッシュメモリの制御回路を備えたメモリコントローラ、又は、このフラッシュメモリの制御回路とフラッシュメモリを備えたフラッシュメモリシステムによっても達成される。
An object of the present invention is to transmit / receive data via a USB interface;
Received data holding means for holding data received via the USB interface;
Write processing control means for writing data held in the received data holding means to a flash memory;
Transmission data holding means for holding data to be transmitted via the USB interface;
Read processing control means for reading data stored in the flash memory to the transmission data holding means,
Control of the flash memory, wherein the transmission / reception means starts transmission after data for one page of the flash memory is read to the transmission data holding means by the read processing control means Achieved by the circuit. Further, this can be achieved by a memory controller having the flash memory control circuit or a flash memory system having the flash memory control circuit and the flash memory.

本発明に係る目的は、USBインターフェースを介してデータを送受信する送受信手段と、
USBインターフェースを介して受信したデータを保持する受信データ保持手段と、
前記受信データ保持手段に保持されているデータをフラッシュメモリに書込む書込み処理制御手段と、
USBインターフェースを介して送信するデータを保持する送信データ保持手段と、
フラッシュメモリに格納されているデータを前記送信データ保持手段に読出す読出し処理制御手段とを備え、
前記受信データ保持手段にフラッシュメモリの1ページ分のデータが保持された後に、前記書込み処理制御手段がフラッシュメモリへの書込み処理を開始し、
前記読出し処理制御手段により、前記送信データ保持手段にフラッシュメモリの1ページ分のデータが読出された後に、前記送受信手段が送信を開始するように構成されていることを特徴とするフラッシュメモリの制御回路によって達成される。更に、このフラッシュメモリの制御回路を備えたメモリコントローラ、又は、このフラッシュメモリの制御回路とフラッシュメモリを備えたフラッシュメモリシステムによっても達成される。
An object of the present invention is to transmit / receive data via a USB interface;
Received data holding means for holding data received via the USB interface;
Write processing control means for writing data held in the received data holding means to a flash memory;
Transmission data holding means for holding data to be transmitted via the USB interface;
Read processing control means for reading data stored in the flash memory to the transmission data holding means,
After the data for one page of the flash memory is held in the received data holding means, the write processing control means starts the writing process to the flash memory,
Control of the flash memory, wherein the transmission / reception means starts transmission after data for one page of the flash memory is read to the transmission data holding means by the read processing control means Achieved by the circuit. Further, this can be achieved by a memory controller having the flash memory control circuit or a flash memory system having the flash memory control circuit and the flash memory.

又、本発明によれば、前記USBインターフェースが、ハイスピードモードで動作している場合は、前記受信データ保持手段が1パケット分のデータを保持した後に、前記書込み処理制御手段がフラッシュメモリへの書込み処理を開始し
前記USBインターフェースが、フルスピードモードで動作している場合は、前記受信データ保持手段が8パケット分のデータを保持した後に、前記書込み処理制御手段がフラッシュメモリへの書込み処理を開始するように構成されていることが好ましい。
Further, according to the present invention, when the USB interface is operating in the high speed mode, the write processing control means sends data to the flash memory after the received data holding means holds data for one packet. When the writing process is started and the USB interface is operating in the full speed mode, the writing process control unit performs the writing process to the flash memory after the received data holding unit holds data for 8 packets. It is preferably configured to start.

又、本発明によれば、前記受信データ保持手段の容量が前記フラッシュメモリの1ページ分のデータ容量と同一あることが好ましい。   According to the present invention, it is preferable that the capacity of the received data holding means is the same as the data capacity of one page of the flash memory.

又、本発明によれば、前記受信データ保持手段の容量が512バイトであることが好ましい。   According to the present invention, it is preferable that the capacity of the received data holding means is 512 bytes.

又、本発明によれば、前記USBインターフェースが、ハイスピードモードで動作している場合は、前記送信データ保持手段に保持されているデータを、512バイトのデータを含むパケットで送信し、
前記USBインターフェースが、フルスピードモードで動作している場合は、前記送信データ保持手段に保持されているデータを、64バイトのデータを含むパケットに分割して送信するように構成されていることが好ましい。
According to the present invention, when the USB interface is operating in the high speed mode, the data held in the transmission data holding means is transmitted in a packet including 512-byte data,
When the USB interface is operating in the full speed mode, the data held in the transmission data holding unit may be divided into packets including 64-byte data and transmitted. preferable.

又、本発明によれば、前記送信データ保持手段の容量が前記フラッシュメモリの1ページ分のデータ容量と同一あることが好ましい。   According to the present invention, it is preferable that the capacity of the transmission data holding means is the same as the data capacity of one page of the flash memory.

又、本発明によれば、前記送信データ保持手段の容量が512バイトであることが好ましい。   According to the present invention, it is preferable that the capacity of the transmission data holding means is 512 bytes.

本発明に係るフラッシュメモリの制御回路、並びに、この制御回路を備えるメモリコントローラ及びフラッシュメモリシステムでは、USBインターフェース用のバッファ回路(エンドポイント)を、フラッシュメモリに対する読出し及び書込みの処理に使用されるバッファ回路(ページバッファ)としても使用できるようにしたので、回路規模の増大を最低限に抑えることができる。   In a flash memory control circuit according to the present invention, and a memory controller and flash memory system including the control circuit, a buffer circuit (endpoint) for a USB interface is used as a buffer for reading and writing to the flash memory. Since it can be used as a circuit (page buffer), an increase in circuit scale can be minimized.

更に、バッファ回路とフラッシュメモリのデータ転送は、上記USBインターフェースを介して送受信されるパケットのサイズ(パケットに含まれるデータ容量)によらず、フラッシュメモリのページサイズ(1ページ分のデータ容量)で処理されるので、パケットサイズの差異(送信速度の差異)による処理効率の低下も抑えることができる。   Furthermore, the data transfer between the buffer circuit and the flash memory is based on the page size of the flash memory (data capacity for one page) regardless of the size of the packet transmitted / received via the USB interface (data capacity included in the packet). Since processing is performed, a decrease in processing efficiency due to a difference in packet size (difference in transmission speed) can be suppressed.

以下、図面に基づき、本発明の実施の形態について詳細に説明する。図1は、本発明にかかるフラッシュメモリシステム1を概略的に示すブロック図であり、フラッシュメモリ9と、メモリコントローラ2で構成されるフラッシュメモリシステム1を示している。
[フラッシュメモリの説明]
図1に示したフラッシュメモリ9は、ページ単位で読出し又は書込みを、ブロック単位で消去を実行する不揮発性メモリである。このフラッシュメモリ9を構成するメモリセルにデータが書込まれている状態と、書込まれていない状態について図2及び3を参照して説明する。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a block diagram schematically showing a flash memory system 1 according to the present invention, and shows a flash memory system 1 including a flash memory 9 and a memory controller 2.
[Description of flash memory]
The flash memory 9 shown in FIG. 1 is a nonvolatile memory that performs reading or writing in units of pages and erasing in units of blocks. A state where data is written in a memory cell constituting the flash memory 9 and a state where data is not written will be described with reference to FIGS.

図2は、フラッシュメモリを構成するメモリセル16の構造を概略的に示す断面図である。同図に示したように、メモリセル16は、P型半導体基板17に形成されたN型のソース拡散領域18及びドレイン拡散領域19と、ソース拡散領域18とドレイン拡散領域19との間のP型半導体基板17を覆って形成されたトンネル酸化膜20と、トンネル酸化膜20上に形成されたフローティングゲ―ト電極21と、フローティングゲート電極21上に形成された絶縁膜22と、絶縁膜22上に形成されたコントロールゲ―ト電極23とから構成される。このような構成を有するメモリセル16が、フラッシュメモリ内で複数個直列に接続されている。   FIG. 2 is a cross-sectional view schematically showing the structure of the memory cell 16 constituting the flash memory. As shown in the figure, the memory cell 16 includes an N-type source diffusion region 18 and a drain diffusion region 19 formed in the P-type semiconductor substrate 17, and a P between the source diffusion region 18 and the drain diffusion region 19. Tunnel oxide film 20 formed to cover type semiconductor substrate 17, floating gate electrode 21 formed on tunnel oxide film 20, insulating film 22 formed on floating gate electrode 21, and insulating film 22 The control gate electrode 23 is formed on the top. A plurality of memory cells 16 having such a configuration are connected in series in the flash memory.

メモリセル16は、フローティングゲート電極21に電子が注入されているか否かによって、「消去状態(電子が蓄積されていない状態)」と「書込状態(電子が蓄積されている状態)」のいずれかの状態が示される。ここで、1つのメモリセル16は1ビットのデータに対応し、メモリセル16の「消去状態」が論理値の「1」のデータに対応し、メモリセル16の「書込状態」が論理値の「0」のデータに対応する。   The memory cell 16 has either an “erased state (a state where no electrons are accumulated)” or a “written state (a state where electrons are accumulated)” depending on whether electrons are injected into the floating gate electrode 21 or not. Is shown. Here, one memory cell 16 corresponds to 1-bit data, the “erased state” of the memory cell 16 corresponds to data of “1” of the logical value, and the “written state” of the memory cell 16 corresponds to the logical value. Corresponds to “0” data.

「消去状態」においては、フローティングゲート電極21に電子が蓄積されていないため、コントロールゲート電極23に読み出し電圧が印加されていないときには、ソース拡散領域18とドレイン拡散領域19との間の、P型半導体基板17の表面にチャネルが形成されず、ソース拡散領域18とドレイン拡散領域19は電気的に絶縁される。一方、コントロールゲート電極23に読み出し電圧が印加されると、ソース拡散領域18とドレイン拡散領域19との間のP型半導体基板17の表面にチャネル(図示せず)が形成され、ソース拡散領域18とドレイン拡散領域19は、このチャネルによって電気的に接続される。   In the “erased state”, since electrons are not accumulated in the floating gate electrode 21, when no read voltage is applied to the control gate electrode 23, a P-type region between the source diffusion region 18 and the drain diffusion region 19 is used. A channel is not formed on the surface of the semiconductor substrate 17, and the source diffusion region 18 and the drain diffusion region 19 are electrically insulated. On the other hand, when a read voltage is applied to the control gate electrode 23, a channel (not shown) is formed on the surface of the P-type semiconductor substrate 17 between the source diffusion region 18 and the drain diffusion region 19. And the drain diffusion region 19 are electrically connected by this channel.

すなわち、「消去状態」においてはコントロールゲート電極23に読み出し電圧が印加されていない状態では、ソース拡散領域18とドレイン拡散領域19とは電気的に絶縁され、コントロールゲート電極23に読み出し電圧が印加された状態では、ソース拡散領域18とドレイン拡散領域19とは電気的に接続される。   That is, in the “erased state”, when no read voltage is applied to the control gate electrode 23, the source diffusion region 18 and the drain diffusion region 19 are electrically insulated, and the read voltage is applied to the control gate electrode 23. In this state, the source diffusion region 18 and the drain diffusion region 19 are electrically connected.

図3は、「書込状態」であるメモリセル16を概略的に示す断面図である。同図に示したように、「書込状態」とは、フローティングゲート電極21に電子が蓄積されている状態を指す。フローティングゲート電極21はトンネル酸化膜20及び絶縁膜22に挟まれているため、一旦、フローティングゲート電極21に注入された電子は、きわめて長時間フローティングゲート電極21内にとどまる。この「書込状態」においては、フローティングゲート電極21に電子が蓄積されているので、コントロールゲート電極23に読み出し電圧が印加されているか否かに関わらず、ソース拡散領域18とドレイン拡散領域19との間の、P型半導体基板17の表面には、チャネル24が形成される。したがって、「書込状態」においてはソース拡散領域18とドレイン拡散領域19とは、コントロ―ルゲート電極23に読み出し電圧が印加されているか否かに関わらず、チャネル24によって常に電気的に接続状態となる。   FIG. 3 is a cross-sectional view schematically showing the memory cell 16 in the “written state”. As shown in the figure, the “written state” refers to a state in which electrons are accumulated in the floating gate electrode 21. Since the floating gate electrode 21 is sandwiched between the tunnel oxide film 20 and the insulating film 22, the electrons once injected into the floating gate electrode 21 stay in the floating gate electrode 21 for a very long time. In this “write state”, since electrons are accumulated in the floating gate electrode 21, the source diffusion region 18, the drain diffusion region 19, and the like regardless of whether or not the read voltage is applied to the control gate electrode 23. A channel 24 is formed on the surface of the P-type semiconductor substrate 17 between. Therefore, in the “write state”, the source diffusion region 18 and the drain diffusion region 19 are always electrically connected by the channel 24 regardless of whether or not the read voltage is applied to the control gate electrode 23. Become.

又、上記メモリセル16が消去状態であるか書込状態であるかは、次のようにして読み出すことができる。メモリセル16はフラッシュメモリ内で複数個直列に接続されている。この直列体の中で選択するメモリセル16に低レベル電圧を印加し、それ以外のメモリセル16のコントロールゲート電極23に高レベル電圧を印加する。この状態でメモリセル16の直列体が導通状態であるか否かの検出が行われる。その結果、この直列体が導通状態であれば、選択されたメモリセル16は書込状態であると判断され、絶縁状態であれば、選択されたフラッシュメモリセル16は消去状態であると判断される。このようにして、直列体に含まれる任意のメモリセル16に保持されたデータが「0」であるのか「1」であるのかを読み出すことができる。   Whether the memory cell 16 is in the erased state or the written state can be read as follows. A plurality of memory cells 16 are connected in series in the flash memory. A low level voltage is applied to the memory cell 16 selected in the series body, and a high level voltage is applied to the control gate electrode 23 of the other memory cells 16. In this state, it is detected whether or not the serial body of the memory cells 16 is in a conductive state. As a result, if the serial body is in a conductive state, it is determined that the selected memory cell 16 is in a written state, and if it is in an isolated state, it is determined that the selected flash memory cell 16 is in an erased state. The In this way, it is possible to read out whether the data held in any memory cell 16 included in the serial body is “0” or “1”.

又、消去状態であるメモリセル16を書込状態に変化させる場合は、コントロールゲート電極23が高電位側となる高電圧が印加し、トンネル酸化膜20を介してフローティングゲート電極21へ電子を注入する。この際、FN(ファウラ―ノルトハイム)トンネル電流が流れフロ―ティングゲート電極21に電子が注入される。一方、書込状態であるフラッシュメモリセル16を消去状態に変化させる場合は、コントロールゲート電極23が低電位側となる高電圧が印加し、トンネル酸化膜20を介してフローティングゲート電極21に蓄積された電子を排出する。   When the memory cell 16 in the erased state is changed to the written state, a high voltage is applied so that the control gate electrode 23 is on the high potential side, and electrons are injected into the floating gate electrode 21 through the tunnel oxide film 20. To do. At this time, an FN (Fowler-Nordheim) tunnel current flows and electrons are injected into the floating gate electrode 21. On the other hand, when the flash memory cell 16 in the written state is changed to the erased state, a high voltage that causes the control gate electrode 23 to be on the low potential side is applied and accumulated in the floating gate electrode 21 via the tunnel oxide film 20. Discharge electrons.

次に、図1に示したフラッシュメモリ9のメモリ構造を説明する。図4は、フラッシュメモリのメモリ構造を概略的に示す図である。図4に示したように、フラッシュメモリはデータの読出し及び書込みにおける処理単位である「ページ」と、データの消去単位である「ブロック」で構成されている。   Next, the memory structure of the flash memory 9 shown in FIG. 1 will be described. FIG. 4 schematically shows a memory structure of the flash memory. As shown in FIG. 4, the flash memory includes “pages” that are processing units for reading and writing data and “blocks” that are data erasing units.

上記「ページ」は512バイトのデータ領域25と16バイトの冗長領域26によって構成される。データ領域25は、ホストシステム側から供給されるユーザデ―タが格納される領域であり、冗長領域26は、エラーコレクションコード等の付加情報が格納される領域である。エラ―コレクションコードは、対応するデータ領域25に格納されたデータに含まれる誤りを訂正するための付加情報であり、データ領域25に格納されたデータに含まれる誤りが所定数以下であれば、これを訂正し、正しいデータとするために用いられる。   The “page” is composed of a data area 25 of 512 bytes and a redundant area 26 of 16 bytes. The data area 25 is an area for storing user data supplied from the host system side, and the redundant area 26 is an area for storing additional information such as an error correction code. The error correction code is additional information for correcting an error included in the data stored in the corresponding data area 25. If the error included in the data stored in the data area 25 is equal to or less than a predetermined number, It is used to correct this and obtain correct data.

上記冗長領域26には、エラーコレクションコードの他に、「対応論理ブロックアドレス」が格納されている。「対応論理ブロックアドレス」は、そのブロックにデータが格納されている場合に、そのブロックがどの論理ブロックアドレスに対応するかを示している。尚、そのブロックにデータが格納されていない場合は、「対応論理ブロックアドレス」も格納されていないので、「対応論理ブロックアドレス」が格納されているか否かで、そのブロックが消去済みブロックであるか否かを判断することができる。つまり、「対応論理ブロックアドレス」が格納されていない場合は消去済みブロックであると判断する。   The redundant area 26 stores “corresponding logical block address” in addition to the error correction code. The “corresponding logical block address” indicates which logical block address the block corresponds to when data is stored in the block. If no data is stored in the block, the “corresponding logical block address” is also not stored, so that the block is an erased block depending on whether the “corresponding logical block address” is stored. It can be determined whether or not. That is, if the “corresponding logical block address” is not stored, it is determined that the block is an erased block.

又、上記「ブロック」は32枚の「ページ」で構成されている。ここでフラッシュメモリはデータの上書きができないため、1枚の「ページ」のデータだけを書き変える場合であっても、その「ページ」が含まれる「ブロック」の、他の「ページ」のデータも、消去済みの「ブロック」に再度書込まなければならない。   The “block” is composed of 32 “pages”. Here, since the flash memory cannot overwrite data, even if only the data of one “page” is rewritten, the data of other “pages” of the “block” that includes the “page” is also included. , You must rewrite to the erased "block".

又、上記のようにデータを書替える場合、書替えの後のデータは書替え前の「ブロック」と異なる「ブロック」に書込まれるため、ホストシステムから与えられるホストアドレスに基づくブロックアドレス(以下、ホストアドレスに基づくブロックアドレスを論理ブロックアドレスと言う。)と、この論理ブロックアドレスに対応するフラッシュメモリ内でのブロックアドレス(以下、フラッシュメモリ内でのブロックアドレスを物理ブロックアドレスと言う。)との対応関係は、データを書替える毎に動的に変化する。   In addition, when data is rewritten as described above, since the data after rewriting is written in a “block” different from the “block” before rewriting, a block address based on the host address given by the host system (hereinafter referred to as “host”). A block address based on the address is referred to as a logical block address.) And a block address in the flash memory corresponding to the logical block address (hereinafter, the block address in the flash memory is referred to as a physical block address). The relationship changes dynamically every time data is rewritten.

このため、論理ブロックアドレスと物理ブロックアドレスの対応関係が書込まれたアドレス変換テーブルが必要となる。この「アドレス変換テーブル」は、「論理ブロックアドレス」と「物理ブロックアドレス」の対応関係を示したテーブルであり、上述のような理由により、フラッシュメモリに書込まれているデータが書替えられる毎に、その書替えに関わった部分の対応関係が更新される。
[メモリコントローラの説明]
図1のメモリコントローラ2は、USBインターフェース部3と、エンドポイント制御部4と、コントロール用エンドポイント5と、受信用エンドポイント6と、送信用エンドポイント7と、フラッシュメモリ制御部8とから構成される。これら回路によって構成されるメモリコントローラ2は、一つの半導体チップ上に集積されている。
For this reason, an address conversion table in which the correspondence between the logical block address and the physical block address is written is required. This “address conversion table” is a table showing a correspondence relationship between “logical block address” and “physical block address”, and every time the data written in the flash memory is rewritten for the reasons described above. , The correspondence of the part related to the rewriting is updated.
[Description of memory controller]
The memory controller 2 in FIG. 1 includes a USB interface unit 3, an end point control unit 4, a control end point 5, a reception end point 6, a transmission end point 7, and a flash memory control unit 8. Is done. The memory controller 2 constituted by these circuits is integrated on one semiconductor chip.

ここで、USBインターフェース部3は、ホストシステム10側から送信されてくるシリアル信号のデータを、パラレル信号に変換してエンドポイント制御部4側に渡し、エンドポイント制御部4から受取ったパラレル信号をシリアル信号に変換して、ホストシステム10側に送信する回路である。   Here, the USB interface unit 3 converts the serial signal data transmitted from the host system 10 side into a parallel signal, passes it to the end point control unit 4 side, and receives the parallel signal received from the end point control unit 4. This is a circuit that converts it into a serial signal and transmits it to the host system 10 side.

又、エンドポイント制御部4は、コントロール用エンドポイント5、受信用エンドポイント6、及び送信用エンドポイント7に保持されるデータの送受信を制御する回路である。このエンドポイント制御部4は、USBインターフェース部3及びフラッシュメモリ制御部8とのインターフェース回路を備えており、このインターフェース回路を介してUSBインターフェース部3及びフラッシュメモリ制御部8とのデータや情報の受渡しが行われる。   The endpoint control unit 4 is a circuit that controls transmission / reception of data held in the control endpoint 5, the reception endpoint 6, and the transmission endpoint 7. The endpoint control unit 4 includes an interface circuit with the USB interface unit 3 and the flash memory control unit 8, and exchanges data and information with the USB interface unit 3 and the flash memory control unit 8 via the interface circuit. Is done.

又、コントロール用エンドポイント5は、起動時に初期設定データ等を保持するバッファ回路であり、受信用エンドポイント6は、ホストシステム10側から送信されてくる受信データを保持するバッファ回路であり、送信用エンドポイント7は、ホストシステム10側に送信する送信データを保持するバッファ回路である。   The control end point 5 is a buffer circuit that holds initial setting data and the like at the time of activation, and the reception end point 6 is a buffer circuit that holds reception data transmitted from the host system 10 side. The trusted endpoint 7 is a buffer circuit that holds transmission data to be transmitted to the host system 10 side.

又、フラッシュメモリ制御部8は下記のような回路で構成されている。
(1)フラッシュメモリ制御部8を構成する各回路の動作を制御する回路。
(2)内部コマンド(フラッシュメモリ9に与える内部コマンド)を実行する際に必要な情報が設定されるレジスタ及びこのレジスタに情報を設定する回路。
(3)フラッシュメモリ9の制御に必要なデータが一時的に格納される作業領域(複数のSRAMセルによって構成される。)。
(4)フラッシュメモリ9とデータ、アドレス情報、ステータス情報及び内部コマンド情報を授受する回路。
(5)フラッシュメモリ9に書込むデ―タに付加すべきエラーコレクションコードを生成するとともに、読出しデータに付加されたエラーコレクションコードに基づいて、読出したデータに含まれる誤りを検出・訂正する回路。
(6)エンドポイント制御部4、受信用エンドポイント6及び送信用エンドポイント7と情報やデータを授受する回路。
[フラッシュメモリに対する書込み処理の説明]
以下、ホストシステム側からの要求に基づいて、フラッシュメモリにデータを書込む処理を図面を参照して説明する。尚、USBインターフェースを介したデータ送信には、ハイスピードモードとフルスピードモードがあり、ハイスピードモードにおける最大パケットサイズは512バイトであり、フルスピードモードにおける最大パケットサイズは64バイトである。従って、パケットサイズが最大の場合、ハイスピードモードにおいては、1パケット分のデータが、フラッシュメモリの読出し及び書込みの処理単位である1ページ分のデータに相当するが、フルスピードモードにおいては、8パケット分のデータが、フラッシュメモリの読出し及び書込みの処理単位である1ページ分のデータに相当する。このような違いあるため、ハイスピードモードの場合とフルスピードモードの場合で異なる処理を行なっている。
The flash memory control unit 8 is composed of the following circuits.
(1) A circuit for controlling the operation of each circuit constituting the flash memory control unit 8.
(2) A register in which information necessary for executing an internal command (an internal command given to the flash memory 9) is set, and a circuit for setting information in the register.
(3) A work area (consisting of a plurality of SRAM cells) in which data necessary for controlling the flash memory 9 is temporarily stored.
(4) A circuit that exchanges data, address information, status information, and internal command information with the flash memory 9.
(5) A circuit for generating an error correction code to be added to data to be written in the flash memory 9 and detecting and correcting an error contained in the read data based on the error correction code added to the read data .
(6) A circuit that exchanges information and data with the endpoint control unit 4, the reception endpoint 6, and the transmission endpoint 7.
[Description of writing to flash memory]
Hereinafter, a process of writing data to the flash memory based on a request from the host system will be described with reference to the drawings. Data transmission via the USB interface includes a high speed mode and a full speed mode. The maximum packet size in the high speed mode is 512 bytes, and the maximum packet size in the full speed mode is 64 bytes. Therefore, when the packet size is the maximum, in the high speed mode, one packet of data corresponds to one page of data that is a processing unit of reading and writing of the flash memory. The data for the packet corresponds to the data for one page, which is the processing unit for reading and writing the flash memory. Because of these differences, different processing is performed in the high speed mode and the full speed mode.

まず、図5及び図6を参照して、ハイスピードモードの場合の処理について説明する。図5は、ホストシステム側から送信されてくるCBW(Command Block Wrapper)及Aパケット(以下、ハイスピードモードの場合のパケットをAパケットと表記する。)と受信用エンドポイントに保持されるデータの関係を示している。ここで、CBWには、コマンド情報が含まれており、ホストシステム側からの書込み要求は、CBWによってフラッシュメモリシステム側に伝達される。つまり、書込み要求時には、CBWに書込みコマンドの情報が含まれている。又、Aパケットには、フラッシュメモリに書込む512バイトのデータが含まれている。又、受信用エンドポイントはフラッシュメモリの1ページ分のデータを保持するため、512バイトに設定した。尚、受信用エンドポイントの容量については、フラッシュメモリのページ容量、パケットサイズ(データ容量)等を考慮して適宜設定することが好ましい。例えば、フラッシュメモリのページ容量、パケットサイズ(データ容量)の公倍数に相当する容量に、受信用エンドポイントの容量を設定することが考えられる。   First, processing in the high speed mode will be described with reference to FIGS. FIG. 5 shows a CBW (Command Block Wrapper) and an A packet (hereinafter referred to as a packet in the high speed mode) transmitted from the host system side and data held in the reception endpoint. Showing the relationship. Here, the CBW includes command information, and a write request from the host system side is transmitted to the flash memory system side by the CBW. That is, at the time of a write request, information on the write command is included in the CBW. The A packet includes 512 bytes of data to be written to the flash memory. The reception endpoint is set to 512 bytes in order to hold one page of data in the flash memory. The capacity of the reception endpoint is preferably set as appropriate in consideration of the page capacity of the flash memory, the packet size (data capacity), and the like. For example, it is conceivable to set the capacity of the reception endpoint to a capacity corresponding to a common multiple of the page capacity and packet size (data capacity) of the flash memory.

図5に示したCBWは、USBインターフェース部でパラレル信号に変換されエンドポイント制御部による制御のもと、受信用エンドポイント6に保持される。この際、エンドポイント制御部は、CBWに含まれるフラグ等に基づき、受信したデータがCBWであることを検知し、CBWを受信したことをフラッシュメモリ制御部に通知する。続いて、フラッシュメモリ制御部が、受信用エンドポイント6に保持されているCBWを読出し、CBWに含まれるコマンド情報が書込みコマンドであることを認識する。   The CBW shown in FIG. 5 is converted into a parallel signal by the USB interface unit and held in the reception end point 6 under the control of the end point control unit. At this time, the endpoint control unit detects that the received data is CBW based on a flag or the like included in the CBW, and notifies the flash memory control unit that the CBW has been received. Subsequently, the flash memory control unit reads the CBW held in the reception endpoint 6 and recognizes that the command information included in the CBW is a write command.

CBWを受信した後に送られてくるAパケットは、USBインターフェース部でパラレル信号に変換され、エンドポイント制御部による制御のもと、受信用エンドポイント6に保持される。この際、CBWが保持されていた部分にも、Aパケットに含まれる書込みデータ(フラッシュメモリへの書込みデータ)が保持される。従って、受信用エンドポイント6には、フラッシュメモリへの書込みデータだけが保持される。尚、受信用エンドポイント6は512バイトのバッファ回路であり、Aパケットには512バイトの書込みデータが含まれているので、受信用エンドポイント6には、フラッシュメモリの1ページ分のデータに相当するデータが保持される。   The A packet sent after receiving the CBW is converted into a parallel signal by the USB interface unit and held in the reception endpoint 6 under the control of the endpoint control unit. At this time, the write data (write data to the flash memory) included in the A packet is also held in the portion where the CBW was held. Therefore, only the write data to the flash memory is held in the reception endpoint 6. The reception endpoint 6 is a 512-byte buffer circuit, and the A packet contains 512 bytes of write data, so the reception endpoint 6 corresponds to data for one page of the flash memory. Data to be retained.

受信用エンドポイントに、フラッシュメモリの1ページ分のデータに相当するデータが保持されると、エンドポイント制御部からフラッシュメモリ制御部にその旨が通知され、受信用エンドポイントからフラッシュメモリへのデータ書込み処理が開始される。図6は、Aパケットのデータが保持されている受信用エンドポイント6と、データの書込み先となるフラッシュメモリ9のページとの関係を示している。ここで、受信用エンドポイント6に保持されているデータは、フラッシュメモリ制御部による制御のもと、消去済ブロック内のページに書込まれる。又、数ページ分のデータがAパケットで順次送られてくる場合、それらのデータを消去済ブロックのページ0から順次書込んでいく。(最初のデータをページ0に、次のデータをページ1というように順次書込んでいく。)。   When data corresponding to one page of data in the flash memory is stored in the reception endpoint, the end point control unit notifies the flash memory control unit of the fact, and the data from the reception end point to the flash memory is notified. The writing process is started. FIG. 6 shows the relationship between the reception end point 6 in which the data of the A packet is held and the page of the flash memory 9 to which the data is written. Here, the data held in the reception endpoint 6 is written to the page in the erased block under the control of the flash memory control unit. When several pages of data are sequentially sent in the A packet, the data are sequentially written from page 0 of the erased block. (The first data is sequentially written to page 0 and the next data is sequentially written to page 1).

次に、この書込み処理について説明する。書込み処理を行なう場合、フラッシュメモリ制御部内のレジスタに以下のような書込み処理の設定がなされる。
1)内部コマンドとして内部書込みコマンドがフラッシュメモリ制御部内の所定のレジスタに設定される。
2)書込み先のページアドレスがフラッシュメモリ制御部内の所定のレジスタに設定される。
続いて、上記書込み処理の設定に基づいて内部コマンドを実行される。この内部コマンドが実行されると、フラッシュメモリに内部コマンドを実行するための情報が供給される。その結果、受信用エンドポイント6に保持されているデータが、上記書込み処理の設定で指定したページアドレスのデータ領域に格納される。
Next, this writing process will be described. When the write process is performed, the following write process is set in the register in the flash memory control unit.
1) An internal write command is set as an internal command in a predetermined register in the flash memory control unit.
2) The page address of the write destination is set in a predetermined register in the flash memory control unit.
Subsequently, an internal command is executed based on the setting of the writing process. When this internal command is executed, information for executing the internal command is supplied to the flash memory. As a result, the data held in the reception endpoint 6 is stored in the data area of the page address specified by the setting of the writing process.

次に、図7及び図8を参照して、フルスピードモードの場合の処理について説明する。図7は、ホストシステム側から送信されてくるCBW(Command Block Wrapper)及Bパケット0〜7(以下、フルスピードモードの場合のパケットをBパケットと表記する。)と受信用エンドポイントに保持されるデータの関係を示している。ここで、CBWには、ハイスピードモードの場合と同様に書込みコマンドの情報が含まれている。又、Bパケット0〜7には、フラッシュメモリに書込む64バイトのデータが含まれている。又、受信用エンドポイントは、上記のように512バイトに設定されている。   Next, processing in the full speed mode will be described with reference to FIGS. FIG. 7 shows a CBW (Command Block Wrapper) and B packets 0 to 7 (hereinafter referred to as a packet in the full speed mode) transmitted from the host system side and a reception endpoint. This shows the relationship of data. Here, the CBW includes write command information as in the high-speed mode. The B packets 0 to 7 include 64 bytes of data to be written to the flash memory. Further, the reception endpoint is set to 512 bytes as described above.

図7に示したCBWは、USBインターフェース部でパラレル信号に変換されエンドポイント制御部による制御のもと、受信用エンドポイント6に保持される。この際、エンドポイント制御部は、CBWに含まれるフラグ等に基づき、受信したデータがCBWであることを検知し、CBWを受信したことをフラッシュメモリ制御部に通知する。続いて、フラッシュメモリ制御部が、受信用エンドポイント6に保持されているCBWを読出し、CBWに含まれるコマンド情報が読出しコマンドであることを認識する。   The CBW shown in FIG. 7 is converted into a parallel signal by the USB interface unit and held in the reception end point 6 under the control of the end point control unit. At this time, the endpoint control unit detects that the received data is CBW based on a flag or the like included in the CBW, and notifies the flash memory control unit that the CBW has been received. Subsequently, the flash memory control unit reads the CBW held in the reception endpoint 6 and recognizes that the command information included in the CBW is a read command.

ここで、フルスピードモードの場合、Bパケット0〜7の各パケットに含まれるデータの容量は64バイトなので、各パケットを受信する毎にエンドポイント制御部からフラッシュメモリ制御部に通知を行なうのではなく、受信用エンドポイント6に512バイトの書込みデータが保持されたときにエンドポイント制御部からフラッシュメモリ制御部に通知が行なわれるように設定する。つまり、Bパケット0〜7の各パケットに含まれるデータの容量が64バイトの場合には、受信用エンドポイント6に、8パケット分のデータが保持されたときにエンドポイント制御部からフラッシュメモリ制御部に通知が行なわれるように設定(以下、8パケット分のデータが保持されたときにエンドポイント制御部からフラッシュメモリ制御部に通知が行なわれる設定を受信データ蓄積モードと言う。)する。尚、ハイスピードモードとフルスピードモードに関係無く、常に、フラッシュメモリの1ページ分のデータが受信用エンドポイント6に保持されるまで、パケットに含まれるデータを受信用エンドポイント6に蓄積し続け、受信用エンドポイント6にフラッシュメモリの1ページ分のデータが保持された後にエンドポイント制御部からフラッシュメモリ制御部に通知が行なわれるように回路を設計してもよい。   Here, in the full speed mode, since the capacity of data included in each packet of B packets 0 to 7 is 64 bytes, the endpoint controller does not notify the flash memory controller every time each packet is received. Instead, the end point control unit is set to notify the flash memory control unit when 512 bytes of write data is held in the receiving end point 6. In other words, when the capacity of the data included in each of the B packets 0 to 7 is 64 bytes, the flash memory control is performed from the endpoint controller when the data for 8 packets is held in the reception endpoint 6. The setting is made so that the end point control unit notifies the flash memory control unit when data for 8 packets is held (hereinafter referred to as a reception data accumulation mode). Regardless of the high speed mode or the full speed mode, the data included in the packet is continuously accumulated in the reception endpoint 6 until the data for one page of the flash memory is always held in the reception endpoint 6. The circuit may be designed so that after the data for one page of the flash memory is held in the reception end point 6, the end point control unit notifies the flash memory control unit.

受信データ蓄積モードのもとBパケット0〜7は、USBインターフェース部でパラレル信号に変換されエンドポイント制御部による制御により、受信用エンドポイント6に順次蓄積されていく。この際、CBWが保持されていた部分にも、Bパケット0〜7に含まれる書込みデータ(フラッシュメモリへの書込みデータ)が保持される。   Under the reception data accumulation mode, the B packets 0 to 7 are converted into parallel signals by the USB interface unit, and are sequentially accumulated in the reception end point 6 under the control of the end point control unit. At this time, the write data (write data to the flash memory) included in the B packets 0 to 7 is also held in the portion where the CBW was held.

受信用エンドポイント6に、Bパケット0〜7の8パケット分のデータが保持されると(つまり、フラッシュメモリの1ページ分のデータに相当するデータが保持されると)、エンドポイント制御部からフラッシュメモリ制御部にその旨が通知され、受信用エンドポイントからフラッシュメモリへのデータ書込み処理が開始される。図8は、Bパケット0〜7のデータが保持されている受信用エンドポイント6と、データの書込み先となるフラッシュメモリ9のページとの関係を示している。ここで、受信用エンドポイント6に保持されているデータは、ハイスピードモードの場合と同様にフラッシュメモリ制御部による制御のもと、消去済ブロックのページに書込まれる。   When data for 8 packets of B packets 0 to 7 is held in the reception endpoint 6 (that is, data corresponding to data for one page of the flash memory is held), the endpoint control unit This is notified to the flash memory control unit, and data writing processing from the reception endpoint to the flash memory is started. FIG. 8 shows the relationship between the reception end point 6 in which the data of the B packets 0 to 7 are held and the page of the flash memory 9 to which the data is written. Here, the data held in the reception end point 6 is written to the page of the erased block under the control of the flash memory control unit as in the high speed mode.

又、フルスピードモードの場合の書込み処理も、ハイスピードモードの場合と同様に、フラッシュメモリ制御部内のレジスタに以下のような書込み処理の設定がなされる。
1)内部コマンドとして内部書込みコマンドがフラッシュメモリ制御部内の所定のレジスタに設定される。
2)書込み先のページアドレスがフラッシュメモリ制御部内の所定のレジスタに設定される。
続いて、上記書込み処理の設定に基づいて内部コマンドが実行される。この内部コマンドが実行されると、フラッシュメモリ9に内部コマンドを実行するための情報が供給される。その結果、受信用エンドポイント6に保持されているデータが、上記書込み処理の設定で指定したページアドレスのデータ領域に格納される。
In the write process in the full speed mode, the following write process is set in the register in the flash memory control unit as in the high speed mode.
1) An internal write command is set as an internal command in a predetermined register in the flash memory control unit.
2) The page address of the write destination is set in a predetermined register in the flash memory control unit.
Subsequently, an internal command is executed based on the setting of the writing process. When this internal command is executed, information for executing the internal command is supplied to the flash memory 9. As a result, the data held in the reception endpoint 6 is stored in the data area of the page address specified by the setting of the writing process.

次に、受信用エンドポイントからフラッシュメモリへのデータ書込み処理が完了したときに、その処理結果(正常に処理を完了したか否か等に関する情報)をホストシステム側に通知する処理について説明する。この処理では、フラッシュメモリ制御部が、書込み処理の完了後に、フラッシュメモリから書込み処理に関するステータス情報を受取り、このステータス情報に基づいてCSW(Command Status Wrapper)を作成する。   Next, a process for notifying the host system side of the processing result (information regarding whether or not the process has been completed normally) when the data writing process from the reception endpoint to the flash memory is completed will be described. In this process, the flash memory control unit receives status information related to the write process from the flash memory after the write process is completed, and creates a CSW (Command Status Wrapper) based on the status information.

フラッシュメモリ制御部は、作成したCSWを、図9に示したように送信用エンドポイント7に書込み、その旨をエンドポイント制御部に通知する。その後、エンドポイント制御部は、送信用エンドポイント7に書込まれているCSWを、USBインターフェース部を介して(USBインターフェース部でシリアル信号に変換して)ホストシステム側に送信する。このCSWには書込み処理結果に関する情報が含まれているので、ホストシステム側は、その情報に基づいて書込み処理結果を確認することができる。
[フラッシュメモリからの読出し処理の説明]
ホストシステム側からの読出し要求も、書込み要求の場合と同様に、CBWによってフラッシュメモリシステム側に伝達される。つまり、読出し要求時には、読出しコマンドの情報が含まれているCBWが、ホストシステム側から送信されてくる。そして、このCBWは、エンドポイント制御部による制御のもと、受信用エンドポイントに保持される。以下書込み要求の場合と同様に、エンドポイント制御部は、CBWに含まれるフラグ等に基づき、受信したデータがCBWであることを検知し、CBWを受信したことをフラッシュメモリ制御部に通知する。続いて、フラッシュメモリ制御部が、受信用エンドポイントに保持されているCBWを読出し、CBWに含まれるコマンド情報が読出しコマンドであることを認識する。
The flash memory control unit writes the created CSW to the transmission end point 7 as shown in FIG. 9, and notifies the end point control unit to that effect. Thereafter, the endpoint control unit transmits the CSW written in the transmission endpoint 7 to the host system side via the USB interface unit (converted into a serial signal by the USB interface unit). Since this CSW includes information related to the write processing result, the host system can confirm the write processing result based on the information.
[Description of reading from flash memory]
The read request from the host system side is also transmitted to the flash memory system side by the CBW, as in the case of the write request. That is, at the time of a read request, a CBW including read command information is transmitted from the host system side. The CBW is held in the reception endpoint under the control of the endpoint controller. Hereinafter, similarly to the case of the write request, the endpoint control unit detects that the received data is CBW based on a flag or the like included in the CBW, and notifies the flash memory control unit that the CBW has been received. Subsequently, the flash memory control unit reads the CBW held in the reception endpoint, and recognizes that the command information included in the CBW is a read command.

次に、CBWによってホストシステム側からフラッシュメモリシステム側に伝達された読出し要求に基づいて、フラッシュメモリからデータを読出す処理を、図面を参照して説明する。図10は、ホストシステム側から読出しを要求されたデータが格納されているフラッシュメモリ9と、ホストシステム側に送信するデータを保持する送信用エンドポイント7の関係を示している。   Next, processing for reading data from the flash memory based on a read request transmitted from the host system side to the flash memory system side by the CBW will be described with reference to the drawings. FIG. 10 shows the relationship between the flash memory 9 in which the data requested to be read from the host system side is stored and the transmission end point 7 holding the data to be transmitted to the host system side.

この読出し処理では、フラッシュメモリ制御部の制御もと、フラッシュメモリ9の1ページ分のデータが、フラッシュメモリ9から送信用エンドポイント7へ読出される。この際、フラッシュメモリ9から読出されるページの物理アドレス(フラッシュメモリ9内でのアドレス)は、ホストシステム側から供給された論理アドレスとアドレス変換テーブルから得ることができる。   In this reading process, one page of data in the flash memory 9 is read from the flash memory 9 to the transmission endpoint 7 under the control of the flash memory control unit. At this time, the physical address of the page read from the flash memory 9 (the address in the flash memory 9) can be obtained from the logical address supplied from the host system side and the address conversion table.

この読出し処理を行なう場合、フラッシュメモリ制御部内のレジスタに以下のような読出し処理の設定がなされる。
1)内部コマンドとして内部読出しコマンドがフラッシュメモリ制御部内の所定のレジスタに設定される。
2)送信用エンドポイント7へ読出すページのページアドレス(フラッシュメモリ9内でのアドレス)がフラッシュメモリ制御部内の所定のレジスタに設定される。
続いて、上記読出し処理の設定に基づいて内部コマンドが実行される。この内部コマンドが実行されると、フラッシュメモリ9に内部コマンドを実行するための情報が供給される。その結果、送信用エンドポイント7に、上記書込み処理の設定で指定したページアドレスのデータ領域に格納されているデータが読出される。
When this reading process is performed, the following reading process is set in the register in the flash memory control unit.
1) An internal read command is set in a predetermined register in the flash memory control unit as an internal command.
2) The page address (address in the flash memory 9) of the page to be read to the transmission endpoint 7 is set in a predetermined register in the flash memory control unit.
Subsequently, an internal command is executed based on the setting of the reading process. When this internal command is executed, information for executing the internal command is supplied to the flash memory 9. As a result, the data stored in the data area of the page address designated by the setting of the writing process is read out to the transmission end point 7.

ここで、フルスピードモードの場合、送信用エンドポイント7からホストシステム側へ送信されるパケットに含まれるデータの容量は64バイトであるが、フラッシュメモリの1ページ分のデータが送信用エンドポイント7に保持されるまで、送信用エンドポイント7からホストシステム側への送信を開始しないように設定(以下、8パケット分のデータが保持されたときにエンドポイント制御部からホストシステムへ送信される設定を送信データ蓄積モードと言う。)しておく。尚、ハイスピードモードとフルスピードモードに関係無く、常に、フラッシュメモリの1ページ分のデータが送信用エンドポイント7に保持されるまで、送信用エンドポイント7からホストシステム側への送信を開始しないように回路を設計してもよい。   Here, in the case of the full speed mode, the capacity of data included in a packet transmitted from the transmission endpoint 7 to the host system side is 64 bytes, but the data for one page of the flash memory is the transmission endpoint 7. Is set so that transmission from the transmission end point 7 to the host system side is not started until it is held in (the setting sent from the endpoint control unit to the host system when data for 8 packets is held below) (Referred to as transmission data accumulation mode). Regardless of the high-speed mode and the full-speed mode, transmission from the transmission endpoint 7 to the host system side is not always started until data for one page in the flash memory is held in the transmission endpoint 7. The circuit may be designed as follows.

又、ハイスピードモードの場合もフルスピードモードの場合も、送信用エンドポイント7に読出したデータに対するエラーコレクションコードの生成やエラー訂正が正常に行なわれた後に、送信用エンドポイント7からホストシステム側への送信を開始することが好ましい。   In both the high-speed mode and the full-speed mode, after the error correction code has been normally generated and corrected for the data read to the transmission endpoint 7, the transmission endpoint 7 sends the error to the host system. It is preferable to start transmission to.

又、送信用エンドポイント7はフラッシュメモリの1ページ分のデータを保持するため、512バイトに設定した。尚、送信用エンドポイント7の容量については、フラッシュメモリのページ容量、パケットサイズ(データ容量)等を考慮して適宜設定することが好ましい。例えば、フラッシュメモリのページ容量、パケットサイズ(データ容量)の公倍数に相当する容量に、送信用エンドポイントの容量を設定することが考えられる。   The transmission end point 7 is set to 512 bytes in order to hold one page of data in the flash memory. The capacity of the transmission endpoint 7 is preferably set as appropriate in consideration of the page capacity of the flash memory, the packet size (data capacity), and the like. For example, it is conceivable to set the capacity of the transmission end point to a capacity corresponding to a common multiple of the page capacity and packet size (data capacity) of the flash memory.

次に、送信用エンドポイントからホストシステム側への送信処理を説明する。図11は、ハイスピードモードの場合に、送信用エンドポイント7からホストシステム側へ送信されるパケットを示している。ハイスピードモードの場合、送信用エンドポイント7に保持されているデータが、1つのパケット(Aパケット)でホストシステム側へ送信される。つまり、送信用エンドポイント7に保持されている512バイトのデータが、512バイトのデータを含んだAパケットとして送信される。   Next, transmission processing from the transmission endpoint to the host system will be described. FIG. 11 shows a packet transmitted from the transmission end point 7 to the host system side in the high speed mode. In the case of the high speed mode, data held in the transmission endpoint 7 is transmitted to the host system side in one packet (A packet). That is, the 512-byte data held in the transmission end point 7 is transmitted as an A packet including 512-byte data.

図12は、フルスピードモードの場合に、送信データ蓄積モードのもと、送信用エンドポイント7からホストシステム側へ送信されるパケットを示している。フルスピードモードの場合、送信用エンドポイント7に保持されているデータが、8つのパケット(Bパケット0〜7)でホストシステム側へ送信される。つまり、送信用エンドポイント7に保持されている512バイトのデータが、64バイトのデータを含んだBパケット0〜7として送信される。   FIG. 12 shows a packet transmitted from the transmission end point 7 to the host system side in the transmission data accumulation mode in the full speed mode. In the case of the full speed mode, data held in the transmission end point 7 is transmitted to the host system side in eight packets (B packets 0 to 7). That is, 512-byte data held in the transmission end point 7 is transmitted as B packets 0 to 7 including 64-byte data.

尚、ホストシステム側への送信処理では、エンドポイント制御部の制御のもと、送信用エンドポイント7に保持されているデータが、USBインターフェース部でシリアル信号に変換されて送信される。   In the transmission process to the host system side, the data held in the transmission endpoint 7 is converted into a serial signal by the USB interface unit and transmitted under the control of the endpoint control unit.

又、送信用エンドポイントからホストシステム側への送信処理が完了した後に、読出し処理結果(正常に処理を完了したか否か等に関する情報)をホストシステム側に通知するためにCSWを送信する。この処理では、書込み処理の場合と同様に(図9参照)、フラッシュメモリ制御部は、作成したCSWを送信用エンドポイント7に書込み、送信用エンドポイント7に書込まれたCSWが、USBインターフェース部を介してホストシステム側に送信される。このCSWには、ホストシステム側からの読出し要求で指示されたデータが、全て正常に読み出すことができたか否かに関する情報が含まれている。従って、ホストシステム側は、この情報に基づいて書込み処理結果を確認することができる。   Further, after the transmission processing from the transmission endpoint to the host system side is completed, the CSW is transmitted to notify the host system side of the read processing result (information regarding whether or not the processing has been normally completed). In this process, as in the case of the write process (see FIG. 9), the flash memory control unit writes the created CSW to the transmission endpoint 7, and the CSW written to the transmission endpoint 7 is the USB interface. Sent to the host system side via This CSW includes information regarding whether or not all the data instructed by the read request from the host system side can be normally read. Therefore, the host system side can confirm the write processing result based on this information.

以上に説明したフラッシュメモリシステムでは、ホストシステム側のインターフェースがUSBインターフェースであったが、本発明に係るフラッシュメモリの制御回路、並びに、この制御回路を備えるメモリコントローラ及びフラッシュメモリシステムは、USBインターフェースに類するインターフェースを有するものにも適用することができる。例えば、USBの受信用エンドポイント及び送信用エンドポイントに類するバッファを備えたものにも適用することができる。   In the flash memory system described above, the interface on the host system side is the USB interface. However, the flash memory control circuit according to the present invention, and the memory controller and the flash memory system including the control circuit are compatible with the USB interface. It can also be applied to those having similar interfaces. For example, the present invention can be applied to a device having a buffer similar to a USB reception endpoint and a transmission endpoint.

図1は、本発明に係るフラッシュメモリシステム1を概略的に示すブロック図である。FIG. 1 is a block diagram schematically showing a flash memory system 1 according to the present invention. 図2は、フラッシュメモリ2を構成するメモリセル16の構造を概略的に示す断面図である。FIG. 2 is a cross-sectional view schematically showing the structure of the memory cell 16 constituting the flash memory 2. 図3は、書込状態であるメモリセル16を概略的に示す断面図である。FIG. 3 is a cross-sectional view schematically showing the memory cell 16 in the written state. 図4は、フラッシュメモリ2のアドレス空間の構造を概略的に示す図である。FIG. 4 is a diagram schematically showing the structure of the address space of the flash memory 2. 図5は、ホストシステム側から送信されてくるCBW及びパケットと受信用エンドポイント6に保持されるデータの関係を示す図である。FIG. 5 is a diagram showing the relationship between the CBW and packet transmitted from the host system side and the data held in the reception endpoint 6. 図6は、受信用エンドポイント6と、データの書込み先となるフラッシュメモリ9のページとの関係を示す図である。FIG. 6 is a diagram showing the relationship between the reception end point 6 and the page of the flash memory 9 to which data is written. 図7は、ホストシステム側から送信されてくるCBW及びパケットと受信用エンドポイント6に保持されるデータの関係を示す図である。FIG. 7 is a diagram showing the relationship between the CBW and packet transmitted from the host system side and the data held in the reception endpoint 6. 図8は、受信用エンドポイント6と、データの書込み先となるフラッシュメモリ9のページとの関係を示す図である。FIG. 8 is a diagram showing the relationship between the reception end point 6 and the page of the flash memory 9 to which data is written. 図9は、送信用エンドポイント7とホストシステム側に送信されるCSWの関係を示す図である。FIG. 9 is a diagram showing the relationship between the transmission end point 7 and the CSW transmitted to the host system side. 図10は、送信用エンドポイント7と、送信用エンドポイントに読出されるデータが格納されているフラッシュメモリ9のページとの関係を示す図である。FIG. 10 is a diagram showing the relationship between the transmission end point 7 and the page of the flash memory 9 in which data read to the transmission end point is stored. 図11は、ホストシステム側に送信されるパケットと送信用エンドポイント7に保持されるデータの関係を示す図である。FIG. 11 is a diagram showing a relationship between a packet transmitted to the host system side and data held in the transmission endpoint 7. 図12は、ホストシステム側に送信されるパケットと送信用エンドポイント7に保持されるデータの関係を示す図である。FIG. 12 is a diagram illustrating a relationship between a packet transmitted to the host system side and data held in the transmission endpoint 7.

符号の説明Explanation of symbols

1 フラッシュメモリシステム
2 メモリコントローラ
3 USBインターフェース部
4 エンドポイント制御部
5 コントロール用エンドポイント
6 受信用エンドポイント
7 送信用エンドポイント
8 フラッシュメモリ制御部
9 フラッシュメモリ
10 ホストシステム
16 メモリセル
17 P型半導体基板
18 ソース拡散領域
19 ドレイン拡散領域
20 トンネル酸化膜
21 フローティングゲート電極
22 絶縁膜
23 コントロールゲート電極
24 チャネル
25 データ領域
26 冗長領域
DESCRIPTION OF SYMBOLS 1 Flash memory system 2 Memory controller 3 USB interface part 4 Endpoint control part 5 Control endpoint 6 Reception endpoint 7 Transmission endpoint 8 Flash memory control part 9 Flash memory 10 Host system 16 Memory cell 17 P type semiconductor substrate 18 Source diffusion region 19 Drain diffusion region 20 Tunnel oxide film 21 Floating gate electrode 22 Insulating film 23 Control gate electrode 24 Channel 25 Data region 26 Redundant region

Claims (5)

USBインターフェースを介してデータを送受信する送受信手段と、
USBインターフェースを介して受信したデータを保持するための受信データ保持手段と、
前記送受信手段により受信されたデータであって、コマンドを含むCBW(Command Block Wrapper)とフラッシュメモリに書き込まれるユーザデータとを含むデータを前記受信データ保持手段に格納する受信データ格納手段と、
前記受信データ保持手段に保持されたユーザデータをフラッシュメモリに書込む書込み処理制御手段と、
USBインターフェースを介して送信するデータを保持するための送信データ保持手段と、
フラッシュメモリに格納されているユーザデータを読み出し、読み出したユーザデータを前記送信データ保持手段に格納する読出し処理制御手段と
を備え、
前記受信データ格納手段は、前記送受信手段により受信されたデータがCBWであるか又はユーザデータであるかを判別する機能を備え、CBWとユーザデータがこの順番で受信された場合に、先に受信されたCBWに対して後から受信されたユーザデータが上書きされるように前記受信データ保持手段にCBWとユーザデータを格納し、
前記書込み処理制御手段は、前記受信データ保持手段にフラッシュメモリの1ページ分のユーザデータが保持された後にフラッシュメモリへの書込み処理を開始することを特徴とするフラッシュメモリの制御回路。
A transmission / reception means for transmitting / receiving data via a USB interface;
Received data holding means for holding data received via the USB interface;
Received data storage means for storing in the received data holding means data received by the transmitting / receiving means, including CBW (Command Block Wrapper) including a command and user data written in a flash memory;
And write processing control unit write the user data held in the received data holding unit in the flash memory,
Transmission data holding means for holding data to be transmitted via the USB interface;
It reads the user data stored in the flash memory, and a read-out processing control means for storing the read user data to the transmission data holding unit,
The reception data storage means has a function of determining whether the data received by the transmission / reception means is CBW or user data, and when the CBW and user data are received in this order, the reception data storage means CBW and user data are stored in the received data holding means so that user data received later is overwritten on the received CBW,
The write processing control unit, after one page of user data in the flash memory is held in the received data holding unit, the flash memory control circuit, wherein the benzalkonium initiates a write operation to the flash memory.
前記CBWに基づいて実行された処理の結果を示すCSW(Command Status Wrapper)を、前記送信データ保持手段に格納するCSW格納手段を備え、
前記送受信手段は、前記読出し処理制御手段によ前記送信データ保持手段にフラッシュメモリの1ページ分のユーザデータが格納された後、又は前記CSW格納手段により前記送信データ保持手段にCSWが格納された後に送信処理を開始することを特徴とする請求項1記載のフラッシュメモリの制御回路。
CSW storage means for storing a CSW (Command Status Wrapper) indicating a result of processing executed based on the CBW in the transmission data holding means ;
Said receiving means, said after the user data of one page of the flash memory is stored in by Ri the transmission data holding unit to the read processing controller, or CSW is stored in the transmission data holding unit by the CSW storing means the control circuit of a flash memory according to claim 1, start to characterized and Turkey the transmission process after.
前記受信データ保持手段の容量が、フラッシュメモリの1ページ分のデータ容量と同一であることを特徴とする請求項1又は記載のフラッシュメモリの制御回路。 3. The flash memory control circuit according to claim 1, wherein the capacity of the received data holding means is the same as the data capacity of one page of the flash memory. 請求項1乃至記載のいずれかのフラッシュメモリの制御回路を備えたメモリコントローラ。 Memory controller having a control circuit of one of the flash memory according to claim 1 to 3, wherein. 請求項1乃至記載のいずれかのフラッシュメモリの制御回路とフラッシュメモリを備えたフラッシュメモリシステム。 Flash memory system including a control circuit and a flash memory of any of the flash memory according to claim 1 to 3, wherein.
JP2003282199A 2003-07-29 2003-07-29 Flash memory control circuit, and memory controller and flash memory system provided with the control circuit Expired - Fee Related JP4282401B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003282199A JP4282401B2 (en) 2003-07-29 2003-07-29 Flash memory control circuit, and memory controller and flash memory system provided with the control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003282199A JP4282401B2 (en) 2003-07-29 2003-07-29 Flash memory control circuit, and memory controller and flash memory system provided with the control circuit

Publications (2)

Publication Number Publication Date
JP2005050172A JP2005050172A (en) 2005-02-24
JP4282401B2 true JP4282401B2 (en) 2009-06-24

Family

ID=34267478

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003282199A Expired - Fee Related JP4282401B2 (en) 2003-07-29 2003-07-29 Flash memory control circuit, and memory controller and flash memory system provided with the control circuit

Country Status (1)

Country Link
JP (1) JP4282401B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7640378B2 (en) * 2005-03-11 2009-12-29 Icron Technologies Corporation Method and apparatus for improving the performance of USB mass storage devices in the presence of long transmission delays

Also Published As

Publication number Publication date
JP2005050172A (en) 2005-02-24

Similar Documents

Publication Publication Date Title
US7409473B2 (en) Off-chip data relocation
JP3979486B2 (en) Nonvolatile storage device and data storage method
KR100626393B1 (en) Non-volatile memory device and multi-page copyback method thereof
US20060064539A1 (en) Memory controller, flash memory system employing memory controller and method for controlling flash memory device
US20110119431A1 (en) Memory system with read-disturb suppressed and control method for the same
JP2005108304A (en) Semiconductor memory and its control method
JPWO2002052416A1 (en) Flash memory system
JP2008524747A (en) System and method using on-chip non-volatile memory write cache
JPWO2004031966A1 (en) Method for controlling nonvolatile memory device
CN112860194B (en) Memory control method, memory storage device and memory control circuit unit
JP4236485B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US7606993B2 (en) Flash memory controller, memory control circuit, flash memory system, and method for controlling data exchange between host computer and flash memory
JP4282401B2 (en) Flash memory control circuit, and memory controller and flash memory system provided with the control circuit
JP4470455B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4173410B2 (en) Memory controller and flash memory system including the memory controller
JP4233213B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
KR101398403B1 (en) Method and memory system for legacy hosts
JP4213053B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP3999564B2 (en) Memory controller, flash memory system, and flash memory control method
JP4561110B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US8886989B2 (en) Memory device
JP4282410B2 (en) Flash memory control circuit, and memory controller and flash memory system provided with the control circuit
JP4183550B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4304167B2 (en) Memory controller, flash memory system, and flash memory control method
JP4068594B2 (en) Flash memory controller, flash memory system, and flash memory control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060303

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080711

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080722

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20080905

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080911

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090317

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130327

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20140327

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees