Method for updating data in flash memory

Information

  • Patent Application
  • 20070233940
  • Publication Number
    20070233940
  • Date Filed
    March 23, 2007
    17 years ago
  • Date Published
    October 04, 2007
    17 years ago
Abstract
A method for updating data in a flash memory previously reserves a rewritable memory area for specific data, searches an address of latest modified data of data to be modified in the flash memory and modifies a backup of latest modified correct data. The method does not update the data when the modified data and the latest modified correct data are the same. When the modified data and the latest modified correct data are not the same, a whole sector where the specific data is located is updated if no unfilled area of the rewritable memory area exists, and the modified data is written into the previously reserved memory area after the address of the latest modified data to complete updating the data if the unfilled area of the rewritable memory area exists.
Description

BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 (Prior Art) is a flow chart showing a conventional method for updating data in a flash memory.



FIGS. 2(
a) to 2(d) are schematic illustrations showing procedures in a method for updating data in a flash memory according to the invention.



FIG. 3 is a flow chart showing a method of updating data in a flash memory according to a first embodiment of the invention.



FIG. 4 is a flow chart showing a method of updating data in a flash memory according to a second embodiment of the invention.


Claims
  • 1. A method for updating data in a flash memory, comprising the steps of: (1) searching an address of latest modified data of to-be-modified data in the flash memory;(2) modifying a backup of latest modified correct data;(3) checking whether the modified data of a backup and the latest modified correct data are different, wherein the data is not updated if the modified data of a backup and the latest modified correct data are the same, and step (4) is performed when the modified data of a backup and the latest modified correct data are different from each other; and(4) writing the modified data of a backup into a previously reserved memory area after the address of the latest modified correct data.
  • 2. The method according to claim 1, wherein the step (1) finds the address of the latest modified data from plural sets of data.
  • 3. The method according to claim 1, wherein the step (2) generates updated parameter data by updating data values and a summated check code.
  • 4. The method according to claim 3, wherein the step (2) checks whether the data is correct according to the check code, modifies the latest modified data if the data is correct, and takes previous data as an operating value when the data is incorrect.
  • 5. The method according to claim 1, wherein the original latest modified data is reserved as an operating value when the step (3) does not update the data.
  • 6. The method according to claim 1, wherein an initial state of the previously reserved memory area in the step (4) is a format rewritable state.
  • 7. The method according to claim 6, wherein a rewritable format of the memory area is a 0xFF format.
  • 8. The method according to claim 6, wherein first data includes an outgoing value and a check code in the initial state of the memory area.
  • 9. The method according to claim 1, further comprising, after the step (4), the steps of: (5) checking whether the modified data has been completely written into the memory area, and ending an updating procedure if the modified data has been completely written into the memory area or otherwise performing step (6);(6) selecting whether to retry, and going back to the step (1) to execute the step of updating the data repeatedly when selecting to retry or otherwise ending the updating procedure.
  • 10. The method according to claim 9, wherein when the data is not completely written and it is selected not to retry in the step (6), the incorrect data is reserved in the memory area, and then the updating procedure ends.
  • 11. The method according to claim 1, wherein steps (3) comprises, when two sets of data are different from each other, the step of: (3-1) checking whether the unfilled area of the previously reserved memory area of the data exists, and performing step (4) if the previously reserved memory area exists or otherwise updating a whole sector where the data is located.
  • 12. The method according to claim 11, wherein the step (3-1) updates the whole sector by way of read-erase-modify-write.
  • 13. The method according to claim 11, wherein when the step (3-1) is updating the whole sector, the latest modified correct data is written and reserved, other parameter data are deleted, and a rewritable memory area is again reserved.
  • 14. The method according to claim 1, wherein the data is a system parameter of an electronic device stored in the flash memory.
  • 15. The method according to claim 14, wherein the system parameter is a region code of an optical drive.
Priority Claims (1)
Number Date Country Kind
95112067 Apr 2006 TW national