METHOD AND CONTROLLER FOR MANAGING MEMORY DEVICE
A method for managing a memory device includes: sending a last writing command to a specific non-volatile (NV) memory element in the memory device to write a set of data to a specific block of the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element, where these writing commands are utilized for writing to the same location at different times, respectively, in order to guarantee data correctness; and after writing the set of data to the specific block, sending a read command to the specific NV memory element to read stored data of the set of data from the specific block, and checking whether the stored data match the set of data to determine whether the specific block is a bad block.
1. Field of the Invention
The present invention relates to controlling a flash memory, and more particularly, to a method and controller for managing a memory device.
2. Description of the Prior Art
Developments in flash memories have led to wide application in portable memory devices, such as memory cards conforming to the SD/MMC, CF, MS and XD specifications. How to control flash memories in these portable memory devices has become an important issue.
NAND flash memories include single level cell (SLC) memories and multiple level cell (MLC) memories. Each transistor in an SLC flash memory (which can be viewed as a memory cell) only has two electric charge levels representing logic 0 and logic 1, respectively. The transistors in an MLC flash memory are driven by a higher voltage to record information of multiple bits (e.g. 00, 01, 11, 10) using voltages of different levels. Theoretically, the recording density of the MLC flash memory can be more than twice the recording density of the SLC flash memory. This is good news for the manufacturers of NAND flash memories when considering issues in design and research.
Since the manufacturing cost of MLC flash memories is cheaper than that of SLC flash memories, and as the MLC flash memories may provide a larger capacity in a limited space, applying MLC flash memories to portable memory devices has become more and more popular. The operation of some types of MLC flash memories can be complicated, and introduces various issues. For example, the initialization time of a conventional memory device adopting an MLC flash memory will be greatly increased, making the related cost increase correspondingly. Hence, there is a need for a novel method to enhance the control of memory devices which can improve their initialization efficiency without introducing negative side effects.
SUMMARY OF THE INVENTIONAn objective of the present invention is to provide a method for managing a memory device, and an associated memory device and controller, which can solve the above issue.
Another objective of the present invention is to provide a method for managing a memory device and an associated memory device and controller that can improve the operation efficiency of the memory device, and thereby save related costs.
At least one preferred embodiment of the present invention provides a method for managing a memory device. The memory device comprises at least one non-volatile (NV) memory element, wherein each NV memory element comprises a plurality of blocks. The method comprises: sending a last writing command to a specific NV memory element within the NV memory element, to write a set of data to a specific block of the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element. The first writing command, the second writing command and the last writing command are used to write a same data into a same location in the NV memory element at different times, respectively, to ensure that the same data is stored correctly. The method further comprises: after the set of data is written to the specific block, sending a read command to the specific NV memory element to read stored data of the set of data from the specific block, and checking whether the stored data matches the set of data to determine whether the specific block is a bad block.
In addition to the above method, the present invention also provides a memory device. The memory device comprises at least one NV memory element, each comprising a plurality of blocks; and a controller, arranged to control the NV memory element. The controller comprises a processing unit for managing the memory device according to a program code embedded in the processing unit or a program code received from outside the processing unit, wherein the controller sends a last writing command to a specific NV memory element within the NV memory element to write a set of data to a specific block in the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element. The first writing command, the second writing command, and the last writing command are used to write a same data into a same location in the NV memory element at different times, respectively, to ensure that the same data is stored correctly. After the set of data is written to the specific block, the controller sends a read command to the specific NV memory element to read stored data of the set of data from the specific block, and checks whether the stored data matches the set of data to determine whether the specific block is a bad block.
In addition to the above method, the present invention also provides a controller of a memory device. The memory device comprises at least one NV memory element, each comprising a plurality of blocks. The controller comprises a processing unit, arranged to manage the memory device according to a program code embedded in the processing unit or received from outside the processing unit. The controller sends a last writing command to a specific NV memory element within the NV memory element to write a set of data to a specific block in the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element, wherein the first writing command, the second writing command, and the last writing command are arranged to write a same data to a same location in the NV memory element at different times, to ensure that the same data is correctly stored. After the set of data is written to the specific block, the controller sends a reading command to the specific NV memory element to read stored data of the set of data from the specific block, and checks whether the stored data matches the set of data to determine whether the specific block is a bad block.
An advantage provided by the present invention is that, compared with related arts, the method, memory device and controller of the present invention may greatly save the initialization time of the memory device before it leaves the factory, wherein the aforementioned initialization is usually performed at the end of the manufacturing process. Compared with related arts, the present invention may provide a better efficiency, and may save related costs, such as time and human resources.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
The processing unit 110 may refer to a program code (not shown in the figure) embedded in the processing unit 110 or received from outside the processing unit 110, to manage the memory device 100. The program code may be a hardware code embedded in the processing unit 110, and more particularly, a read-only memory code (ROM code). In another example, the program code may be a firmware code received from outside the processing unit 110. The processing unit 110 is arranged to control the volatile memory 120, the transmission interface 130, the NV memory elements 140_0, 140_1, . . . , 140_N, and the bus 150. In this embodiment, the processing unit 110 may be an Advanced Reduced Instruction Set Computer Machine (Advanced RISC Machine, ARM) processor or an Argonaut RISC Core (ARC) processor. This is merely for illustrative purposes, and not meant to be a limitation of the present invention. According to various modifications of this embodiment, the processing unit 110 may be another type of processor. According to some modifications of this embodiment, the processing unit 110 may receive specific commands from an external electronic device (e.g. a PC) other than the memory device 100, and refer to the specific commands to perform initialization of the memory device 100 before it leaves the factory. In general, the aforementioned initialization is performed immediately after the memory device 100 is manufactured. In this situation, the program executed in the external electronic device associated with a corresponding initialization may be viewed as an example of the aforementioned program code received from outside the processing unit 110.
The volatile memory 120 may be used to store a Global Page Address Linking Table, the data accessed by the host, and information required for accessing the memory device 100. The volatile memory 120 in this embodiment may be a dynamic random access memory (DRAM) or a static random access memory (SRAM). According to various modifications of this embodiment, the volatile memory 120 may be another type of volatile memory. For example, the volatile memory 120 may comprise an SRAM.
According to this embodiment, the transmission interface 130 shown in
The NV memory elements 140_0, 140_1, . . . , 140_N are arranged to store data, wherein the NV memory elements 140_0, 140_1, . . . , 140_N may be (but are not limited to) NAND flash chips. The bus 150 is arranged to couple and provide communicates between the processing unit 110, the volatile memory 120, transmission interface 130, and the NV memory elements 140_0, 140_1, . . . , 140_N. In this embodiment, in the structure shown in
In this embodiment, each NV memory element within the NV memory elements 140_0, 140_1, . . . , 140_N shown in
In step 210, the controller sends a last writing command to a specific NV memory element (e.g. the NV memory element 140_n) within the NV memory element, to write a set of data to a specific block in the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element, wherein the first writing command, the second writing command, and the last writing command are used to write the same data into the same location of the NV memory element at different times to ensure that the same data is correctly stored. The set of data may comprise data having a predetermined pattern.
In step 220, after the set of data is written to the specific block, the controller sends a reading command to the specific NV memory element in order to read the stored data of the set of data from the specific block (e.g. the storage result of the set of data), and check whether the stored data matches the set of data, to determine whether the specific block is a bad block. When the stored data does not match the set of data, the controller determines the specific block as a bad block, and may record the information that the specific block is a bad block. In another example, when the stored data matches the set of data, the controller determines the specific block as a good block, and may record the information that the specific block is a good block.
In step 230, the controller checks whether the flow should be stopped or not. When it is determined that the flow should be stopped (e.g. all the blocks to be checked are checked), the flow is ended as shown in
According to this embodiment, under the situation where a memory cell of a block of any NV memory element within the at least one NV memory element is used to store a plurality of bits, the plurality of bits may need to be repeatedly written into the memory cell for a predetermined number of times being more than 1. This is in order to make the memory cell be correctly programmed in the specific NV memory, so that each bit of the plurality of bits is correctly stored in the memory cell for follow-up readings. More particularly, the first writing command is arranged to instruct an inner control circuit of the aforementioned any NV memory element to write the plurality of bits into the memory cell for the first time, the second writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a second time, and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for the last time. For example, when the predetermined times equals three, the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for the third time.
Note that, in this embodiment, when writing the same data, the busy duration of operations of the inner control circuit in response to the first writing command is less than the busy duration of operations of the inner control circuit in response to second writing command. Further, when writing the same data, the busy duration of operations of the inner control circuit in response to the second writing command is less than the busy duration of operations of the inner control circuit in response to the last writing command, wherein the aforementioned busy duration may be determined by detecting a busy signal outputted by the specific NV memory element (e.g. the NV memory element 140_n). More particularly, in a situation where the storage capacity of a memory cell (such as the aforementioned memory cell) in the specific block is larger than 1 bit, the controller may utilize the last writing command to control a state of the memory cell corresponding to a portion of a plurality of programmable states, rather than controlling any of the plurality of programmable states. The plurality of programmable state may comprise eight programmable states corresponding to three bits, and the number of the portion of programmable states is smaller than eight, wherein the total of the eight programmable states corresponds to 23 (i.e. 8).
As mentioned above, the method shown in
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Claims
1. A method for managing a memory device, the memory device comprising at least one non-volatile (NV) memory element, each NV memory element comprising a plurality of blocks, the method comprising:
- sending a last writing command to a specific NV memory element within the NV memory element, to write a set of data to a specific block of the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element, wherein the first writing command, the second writing command and the last writing command are used to write a same data into a same location in the NV memory element at different times, respectively, to ensure that the same data is stored correctly; and
- after the set of data is written to the specific block, sending a read command to the specific NV memory element to read stored data of the set of data from the specific block, and checking whether the stored data matches the set of data to determine whether the specific block is a bad block.
2. The method of claim 1, wherein under a situation where a memory cell of a block of any NV memory element within the at least one NV memory is arranged to store a plurality of bits, the plurality of bits are repeatedly written to the memory cell for a predetermined number of times, to make the memory cell be correctly programmed in the specific NV memory, so that each bit of the plurality of bits is correctly stored in the memory cell for follow-up readings; and the predetermined number of times is larger than 1.
3. The method of claim 2, wherein the first writing command is arranged to instruct an inner control circuit in said any NV memory element within the at least one NV memory to write the plurality of bits into the memory cell for a first time, the second writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a second time, and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a last time.
4. The method of claim 3, wherein the predetermined number of times is equal to 3; and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a third time.
5. The method of claim 3, wherein regarding writing the same data, a busy duration of operations of the inner control circuit in response to the first writing command is less than a busy duration of operations of the inner control circuit in response to the second writing command, and the busy duration of operations of the inner control circuit in response to the second writing command is less than a busy duration of operations of the inner control circuit in response to the last writing command.
6. The method of claim 1, wherein the storage capacity of a memory cell in the specific block is larger than 1 bit.
7. The method of claim 6, further comprising:
- utilizing the last writing command to control the memory cell to be in a state of a portion of a plurality of programmable states only, rather than any of the plurality of programmable states.
8. The method of claim 1, wherein the step of checking whether the stored data matches the set of data to determine whether the specific block is a bad block comprises:
- when the stored data does not match the set of data, determining the specific block as a bad block.
9. A memory device, comprising:
- at least one non-volatile (NV) memory element, each comprising a plurality of blocks; and
- a controller, arranged to control the NV memory element, the controller comprising a processing unit for managing the memory device according to a program code embedded in the processing unit or a program code received from outside the processing unit, wherein the controller sends a last writing command to a specific NV memory element within the NV memory element to write a set of data to a specific block in the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element, wherein the first writing command, the second writing command, and the last writing command are used to write a same data into a same location in the NV memory element at different times, respectively, to ensure that the same data is stored correctly;
- wherein after the set of data is written to the specific block, the controller sends a read command to the specific NV memory element to read stored data of the set of data from the specific block, and checks whether the stored data matches the set of data to determine whether the specific block is a bad block.
10. The memory device of claim 9, wherein under the situation where a memory cell of a block of any NV memory element within the at least one NV memory is arranged to store a plurality of bits, the plurality of bits are repeatedly written to the memory cell for a predetermined number of times, to make the memory cell be correctly programmed in the specific NV memory, so that each bit of the plurality of bits is correctly stored in the memory cell for follow-up readings; and the predetermined number of times is larger than 1.
11. The memory device of claim 10, wherein the first writing command is arranged to instruct an inner control circuit in said any NV memory element within the at least one NV memory to write the plurality of bits into the memory cell for a first time, the second writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a second time, and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a last time.
12. The memory device of claim 11, wherein the predetermined number of times is equal to 3; and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a third time.
13. The memory device of claim 11, wherein when writing the same data, a busy duration of operations of the inner control circuit in response to the first writing command is less than a busy duration of operations of the inner control circuit in response to the second writing command, and the busy duration of operations of the inner control circuit in response to the second writing command is less than a busy duration of operations of the inner control circuit in response to the last writing command.
14. The memory device of claim 9, wherein the storage capacity of a memory cell in the specific block is larger than 1 bit.
15. The memory device of claim 14, wherein the controller utilizes the last writing command to control the memory cell to be in a state of a portion of a plurality of programmable states only, rather than any of the plurality of programmable states.
16. A controller of a memory device, the memory device comprising at least one non-volatile (NV) memory element, each comprising wherein after the set of data is written to the specific block, the controller sends a reading command to the specific NV memory element to read stored data of the set of data from the specific block, and checks whether the stored data matches the set of data to determine whether the specific block is a bad block.
- a plurality of blocks, the controller comprising:
- a processing unit, arranged to manage the memory device according to a program code embedded in the processing unit or received from outside the processing unit, wherein the controller sends a last writing command to a specific NV memory element within the NV memory element to write a set of data to a specific block in the specific NV memory element, rather than sending either a first writing command or a second writing command to the specific NV memory element, wherein the first writing command, the second writing command, and the last writing command is arranged to write a same data to a same location in the NV memory element at different times, to ensure that the same data is correctly stored;
17. The controller of claim 16, wherein under a situation where a memory cell of a block of any NV memory element within the at least one NV memory is arranged to store a plurality of bits, the plurality of bits are repeatedly written to the memory cell for a predetermined number of times, to make the memory cell be correctly programmed in the specific NV memory, so that each bit of the plurality of bits is correctly stored in the memory cell for follow-up readings; and the predetermined number of times is larger than 1.
18. The controller of claim 17, wherein the first writing command is arranged to instruct an inner control circuit in said any NV memory element within the at least one NV memory to write the plurality of bits into the memory cell for a first time, the second writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a second time, and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a last time.
19. The controller of claim 18, wherein the predetermined number of times is equal to 3; and the last writing command is arranged to instruct the inner control circuit to write the plurality of bits into the memory cell for a third time.
20. The controller of claim 18, wherein when writing the same data, a busy duration of operations of the inner control circuit in response to the first writing command is less than a busy duration of operations of the inner control circuit in response to the second writing command, and the busy duration of operations of the inner control circuit in response to the second writing command is less than a busy duration of operations of the inner control circuit in response to the last writing command.
21. The controller of claim 16, wherein the storage capacity of a memory cell in the specific block is larger than 1 bit.
22. The controller of claim 21, wherein the controller utilizes the last writing command to control the memory cell to be in a state of a portion of a plurality of programmable states only, rather than any of the plurality of programmable states.
Type: Application
Filed: May 25, 2016
Publication Date: Mar 2, 2017
Inventor: Tsung-Chieh Yang (Hsinchu City)
Application Number: 15/163,686