A data backup method for a flash memory is provided. After writing of data to a plurality of written pages of a first block of a flash memory is completed, a last weak page of the written pages is determined. A first strong page corresponding to the last weak page is then determined. A plurality of strong pages between the first strong page and the last weak page are then determined. Data of the plurality of strong pages is the coped to a backup area of the flash memory for data recovery.
|
1. A method for securing a flash memory from data damage, comprising:
after data has been written to a plurality of pages of a first block of the flash memory, determining a last weak page of the written pages;
determining a first strong page corresponding to the last weak page;
determining a plurality of strong pages between the first strong page and the last weak page; and
copying data of the plurality of strong pages to a backup area of the flash memory for data recovery.
11. A flash memory apparatus, comprising:
a flash memory; and
a controller, after data has been written to a plurality of pages of a first block of the flash memory, determining a last weak page of the written pages, determining a first strong page corresponding to the last weak page, determining a plurality of strong pages between the first strong page and the last weak page, and copying data of the plurality of strong pages to a backup area of the flash memory for data recovery.
2. The method as claimed in
determining a last page of the plurality of written pages;
when the last page is a weak page, determining the last page to be the last weak page; and
when the last page is a strong page, determining a weak page prior to the last page to be the last weak page.
3. The method as claimed in
4. The method as claimed in
5. The method as claimed in
when errors occur in writing of the data to be written to the plurality of written pages to an error page of the first block of the flash memory, determining whether the error page is a weak page;
when the error page is a weak page, determining a second strong page corresponding to the error page;
retrieving backup data corresponding to the second strong page from the backup area of the flash memory; and
recovering data of the second strong page according to the backup data.
6. The method as claimed in
obtaining a second block from the flash memory;
writing data of pages of the first block and the backup data of the second strong page to the second block;
replacing the first block with the second block; and
clearing the first block.
7. The method as claimed in
8. The method as claimed in
9. The method as claimed in
12. The flash memory apparatus as claimed in
13. The flash memory apparatus as claimed in
14. The flash memory apparatus as claimed in
15. The flash memory apparatus as claimed in
16. The flash memory apparatus as claimed in
17. The flash memory apparatus as claimed in
18. The flash memory apparatus as claimed in
19. The flash memory apparatus as claimed in
20. The flash memory apparatus as claimed in
|
This application claims the benefit of U.S. Provisional Application No. 61/077,549, filed Jul. 2, 2008.
This Application claims priority of Taiwan Patent Application No. TW97141754, filed on Oct. 30, 2008, the entirety of which is incorporated by reference herein.
1. Field of the Invention
The invention relates to flash memories, and more particularly to strong pages and weak pages of flash memories.
2. Description of the Related Art
Many electronic devices store data with flash memories, such as digital cameras and cell phones. A NAND flash memory comprises a plurality of blocks. Each of the blocks comprises a plurality of pages. Pages are divided into strong pages and weak pages. When data is written to a strong page, the strong page requires a shorter programming period to complete data writing. When data is written to a weak page, the weak page requires a longer programming period to complete data writing.
Referring to
When data is written to a weak page, data stored in a strong page corresponding to the weak page is affected. When data is written to a strong page, data stored in a weak page corresponding to the strong page is also affected. Because a strong page has a shorter programming period, when errors occur in programming of the strong page, a weak page corresponding to the strong page has little probability to suffer from data damage. On the contrary, because a weak page has a longer programming period, when errors occur in programming of the weak page, a strong page corresponding to the weak page will probably suffer from data damage due to data errors of the weak page. A method for securing pages of a flash memory from data damage is therefore required.
A method for securing a flash memory from data damage is provided. After writing of data to a plurality of written pages of a first block of a flash memory is completed, a last weak page of the written pages is determined. A first strong page corresponding to the last weak page is then determined. A plurality of strong pages between the first strong page and the last weak page are then determined. Data of the plurality of strong pages is the coped to a backup area of the flash memory for data recovery.
The invention also provides a flash memory apparatus. In one embodiment, the flask memory apparatus comprises a flash memory and a controller. After data is written to a plurality of written pages of a first block of the flash memory, the controller determines a last weak page of the written pages, determines a first strong page corresponding to the last weak page, determines a plurality of strong pages between the first strong page and the last weak page, and copies data of the plurality of strong pages to a backup area of the flash memory for data recovery.
A detailed description is given in the following embodiments with reference to the accompanying drawings.
The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
Referring to
Referring to
Referring to
Assume that the controller 206 further writes data to pages 510 of the block 400 of the flash memory 208 (steps 318, 302), as shown by the index 510 of
Referring to
First, the controller 206 determines whether the error page 13 is a weak page (step 608). If the error page is a strong page, data stored in a weak page corresponding to the error page has a low probability that it may be damaged, and no data recovery is required. Because the error page 13 is a weak page, the controller 206 determines a second strong page 7 corresponding to the error page 13 (step 610). The controller 206 then retrieves data corresponding to the second strong page 7 from the backup area 450 shown in
In one embodiment, the controller 206 first obtains a spare block from the flash memory 208 as the second block. The controller 206 then writes the backup data of the second strong page 7 and data of other pages of the first block 400 to the second block (step 614). The controller 206 then replaces the first block with the second block. In one embodiment, the controller 206 links the logical address previously corresponding to the first block 400 to the physical address of the second block. Finally, the controller 206 clears data of the first block to return the first block to a spare block.
A controller according to the invention, backs up data of string pages of a flash memory to a backup area whenever the controller completes data writing. When data of the strong pages is damaged due to data errors of weak pages corresponding to the strong pages, the controller retrieves backup data from the backup area to recover the damaged data of the strong pages.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
7275140, | May 12 2005 | Western Digital Israel Ltd | Flash memory management method that is resistant to data corruption by power loss |
20070086244, | |||
JP2008033801, | |||
JP2008146253, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Feb 03 2009 | HSIAO, WEI-YI | SILICON MOTION, INC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 022364 | /0021 | |
Mar 09 2009 | Silicon Motion, Inc. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Jan 05 2015 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Jan 02 2019 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
May 24 2023 | M1553: Payment of Maintenance Fee, 12th Year, Large Entity. |
Date | Maintenance Schedule |
Dec 06 2014 | 4 years fee payment window open |
Jun 06 2015 | 6 months grace period start (w surcharge) |
Dec 06 2015 | patent expiry (for year 4) |
Dec 06 2017 | 2 years to revive unintentionally abandoned end. (for year 4) |
Dec 06 2018 | 8 years fee payment window open |
Jun 06 2019 | 6 months grace period start (w surcharge) |
Dec 06 2019 | patent expiry (for year 8) |
Dec 06 2021 | 2 years to revive unintentionally abandoned end. (for year 8) |
Dec 06 2022 | 12 years fee payment window open |
Jun 06 2023 | 6 months grace period start (w surcharge) |
Dec 06 2023 | patent expiry (for year 12) |
Dec 06 2025 | 2 years to revive unintentionally abandoned end. (for year 12) |