The present invention relates to a nonvolatile storage device including a rewritable nonvolatile memory, and a memory controller, a nonvolatile storage system, and a data writing method for controlling this device.
A nonvolatile storage device including a rewritable nonvolatile main memory is widely demanded mainly in a semiconductor memory card. The memory card includes a flash memory as a nonvolatile memory and includes a memory controller for controlling it. The memory controller controls reading and writing data to the flash memory in accordance with directions of reading and writing from an access device such as a digital still camera and personal computer (PC) body.
In a nonvolatile storage device employing a nonvolatile memory, a device that rewrites data in a way of additionally writing is known (Patent document 1). In this nonvolatile storage device, when write data from a host are smaller than units of an erase block, the writing was executed suitably for a minimum writing unit (a sector or page) of the nonvolatile memory, not for an erase block unit. Hereby, a flash storage medium that can improve write performance with eliminating waste copy processing to continuous logical addresses in data writing operation is provided.
And now, a multi-level NAND flash memory is largely expected as a low-cost flash memory and has high possibility of being mainly used as a main storage memory in the memory card hereafter. Patent document 2 discloses an art in which a page structure of the multi-level NAND flash memory has been improved in order to realize high-speed access. In a conventional flash memory that is a two-level memory, one memory cell retains certain bit data of one page. On the other hand, in the multi-level NAND flash memory, each memory cell is configured by a plurality of pages, for example, by striding over two pages, that is, the memory cell retains data of plural bits.
In the multi-level NAND flash memory shown in
However, when one memory cell is configured striding over 2 pages, there is a problem that, if an error occurs during writing to one page, data stored in the other page change. The problem will be explained by using
Codes of “11”, “10”, “00”, and “01” are allocated to four distributions in
Patent document 1: Japanese Unexamined Patent Publication 2004-62328.
Patent document 2: Japanese Unexamined Patent Publication 2001-93288.
A problem on a system in a case where a multi-level NAND flash memory shown in
Consequently, the present invention intends to provide a memory controller, a nonvolatile storage memory, a nonvolatile storage system, and a method for writing data which do not cause the reliability problem if data recorded in predetermined page configuring the same memory cell with the other page have changed due to failure of writing processing to the predetermined page.
To solve the problems, a memory controller of the present invention which executes data writing and data reading to a memory on the basis of a writing and reading command provided from outside, wherein said memory includes a plurality of pages, the page is a unit of writing in the memory, a physical unit is configured with at least one page group consisting of first and second pages in which, when data writing is executed to either page, writing status of data to other page temporarily changes, and comprises: a physical unit writing portion for executing writing to the unwritten physical unit in response to a writing command from the outside.
To solve the problems, a nonvolatile storage device of the present invention comprising: a nonvolatile memory configured with a plurality of pages; and a memory controller which executes data writing and data reading to the nonvolatile memory on a basis of a writing command provided from outside, wherein the page is a unit of writing in the memory, a physical unit is configured with at least one page group consisting of first and second pages in which, when data writing is executed to either page, writing status of data to other page temporarily changes, and the memory controller includes a physical unit writing portion for executing writing to the unwritten physical unit in response to a writing command from the outside.
To solve the problems, a nonvolatile storage system of the present invention comprising an access device and a nonvolatile storage device, wherein the access device transmits at least a writing command and data to the nonvolatile storage device, the nonvolatile storage device includes: a nonvolatile memory configured with a plurality of pages, and a memory controller which executes data writing and data reading to the nonvolatile memory on a basis of a writing and reading command provided from outside, the page is a unit of writing in the memory, a physical unit is configured with at least one page group consisting of first and second pages in which, when data writing is executed to either page, writing status of data to other page temporarily changes, and the memory controller includes a physical unit writing portion for executing writing to the unwritten physical unit in response to a writing command from the outside.
To solve the problems, a data writing method of the present invention which executes data writing and data reading to a memory on a basis of a writing command provided from outside, wherein the memory includes a plurality of pages, the page is a unit of writing in the memory, a physical unit is configured with at least one page group consisting of first and second pages in which, when data writing is executed to either page, writing status of data to other page temporarily changes, and comprises: a physical unit writing step for executing writing to the unwritten physical unit in response to a writing command from the outside.
The memory may store data by using multi-level memory cells.
The memory may be a nonvolatile memory.
The physical unit may be configured with continuous 2n (n=1, 2, . . . ) pages.
When first data is written in units equal to or less than the physical unit in writing of one command from the outside, by copying second data from an already written physical units, the physical unit write portion may write data in units of the physical unit by using the first data and the second data.
A page information direction portion may be comprised for retaining information showing which pages in a plurality of the pages are included in the physical unit.
The physical unit may have an area where writing of data to be written from the outside is not executed.
The area where writing is not executed may be a portion of an area in the page group.
The physical unit may be configured with a plurality of discontinuous pages.
When data is written in the memory in accordance with a writing command from outside, the physical unit writing portion may vary a size of the physical unit depending on an amount of data to be written.
According to the present invention, if data changes on ground of specific error causing in a memory whose memory cell stores data in plural pages, a reliability problem such that an external host device cannot recognize the condition can be avoided in advance. As a result, the present invention achieves an effectiveness of high reliability equal to or more than that of a nonvolatile storage device using a conventional memory whose memory cell stores data of one page even in a nonvolatile storage device using a flash memory such as a multi-level NAND that enters the mainstream in future.
A nonvolatile storage system according to the first embodiment of the present invention will be described below.
The nonvolatile storage device 100A includes a nonvolatile memory being composed of a flash memory and a memory controller 120A. The nonvolatile memory 110 is a multi-level NAND flash memory in which one memory cell retains data striding over two pages. For example, as shown in
The access device 101 orders reading and writing user data (simply referred to as data below), transmits logical addresses where the data is stored, and transmits and receives data to and from the nonvolatile storage device 110A. Upon receiving the order of reading and writing from the access device 101, the memory controller 120A writes received data to the nonvolatile memory 110, and reads data from nonvolatile memory 110 and outputs them to outside.
Next, details of the memory controller 120A will be described. The memory controller 120A provided with the nonvolatile storage device 100A includes a host IF 121, a CPU 122 for controlling the whole of the memory controller 120A. And, the controller includes a RAM 123 which is a work area of the CPU 122 and a ROM 124 storing programs executed by the CPU 122. Further, the memory controller 120A includes a buffer memory 125 for temporarily storing data in the case of accessing to the nonvolatile memory 110, and an address management portion 126 for designating addresses in the nonvolatile memory 110.
A reading and writing control portion 127 writes data to the nonvolatile memory 110 based on addresses designated by the address management portion 126 and reads data in the nonvolatile memory 110.
The address management portion 126 includes a physical area management table 131, a logical-physical conversion table 132, and a write state management table 133. The address management portion 126, with referring to these tables, executes so-called address management such as selecting a physical block to which data transferred from the access device 101 are written and indicating a page to be written in the physical block, namely a current page number. In the physical area management table 131, a status of physical block that is a unit of erasing in the nonvolatile memory 101, that is, status flags showing whether valid data are stored or not are stored. The logical-physical conversion table 132 is a necessary table for converting a logical address transferred by the access device 101 into a physical address in the nonvolatile memory 110.
A page information direction portion 128 has a page information table 141 and stores page information concerning pages of data retained in memory cells.
The last word in the page information table 141 stores the number of pages included in one memory cell, 2 is stored here. In addition, the page information table 141 of
Further, the page information table 141 is composed of a volatile RAM such as SRAM, nonvolatile RAM such as ferroelectric memory (FeRAM), or ROM. In the case of the volatile RAM, it is only necessary that the CPU 122 configures it in, for example, SRAM on the basis of a device code that is read from the nonvolatile memory 110 by the CPU 122 in initialization processing at power-on. As an example of a concrete configuration method, the page information table is preliminarily stored in, for example, the ROM 124 by device type, and may be selectively transferred from the ROM 124 to SRAM on the basis of the device code. In addition, since the multi-level NAND flash memory having comparatively simple page configuration as shown in
Page number relevant information=Page number ̂0x01 (1)
When data is written to a physical block in a writing unit equal to or less than the physical unit, a physical unit write portion 129 controls data writing so that data is written in units of physical unit by copying data in other area configuring one physical unit with the data to unwritten area in the physical unit, based on a result of a boundary determined on the basis of the page information table 141.
An operation of the non-volatile storage device 100A will be described below.
Subsequently, the page information table 141 is configured in the page information direction portion 128 based on the device code read from the nonvolatile memory 110 (S103). Alternatively, the page information direction portion 128 may configure page configuration information by using a calculation function (corresponding to the expression 1) based on the device code.
Next, management regions in leading pages of all physical blocks in the nonvolatile memory 110 are read via the read and write control portion 127 (S104). After that, the physical management portion 131, logical-physical conversion table 132, and write state management table 133 are prepared in the address management portion 126 (S105).
And then, the CPU 122 determines a boundary based on the device code read at S102 (S106). For example, in the multi-level NAND flash memory shown in
Next, a process in normal operation after the initialization will be described by using a flow chart of
At first, the access device 101 transfers, for example, a writing command of 2 kB of logical addresses LA0 to LA3. Upon receiving a write command, the host IF 121 informs the CPU 122 of receiving the command and the CPU 122 retains data of a leading logical address from which the access device 101 starts writing (step S201 and S202).
Next, the CPU 122 directs the address management portion 126 to obtain one physical block to be written (S203). The address management portion 126 refers to the write state management table 133, and searches a registration corresponding to the logical address. When there is no registration corresponding to the logical address, an invalid physical block is searched in ascending order from an address selected at random and a firstly searched invalid physical block is set to be a physical block to be written. In this case, a page to be written is PN0 that is a leading page. When there is a registration in the write state management table 133, the registered physical block (PBA) is set to be a physical block to be written. In this case, a page to be written is a page next to the written page registered in the write state management table 133.
Next, the CPU 122 confirms whether an address from which the access device 101 starts writing is a leading position of a boundary or not (S204), when writing starts from a leading position of a boundary, data can be written in an unwritten physical unit from a leading position of the physical unit. Data of the logical addresses LA0 to LA3 transferred from the access device 101 is successively written via the buffer memory 125 at step 205.
Next, the CPU 122 confirms at step S206 whether the writing is made to the end of the boundary or not. When the writing is made to the end of the boundary, necessary updates to the physical area management table 131, the logical-physical conversion table 132, and the write state management table 133 are executed at step S207, the CPU responds completion of writing to the access device 101 (S208), and the process finishes. Upon receiving a response of completion of writing from the nonvolatile storage device 100A, the access device 101 as a host recognizes that data writing based on the writing command has normally completed and data have been written correctly.
When writing does not start from the leading position of a boundary at step S204, an address of page corresponding to old physical block is obtained on the basis of the physical area management table 131 and corresponding data is read from the old physical block (S209). Data of addresses until just before an address from which the access device 101 starts writing is copied successively from a leading position of the unwritten physical unit (first-half involving process). And, process returns to step S205.
When the writing is not made to the end of the boundary at step S206, an address of a page corresponding to old physical block is obtained at step S211 on the basis of the physical area management table 131 and corresponding data is read from the old physical block (S211). Data until the end of the boundary is copied (second-half involving process) then. And, process returns to step S207. In this way, writing from the leading position of a boundary to the end of the boundary is necessarily executed in response to one writing command from the access device 101.
Next, a writing process until a boundary will be described by using a concrete writing example. A physical block PB8 in
A case where data are successively written in sectors 12 and 13 of the same logical block will be described by using
As described above, in the embodiment of the present invention, since data is necessarily written in units of physical unit, that is, until a border of a boundary, a specific error of the nonvolatile memory 110 in which respective memory cells retain data striding over two pages, namely an error of changing data in a first page through writing in a second page, does not occur striding over a plurality of commands of the access device 101 as a host. A process for one command from the access device 101 is necessarily completed in units of physical units, and this is also referred to as closed. Therefore, a reliability failure to the effect that data, which the access device 101 recognizes as normally written data, is really destroyed can be eliminated.
Not limited in the case where a physical block is composed as
In addition, the nonvolatile memory 110 is a type of a memory in which respective memory cells retain data striding over two pages, however, a type of a memory retaining data striding over three pages can be applied to the present invention.
Next, a second embodiment of the present invention will be described. Since configuration of blocks showing configuration of a nonvolatile system according to the second embodiment is the same as that of
A multi-level nonvolatile memory as shown in
Next, writing process according to the second embodiment will be described by using a flowchart of writing in
Next, the CPU 122 directs the address management portion 126 to obtain one physical block to be written (S303). The address management portion 126 refers to the write state management table 133, and searches a registration corresponding to the logical address. When there is no registration corresponding to the logical address, the address management portion 126 searches an invalid physical block in ascending order from addresses selected at random and sets a firstly searched invalid physical block to be a physical block to be written. In this case, a page to be written is PN0 that is a leading page. When there is a registration in the write state management table 133, the address management portion 126 sets the registered physical block (PBA) to be a physical block to be written. In this case, a page to be written is a page that is subsequent to a written page registered in the write state management table 133 and is the first page in first page group. The page type information 141b in the page information direction portion 128 is used in order to determine whether it is a first page or a second page.
Next, the CPU 122 writes data of one page successively from an address from which the access device 101 starts writing (S304). After that, in S305, the CPU 122 obtains a position of the second page in the same group as the written page from the page number relevant information 141a in the page information direction portion 128 and retains the position as a sign showing a condition that writing is permitted. The address of the second page retained here is retained in effect during a period of one writing command from the access device 101 until writing is executed, but is deleted when one writing command from the access device 101 is completed. As a result, pages written in S304 are only first pages in respective page groups or only second pages of a page group retained in next step 305. That is to say, writing is not executed to second pages of page groups that are not retained in step S305.
Next, in step S306, it is determined whether writing of the access device 101 has finished or not, when the writing has not finished, the process continues returning to S304, and when the writing has finished, necessary updates to the physical area management table 131, the logical-physical conversion table 132, and the write state management table 133 are executed at step S307, the CPU responds completion of writing to the access device 101 (S308), and the process finishes. Upon receiving a response of completion of writing from the nonvolatile storage device 100A, the access device 101 as a host recognizes that data writing based on the writing command has normally completed and data has been written correctly.
As described above, pages to be written in step S304 are only limited to first pages in respective page groups or second pages of page groups whose first pages are written in processing of one writing command from the access device 101. Therefore, writing is not executed to second pages configuring the same page group as that of first pages written in a former writing command.
(1) When data of four sectors (one page) is written in one writing command from the access device 101 for example, the data is written only to page PN0 that is a leading page shown by hatching as shown in
(2) In addition, when data of 12 sectors (three pages) is written in one writing command from the access device 101, data is written in areas shown by hatching in the order of page number from page PN0 to page PN2 by writing in accordance with the similar writing rule as shown in
(3) When data of 16 sectors (four pages) is written by one writing command from the access device 101, data is written in PN0 to PN3 of GN0, GN1, and GN2 as shown in
As described above, an extended physical unit is adaptively changed in accordance with the number of pages to be written in one time by the access device 101, only one writing process is executed to the extended physical unit configured in the command, and following writing process is not executed to the remaining page. In embodiments of the present invention, an area necessarily including all page groups in an area to which data writing is executed is set to be an extended physical unit. For this reason, even in a case where an area closed in units of specific page groups can not be configured, a specific error of the multi-level NAND nonvolatile memory 110, that is, an error that changes data stored in a first page under the influence of a writing error of a second page does not occur striding over a plurality of commands from the access device 101. Therefore, reliability failure to the effect that data which the access device 101 recognizes as normally written is really destroyed can be eliminated.
Next, a modified example of the present invention will be described. A nonvolatile memory is configured so as to execute high-rate processing by using a plurality of, for example, two memory chips in parallel and by simultaneously reading and writing data from and to the two memory chips at the same time.
The memory controller, nonvolatile storage device, and nonvolatile storage system can improve reliability in a device using nonvolatile memory in which respective memory cells retain data striding over a plurality of pages such as a multi-level NAND flash memory. The present invention can be applied for a portable AV apparatus such as a recording and reproducing apparatus for a still image and motion picture, and for a storage medium for a portable communication device such as a cellular phone.
Number | Date | Country | Kind |
---|---|---|---|
2005-184364 | Jun 2005 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2006/310323 | 5/24/2006 | WO | 00 | 3/26/2008 |