text: 1. Field of the Invention
  The present invention relates to a rewritable, nonvolatile memory, such as a flash memory, that stores an executable program which allows an electronic device to perform a process, and a rewrite program used to rewrite the executable program, an electronic device, a method of rewriting the rewritable, nonvolatile memory, and a storage medium having stored thereon a rewrite program.
  2. Description of the Background Art
  An electronic device, such as a personal computer (PC), an image forming apparatus which forms an image based on digital image data, or any other household electrical appliance, has an processing unit that executes a program, and ROM that stores the program to be executed by the processing unit. For ROM included in the electronic device, a flash memory which is a rewritable, nonvolatile memory is widely used. The electronic device performs a process by reading a program stored in a flash memory and executing the program at the processing unit.
  To correct malfunctions, improve functions, or the like, the need may arise for an electronic device including a flash memory to rewrite the storage contents of the flash memory. The configurations of an electronic device that allow for rewriting of a flash memory include one in which a means of rewriting the storage contents of the flash memory is provided to a portion other than the flash memory, and one in which the flash memory has stored therein a rewrite program for itself. Japanese Patent Application Laid-Open No. 11-338690 discloses a flash memory having a first region where a program is stored, and a second region, which is different from the first region, where a program used to rewrite the program stored in the flash memory is stored.
  When the electronic device employs the configuration in which a means of rewriting the storage contents of the flash memory is provided to a portion other than the flash memory, the configuration of the electronic device becomes complicated, causing an increase in costs. On the other hand, when the electronic device employs the configuration in which the flash memory has stored therein a rewrite program for itself, if an error occurs, where the electronic device is stopped while the storage contents of the flash memory are being rewritten, there is a possibility that the electronic device may become unable to start up due to the program stored in the flash memory being incomplete.
  In the flash memory disclosed in Japanese Patent Application Laid-Open No. 11-338690, since the second region is accessed first upon boot-up by the electronic device and has stored therein a boot program used by the electronic device to perform a boot, the electronic device is always able to start up. However, in a flash memory having a program to be rewritten which is stored in a region including a portion accessed first upon boot-up by the electronic device, there is a possibility that the electronic device may become unable to start up after rewriting is done.