Patent ID: 8661301

Claim:
A method having steps for dodging bad page and bad block caused by suddenly power off, wherein the type of the flash memory is single-level cell, the steps comprising: step S11: searching a last programming page before a latest power-off and then allocating at least one free page for test after power on; step S12: writing an original data to the free page for test if the original data is provided, or writing at least one specific pattern to the free page for test if the original data is not provided; step S13: marking the free page for test as a used page; step S14: reading back the used page and checking if there is an ECC error in the data of the used page; step S15: if there is no ECC error in the data of the used page, the data written to the used page is to change an address stored in a mapping table and the address is directing to a present page, or the specific pattern written to the used page is to skip the present page and start from next page to be used; step S16: if there is any ECC error in the data of the used page, the used page is failed, and the original data and the address stored in the mapping table are kept and then next writing data starts from next page.