1. Description of Related Art
The present invention relates to a flash memory storage device and the judgment method thereof, more particularly to a method of judging problem storage regions of the flash memory storage device.
2. Description of Related Art
Flash memory is a non-volatile storage with advantages of high storage density, low power consumption, effective storage efficiency, and reasonable price cost etc. In flash memories, NAND (NAND Gate)-type flash memory is the main type and usually used in a device, such as a memory card, a U-disk, a solid disk driving device etc., and a memory system consisting an electronic equipment.
Since data signals recorded in memory units of a flash storage will become weak with time which causes the reliability of written data also become decreased, Error Correction Code (ECC) system is hence built for detecting and correcting error codes of the data. In a data writing period, ECC is generated by an ECC module coded according to content of the data, and stored into redundancy regions of a paging together with the data. When reading data from a paging, another group of ECC generated by the ECC module coded according to current content of the data, then compared with the original ECC to pick up and correct the error codes of the data.
However, error correction ability of the ECC module is limited. If the amount of the error codes of the data exceeds an error correction limitation, then, not all error data can be corrected. In the prior arts, the error correction ability of ECC is higher than the error codes of the data usually for assuring the reliability of data correction. Through setting limited value of the amount of the error codes of the data, the storage regions which have the amount of the error codes of the data in a paging more than the limited value will be judged as problem storage regions and be eliminated in time. In details, in a reading period, when the amount of the error codes of the data is judged as more than the limited value, the paging being read or the region to which the paging belongs will be judged as problem storage region by the storage device. Then the paging or the region to which the paging belongs will be labeled as destroyed storage region in a particular location, and the corrected data will be copied to other substantial location in the memory to end the use of the problem storage region.
But some problems may exist in the judging mode of the above problem storage region: The judgment of the problem storage region is only operated in the reading period. If the storage ability of the paging has become weak before the data is written into, then the result is that the amount of error of the inner data increases a lot after the data is written. Then, in the following data reading on the problem paging, the amount of error codes of the data is in great possibility more than the error correction limitation of the storage device, which causes the error data cannot be restored as correct data.
Accordingly, an object of the present invention is to provide a flash memory storage device which is capable of verifying problem storage regions thereof.
Another object of the present invention is to provide a method of judging problem storage regions of a flash memory storage device.
In order to achieve the above-mentioned object, a flash memory storage device comprises a flash memory chip, and a memory controller. The flash memory chip comprises a plurality of region blocks each comprising a plurality of pagings. The flash memory chip comprises a state output port for outputting a state signal, wherein when the flash memory chip is in an armed state, the standard level of the state signal is a first logical value, while when the flash memory chip is in a working state, the standard level of the state signal is a second logical value. The memory controller controls the access to the flash memory chip. When the memory controller sends a writing order to said flash memory chip for writing a written data to an appointed storage paging of the pagings, the memory controller gets the first time when the state signal changes from the first logical value to the second logical value, and the memory controller gets the second time when the state signal changes from the second logical value to the first logical value. The memory controller calculates a writing time according to the first time and the second time and judges whether the writing time is coincident with a standard value. If the writing time is not coincident with the standard value, the memory controller controls the flash memory chip to label the appointed storage paging as a problem storage region and copy the written data to a backup paging, and updates a Mapping Table according to the information of labeling the appointed storage paging as the problem storage region and the backup information of said written data.
In order to achieve the above-mentioned object, a method of judging problem storage regions adapted for a flash memory storage device, wherein the flash memory storage device comprises a flash memory chip which comprises a plurality of region blocks, and each region block comprises a plurality of pagings. The method of judging problem storage regions comprises steps of: sending a writing order to the flash memory chip for writing a written data to an appointed storage paging of the pagings; getting the first time when the flash memory chip starting writing said written data to the appointed storage paging; getting the second time when the flash memory chip finishing writing the written data to the appointed storage paging; calculating a writing time according to the first time and the second time; judging whether the writing time is coincident with a standard value; if the writing time is not coincident with the standard value, labeling the appointed storage paging as a problem storage region and copying said written data to a backup paging; and updating a Mapping Table according to the information of labeling the appointed storage paging as a problem storage region and the backup information of the written data.
The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention.
For a more complete understanding of the present invention, and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention. However, it will be obvious to those skilled in the art that the present invention may be practiced without such specific details. In other instances, well-known circuits have been shown in block diagram form in order not to obscure the present invention in unnecessary detail. For the most part, details concerning timing considerations and the like have been omitted inasmuch as such details are not necessary to obtain a complete understanding of the present invention and are within the skills of persons of ordinary skill in the relevant art.
Reference will be made to the drawing figures to describe the present invention in detail, wherein depicted elements are not necessarily shown to scale and wherein like or similar elements are designated by same or similar reference numeral through the several views and same or similar terminology.
The method of judging problem storage regions of a flash memory storage device of the present invention is mainly by monitoring the writing period of data of the flash memory chip, to verify storage ability of the storage regions, hence picking up problem storage regions and eliminating the problem storage regions in time.
Firstly, please refer to
The storage device 10 could be an independent data storage device, such as a memory card, a U disk, a solid disk driver etc., or a memory system in different kinds of electronic devices, such as a mobile phone, an audio player, a video device etc. For example, in one embodiment of the present invention, the host 80 and the storage device 10 are two independent devices. The host 80 is a computer system, while the storage device 10 is a data storage device connecting to the computer system 80. In an alternative embodiment of the present invention, the host 80 and the storage device 10 are integrated into one electronic device, the host 80 is the central process unit for the electronic device, while the storage device 10 is the memory system of the electronic device.
Please refer to
In the memory controller 11, the control module 111 sends a writing order, a reading order or an erasing order to the flash memory chip 13 according to the commands of an outer host, and controls the operation of other function modules of the memory controller 11. The data buffer region 113 is served as a data temporary storage region during the host and the flash memory chip 13 transmit data therebetween. The ECC module 115 receives control from the control module 111 to code and decode the ECC for the temporary data in the data buffer region 113.
It should be noted that the storage device 10 records the corresponding relationship between the logical location and the substantial location of the data by a Mapping Table. The Mapping Table could be stored in the program memory of the memory controller 11, or stored in the storage region 131 of the flash memory chip 13. When the system is started, the control module 111 can access the data of the Mapping Table. Further, when the host requires reading data, the control module 111 converts the required access logical addresses into substantial addresses to consist access orders which are sent to the flash memory chip 13. When the host requires writing data, the control module 111 collocates substantial addresses to consist write orders. Then the control module 111 updates the Mapping Table according to the relationship between the logical addresses and the substantial addresses of the written data.
Please refer to
The data transmission interface 1331 is coupled between the data buffer region 113 and the storage region 131 for bidirectional data transmission. The control signal receipt port 1333 is coupled between the control module 111 and the storage region 131 for receiving control signals from the control module 111, such as writing or reading orders, hence controlling the operation of the storage region 131. The state output port 1335 is coupled between the control module 111 and the storage region 131, for a state signal R/B output to the memory controller 11.
The state signal R/B will be explained detailedly hereinafter. The state signal R/B is used for indicating the real-time state of the flash memory chip 13. When the flash memory chip 13 does not execute paging access or region erase actions to the storage region 131, the state thereof is in an armed state, and the flash memory chip 13 controls the standard level of the state signal R/B in the first logical value. Contrariwise, when the flash memory chip 13 receives control of the memory controller 11 to execute paging access or region erase to the storage region 131, the flash memory chip 13 is in working state, and the signal standard level of the state signal R/B is of the second logical value controlled by the flash memory chip 13. The first logical value could be high standard level or low standard level. While, the second logical value could be the contrary value of the first logical value.
A flash memory chip usually is equipped with R/B (or RY/BY) pin whose function is as described for the state output port 1335, that is, representing the state of the chip via controlling the logical value of the pin output signal.
Please refer to
As illustrated in
The above testing mechanism is only used in the manufacturing process of a flash memory chip. Current early retirement mechanism of problem storage region of a flash memory judges problem storage region only by the amount of error codes in a data reading period. In the present invention, the flash memory storage device is equipped with function of monitoring the writing time of a paging by which to judge the quality of the storage region, thus the early retirement mechanism for problem storage region of the flash memory is more effective.
Please refer to
The storage device 10 judges the data storage ability of the paging via data writing period to prevent writing the data to a problem storage region, and ends use of the problem storage region, thus improving the data storage reliability.
The data writing period monitor mechanism is realized by the control module 111 of the memory controller 11. Please refer to
The state signal receipt unit 1111 is coupled to the state output port 1335 of the flash memory chip 13 to receive the state signal R/B. The monitor unit 1113 is coupled to the state signal receipt unit 1111 for monitoring the signal standard level change of the state signal R/B. When the monitor unit 1113 detects that the state signal R/B changes from the first logical value to the second logical value, the time unit 1115 is initiated to get the time when the signal standard level changes as the first time. When the monitor unit 1113 monitors that the state signal R/B changes from the second logical value to the first logical value, the time unit 1115 is initiated again to get the time when the signal standard level changes as the second time. The calculation unit 1117 is coupled to the time unit 1115 to receive the first time and the second time gotten by the time unit 1115, then calculates the difference as the writing time. The judgment unit 1119 is coupled to the calculation unit 1117 to receive the writing time calculated by the calculation unit 1117 and judges whether the writing time is coincident with the standard value. When the judgment unit 1119 judges that the writing time is not coincident with the standard value, then judges the appointed storage paging to which the writing order directs is a problem storage region.
In practice, standard parameters could be set according to above function units and the corresponding operating process and embedded in the memory controller 11 to realize the storage region quality judgment in a writing period. The standard parameters could be set according to the category of the memory. Further, if the flash memory chips have different kinds of memories, then different groups of standard parameters could be set. Then, corresponding standard parameters will be accessed and compared with the writing time according to memory type of the writing paging.
Further explanation to the management of the problem storage regions will be introduced hereinafter. Please refer to
Please refer to
S101: the memory controller 11 sends a writing order to the flash memory chip 13 according to a writing command from an outer host for writing the written data to an appointed storage paging. The memory controller 11 sends the written data temporarily stored in the data buffer region 113 to the paging buffer 1311 of the flash memory chip 13 for temporary storage.
S103: when the control module 111 detects the state signal R/B changes from the first logical value to the second logical value, it is judged that the flash memory chip 13 begins writing the written data to the appointed storage paging, that means getting the signal standard level changing time as the first time.
S105: the control module 111 continues monitoring the state signal R/B. When the control module 111 detects the state signal R/B changes from the second logical value to the first logical value, it is judged that the flash memory chip 13 finishes writing the written data to the appointed storage paging, that means getting the signal standard level changing time as the second time.
S107: the control module 111 calculates the writing time according to the first time and the second time, that is the difference between the first time and the second time, and defines the difference as the writing time.
S109: the control module 111 judges whether the writing time is coincident with the standard value. If not, the memory controller 11 controls the flash memory chip 13 to label the appointed storage paging as a problem storage region, and the memory controller 11 allocates another backup paging and controls the flash memory chip 13 to copy the original written data to the backup paging.
S111: the control module 111 updates the Mapping Table according to the information in S109, that is the storage paging is labeled as a problem storage region and the written data is stored in the backup paging.
Then, please refer to
S201: the memory controller 11 sends a reading order to the flash memory chip 13 according to a data reading command from the outer host to read the storage data from the appointed reading paging. The flash memory chip 13 responds to the reading order to send the storage data in the appointed reading paging to the data buffer region 113 for temporary storage.
S203: the memory controller executes error codes detection to the storage data temporarily stored in the data buffer region 113 by the ECC module 115.
S205: the ECC module 115 executes error codes correction to the storage data.
S207: the control module 111 judges whether the amount of the error codes of the storage data exceeds the limited value. If yes, the control module 111 judges that the appointed reading paging has problem, and sends a control signal to the flash memory chip 13 to label the appointed reading paging as a problem storage region.
S209: the control module 111 further allocates a redundant back paging and sends a write data to the flash memory chip 13 to backup the corrected storage data temporarily stored in the data buffer region 113 to the backup paging of the flash memory chip 13.
S211: the control module 111 updates the Mapping Table according to the information of labeling the appointed reading paging as a problem storage region and the backup information of the corrected storage data.
Please refer to
S301: the storage device 10 starts the judgment flow of problem storage regions according to the data access command from the outer host.
S303: the memory controller 11 judges whether the paging access to the flash memory chip 13 is data writing.
S311: If yes, the memory controller 11 sends a writing order to the flash memory chip 13.
S313: Then, the memory controller 11 monitors the state signal R/B to judge whether the flash memory chip 13 begins writing the data to the appointed storage paging.
S315: If yes, the control module 111 of the memory controller 11 gets the first time.
S317: then the memory controller 11 continues monitoring the state signal R/B to judge whether the flash memory chip 13 finishes data writing.
S319: If yes, the memory controller 11 gets the second time.
S321: the control module 111 calculates the writing time according to the first time and the second time.
S323: the control module judges whether the writing time is coincident with the standard value.
S361: If the judgment result is yes, the judgment flow of the problem storage regions is ended.
S325: If the judgment result is not, the memory controller 11 controls the flash memory chip 13 to label the appointed writing paging as a problem storage region and backup the original written data to the backup paging.
S327: then the memory controller 11 updates the Mapping Table and turn to S361 to end the judgment flow.
S3431: On the other hand, if the judgment result of step S303 is not, the paging access is data reading, the memory controller 22 sends a reading order to the flash memory chip 13.
S343: then, the flash memory chip 13 reads storage data from the appointed storage paging and sends to the memory controller 11.
S345: the memory controller 11 controls the ECC module 115 to execute error codes detection to the storage data to count the amount of the error codes.
S347: the ECC modules 115 corrects the error codes of the storage data.
S349: then the memory controller 11 judges whether the amount of the error codes of the storage data exceeds the limited value. If no, then turn to step 361 to end the judgment flow.
The method of judging the problem storage region is widely used to all devices, systems and equipments having flash memories to find out and eliminate problem storage regions as early as possible. In actual practice, it is preferred to build the of the memory controller according to the method of the present invention, for utilizing the resource of the memory controller to finish the steps. However, it is to be understood, that even though numerous characteristics and advantages of the present invention have been set forth in the foregoing description, together with details of the structure and function of the invention, the disclosure is illustrative only, and changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the invention to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
100133003 | Sep 2011 | TW | national |