The present application is based on, and claims priority from, JP Application Number 2007-336047, filed Dec. 27, 2007, and JP Application Number 2008-037139, filed Feb. 19, 2008, the disclosures of which are hereby incorporated by reference herein in their entireties.
The present invention relates to a method of and apparatus for refreshing a flash memory.
A flash memory is one type of electrically erasable and programmable read-only memory (EEPROM). A flash memory is a memory into which data are written (also called “programmed”) by charging capacitive cells located at intersections of word lines and bit lines. The written data are not lost as long as the electric charge is accumulated in the cell even if the power supplied to the cell is turned off. However, a so-called “read disturb error” can occur in a flash memory. A read disturb error is a phenomenon that, when data on a certain page of a certain physical block are frequently read out, data stored in a cell on other pages of the data block being read are changed.
Such a phenomenon occurs because, when data are read out from a selected cell, electric charge is injected into a floating gate of a non-selected cell, causing the non-selected cell to be virtually weakly programmed. Therefore, many more cells are affected as the number of times data are read from a physical data block increases. For this reason, a physical block of the flash memory must be refreshed (i.e. re-written) if the number of times data are read from the memory is relatively large. A limit on the number of times data can be read without executing a refresh is usually specified by the flash memory vendor, i.e. manufacturer. For example, among currently available products, a single-level cell (SLC) flash memory physical block must be refreshed when the number of data read cycles of a full particular physical block is in the range of 100,000 to 1,000,000 times, while a multi-level cell (MLC) flash memory physical block must be refreshed when the number of read data cycles is in the range of 10,000 to 100,000 times (generally, these limits tend to decrease as the number of data reading cycles of a particular physical block increases).
In the prior art refresh method, the number of read data cycles is counted for each physical block. In response to the number of times a host computer reading the data stored in such a physical block reaching the limit specified by the vendor, the data of such a physical block are refreshed by the host just after or just before the next time data are read from the block. For this reason, when plural physical blocks simultaneously reach the vendor specified limits the refreshes must be continuously executed. This makes maintaining a desired data transfer rate between the host and memory difficult. As a result, data transferred into the host might be temporarily interrupted to such an extent that a user of a machine including the host and memory is likely to be annoyed.
Accordingly, an object of the present invention is to provide a flash memory refresh method and apparatus that efficiently and reliably prevents data from changing due to a read disturb error, and prevents transferring data to a host because of a temporary interruption to such an extent that a user of the data transfer is not annoyed, i.e. the user does not notice the interruption because it is so short or the transfer occurs while the user is not actively using the host. Other objects will be apparent from the specification, and the appended drawings and claims.
To provide a flash memory refresh method and apparatus that efficiently prevents data from changing due to a read disturb error, and prevents transferring data to a host because of a temporary interruption, 1) the flash memory device includes a refresh management table that stores, updates and manages, for each physical block in the flash memory, the number of times data are read and the number of times data are erased, and 2) a refresh flag is set for a particular physical block in response to the number of times data are read from the particular physical block reaching or exceeding a predetermined value, and 3) a refresh is executed according to the state of the flag.
In addition, in order to achieve the above-described objects, the present invention employs novel, characteristic configurations as defined in the claims which cover from a superordinate concept to a subordinate concept.
Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. However, the invention is not limited thereto and various changes and modifications can be made thereto without departing from the spirit and scope of the claims.
Basic System Configuration
The flash memory device 2 and host 1 can be integrated with each other in a system such as an MPEG music player via an IDE (ATA) Interface, for example. The host 1 can also be a personal computer (PC), and the flash memory device 2 can be a separate device, such as a device coupled to the PC, for example a SSD (Solid State Drive), via an interface such as an IDE or a universal serial bus (USB). The interfaces couple the command issued by the host 1 to flash memory device 2.
The flash memory 22 also includes a management area, as well as a user data area. Data in the refresh management table 222 are stored in a non volatile manner in the management area of the flash memory 22. By using the refresh management table 222, the controller 21 records the number of times data have been read and erased from each physical block of memory 22.
When the system of
The limit on the number of data read operations for a particular physical block depends on the number of data erasures that have been executed on the particular physical block in the past. In general, the limit tends to decrease as the number of data erasures that have been executed in the past on the particular data block increases (see
In the prior art refresh method, when the controller 21 receives a data read command from the host 1 and the number of times data have been read from a particular physical block is found to have reached its vendor-specified limit, the data read operation by a CPU (not shown) within controller 21 is interrupted to refresh the physical block. In the embodiment of
In this case, if the controller threshold that is a criterion for executing a refresh operation is set to the same value as the vendor-specified value, the number of read data cycles is likely to exceed the above-described limit in the time interval between host 1 issuing the data read command and the start of a refresh operation. It is annoying for a user of a system including device 2 for such a limit to be exceeded because it causes an interruption in the operation of host 1. For this reason, the controller threshold is set to a value lower than the vendor-specified value so that a refresh is effectively executed before the number of times data read from a particular physical block reaches its vendor-specified limit.
If the power supply of the device 2 is shut off or disconnected from the device 2, the data of the refresh management table 222 are recorded in a non-volatile manner in the management area of flash memory 22, and the table 222 is coupled to and spread out in the RAM 23 the next time power is supplied to the system. Also, because the power supply might be shut off or disconnected from device 2 for some reason, it is preferable for the data of the refresh management table 222 in the RAM 23 to be periodically (e.g. every 10 minutes) recorded or updated in a management area of the flash memory 22.
Auto-Refresh
Controller 21 automatically executes a refresh by using an internal timer and a firmware program previously installed in the controller 21. The firmware program is executed on the basis of a timed event, e.g. a particular time associated with the start of a workday.
Controller 21 can execute an auto-refresh operation on the firmware program at predetermined periodic time intervals, e.g. once every several seconds or once every several minutes, while the device 2 is powered on. Because the power of device 2 is on at all times in many systems, the program can cause the auto-refresh operation to be executed at a predetermined time, e.g. 9:00 am, in the morning.
If the timed event occurs and host 1 has not supplied a write or read command to the controller 21 and a (Low) flag is set for one or more physical blocks when the timed event occurs, the controller 21 executes a refresh of the physical blocks having the set Low flag.
To this end, controller 21 searches for physical blocks having a set Low refresh flag in the refresh flag column of the refresh management table 222 indicated in
In
However, because the controller thresholds are set to differ in each of ranges (A, B and C), the prior art refresh order differs from the refresh order of memory device 2. By using the above-mentioned two methods, the physical blocks are refreshed in descending order of the likelihood of causing a read disturb error. Thus, a read disturb error is more reliably prevented.
If the timed event occurs when the controller 21 is executing a media access (data read) in response to a command from the host 1 and if multiple physical blocks are required to be refreshed, a refresh is executed at given or predetermined periodic time intervals, from the start of refresh of one physical block to the start of a refresh of the next physical block, for each physical block.
It takes 100 ms (milliseconds), at the most, from the start of a refresh of one particular physical block to the completion of the refresh operation for that particular block. For this reason, the refresh interval can be set to, e.g., 1 second. That is, a refresh operation is executed in a time-sharing manner i.e. by interrupting the continuous media access.
Thus, even if there are plural blocks required to be refreshed in the ongoing process, the transfer of data read from flash memory 22 to host 1 is not interrupted for a long time interval. In particular, even if music, moving images or the like are stored in the flash memory 22 and plural physical blocks reach a status requiring simultaneous refreshing, a high data transfer rate from memory 22 to host 1 is maintained by refreshing such plural physical blocks in a time-sharing manner. Thus, the user does not realize refreshing is occurring and is not annoyed by the refreshing action.
The refresh method will now be specifically described with reference to
In the prior art, first, 1) data of a physical block are temporarily stored in a buffer, next, 2) the data of the physical block are erased, and then 3) the buffer-stored data are rewritten to the original block. In the prior art, if the power supply is shut off or disconnected from device 2 for some reason after execution of eraser step 2) and before execution of rewriting step 3), the original data are completely erased, i.e., lost. By using a controller and method as described above, if there is a power supply failure or other interruption, the original data are not lost.
Refresh operation in response to a COMMAND from host 1
Besides the auto-refresh mentioned above, the refresh can also be executed in response to host 1 issuing a predetermined command to controller 21, as can occur when the host 1 is not performing a media access. To this end, the following commands are programmed in driver software of the host 1.
1. Get Refresh Pending Status Command
This is command from host 1 causes controller 21 to notify the host 1 of the number of physical blocks having a set “Low” or “High” refresh flag (discussed later) in the refresh management table 222 of flash memory 22, or as spread out in RAM 23.
2. Execute Refresh Command
This command from host 1 causes controller 21 to perform a refresh operation on one or more physical blocks of memory 22. The number of the physical blocks to be refreshed is specified by this command. This command also includes the logic block address(es) of the block(s) to be refreshed; the address converter in controller 21 converts the logic block address(es) to the appropriate physical block address(es).
3. Save Refresh Table Command
This command from host 1 causes the controller 21 to transfer data stored in refresh management table 222 into the management area of flash memory 22. Upon completing such storing, this command is completed.
The following command-issue order of host 1 is preferable.
a) Host 1 initially supplies to controller 21 the GET REFRESH PENDING STATUS COMMAND so the controller is supplied with an indication of the number of physical blocks required to be refreshed.
b) Host 1, responds to a signal that controller 21 derives (the controller 21 derives indicates the controller 21 has found the blocks required to be refreshed) by supplying the EXECUTE REFRESH COMMAND to controller 21 at a time while the controller 21 is not performing a media access. Controller 21 responds to the EXECUTE REFRESH COMMAND by executing a refresh according to the program stored in the controller 21. The EXECUTE REFRESH COMMAND enables the refresh to be executed only when it should be done, to improve system performance.
c) Host 1 then supplies to controller 21 the SAVE REFRESH TABLE COMMAND to cause the controller 21 to transfer, in a non-volatile manner, the data of refresh management table 222, into the management area of the flash memory 22; controller 21 performs the transfer at a predetermined time interval. As a result of this command, data of refresh management table 222 are efficiently protected, (i.e., cannot be lost) even though the power supply might, for some reason, shut down or be disconnected from system (host 1 and device 2) during the transfer.
According to the above embodiment, the refresh operation essentially does not interrupt the transfer of digital data, such as music or moving images, to the host 1 from flash memory 22 interrupted so the user is not annoyed by the refresh operation.
Coping with Bit Errors
When user data are written to a flash memory, an error check code created during the data write operation is added to the user data. When the data are read from the flash memory, they are checked according to the error check code by an error correcting circuit (not shown) within the controller 21 to determine whether or not there is an error in the written data. If the number of bit errors is within the ability of the controller to correct the errors (e.g. 8 bits or less), the bit errors can be corrected. If the number of bit errors is more than the ability of controller 21 to correct the errors, the bit errors can not be corrected. This means that the block has become a bad (i.e. defective) block due to numerous data write or erase cycles being executed in the block.
Accordingly, to assure safety in the refresh method discussed above when the number of bit errors in a particular physical block reaches a predetermined number (referred to as “bit error threshold”, e.g. 7 bits) greater than the ability of the controller to correct the errors (referred to as “controller ability value”, e.g. 8 bits), the data of such a physical block are rewritten to a spare block and the original physical block that had been used until that time is regarded as a bad block.
In that case, the CPU of controller 21 sets a “High” refresh flag for such a physical block in refresh management table 222 (see the “refresh flag” column in
In
Coping with such an emergency is also performed by controller 21 (1) temporarily storing in buffer 221 the corrected data of a block detected as having an error, (e.g. block 4) (2) then rewriting the stored data in buffer 221 to the spare block (not shown) in memory 22, then updating, in the logic block/address block conversion table, the logic block address associated with the physical block address where the data formerly stored in the bad block are now stored , and (3) then updating the contents of the spare block table. The bad blocks are kept in mothballs. Even though these actions of rewriting the data of the bad block to the spare block, to cope with bit errors, are not exactly a refresh, such rewriting is treated as a “refresh” by memory device 2 of
Next, an exemplary management operation performed by controller 21 in response to a command issued by host 1 is described by referring to
If the result of step SP2 is “No,” controller 21 determines whether the command issued by host 1 for the particular physical data block is a data read command (SP5). If the determination by step SP5 is “yes”, operation proceeds to step SP6 (
Then the program of controller 21 advances to step SP7, during which controller 21 increases by 1 (one) the indication in table 222 for the “number of times data are read,” for the physical block of memory 22 corresponding to the logic block address issued by host 1. Next, controller 21 determines, during step SP8, for the physical block corresponding to the logic block address issued by host 1, whether the “number of times data are read” is equal to or more than the appropriate controller threshold indicated by one of the dotted lines of
If the result of step SP5 is “No” (i.e., the command issued by host 1 to memory device 2 is not a data write command, a data erase command, or a data read command), the program of controller 21 proceeds to step SP17, during which controller 21 determines whether the issued command is a refresh command (see
If the RAM 23 is externally connected to the controller 21, the RAM may be a conventional random access memory, or a dynamic random access memory (DRAM) or a SDRAM (synchronous DRAM).
In addition, as shown in
In a game machine or the like, the data stored in memory 22 are read many times during a day. Generally, the audio and video data stored in memory 22 are managed in a file having data composed of multiple physical blocks.
In such a case, it is preferable for device 2 to record in refresh management table 222 the number of times every file which accommodates audio and video data representing the contents of such a game are read. Controller 21 commands table 222 to increase the number of times the file of such a game is read when device 2 is turned on every morning. In response to turn on of device 2, controller 21 also (1) retrieves from table 222 the daily maximum number of times such files can be read without exceeding the limit on the number of times such files can be read or (2) calculates a daily average of the number of times each such file has been read up to the previous day. These actions enable controller 21 to anticipate whether a refresh flag for a particular physical block is likely to be set during the day. In response to the anticipated result being “yes,” controller 21 refreshes the physical block(s) before device 2 is activated to a state that enables players to use the system that day. This is a feed-forward control.
While there have been described plural embodiments of the invention, it will be clear that variations in the details of the embodiments specifically illustrated and described can be made without departing from the true spirit and scope of the invention, as defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2007-336047 | Dec 2007 | JP | national |
2008-037139 | Feb 2008 | JP | national |