This patent application is based on Taiwan, R.O.C. patent application No. 097106731 filed Feb. 27, 2008.
The present invention relates to firmware of an electronic device, and more particularly, to an apparatus and a method for firmware update in an electronic device.
Firmware containing code to be executed for operations of many electronic devices is generally stored in a specific storage device in an electronic device. Latest-version code for firmware update are provided by manufacturers to solve operation complications of the electronic device, to modify hardware settings of the electronic device, or even to offer new functions.
During firmware update in a common electronic device, a newer version code of the firmware is written into the specific storage device to replace an older version code. However, in the event a back copy of the older version code of the firmware is not maintained and the newer version code has improper contents, e.g., errors resulting from the writing in process, operation difficulties or even malfunctions may result, causing user inconvenience.
Therefore, an objective of the present invention is to provide an apparatus and a method for firmware update offering reliable firmware update for electronic devices, thereby improving user convenience. An embodiment of the invention provides an apparatus for firmware update for use in an electronic device. The apparatus comprises: a first storage unit for storing a first firmware code of the electronic device; a second storage unit for storing a second firmware code of the electronic device; a checking unit, coupled to the second storage unit, for checking whether the second firmware code is valid; and a controller, for initiating the checking unit and determining whether to execute the second firmware code upon validity of the second firmware code.
An embodiment of the invention further provides a method for firmware update for use in an electronic device, in which a first firmware code of the electronic device is stored in a first storage unit of the electronic device and a second firmware code of the electronic device is stored in a second storage unit. The method comprises steps of: executing the first firmware code, upon start of the electronic device, to initiate a validity check on the second firmware code; executing the validity check to determine whether the second firmware code in the second storage device is valid; and determining whether to execute the second firmware code in the second storage device according to an outcome of the validity check.
The present invention will become more readily apparent to those ordinarily skilled in the art after reviewing the following detailed description and accompanying drawings, in which:
In the preferred embodiment shown in
An operation procedure of the firmware update device 10 shall be described below. Upon start or restart of the electronic device 1, the controller 14 first executes the existing firmware code in the first storage unit 11. A beginning portion of the existing firmware code commands the controller 14 to initiate the checking unit 13 to check whether the second storage unit 12 is loaded with a valid updated firmware code. The checking unit 13 then checks and responds to the controller 14 with an outcome of the checking. When the outcome indicates that the second storage unit 12 is not loaded with a valid updated firmware code, the controller 14 continues to execute the existing firmware code and ignores the second storage unit 12. When the outcome indicates that the second storage unit 12 is loaded with a valid updated firmware code, the controller 14 starts to execute the updated firmware code to control operations of the electronic device 1 instead of executing the existing firmware code.
To be more precise, each time the electronic device 1 starts or restarts, the controller 14 first executes a portion of the existing firmware code, such as a beginning portion, so as to initiate checking the updated firmware code in the second storage unit 12. When the second storage unit 12 is loaded with a valid updated firmware code, the controller 14 starts to execute the updated firmware code instead of the existing firmware code. When the second storage unit 12 is not loaded with a valid updated firmware code, the controller 14 continues to execute the existing firmware code. It is to be noted that the existing firmware code is a reliable version that ensures normal operations of the electronic device 1. Therefore, by implementing the foregoing operation procedure of the firmware update device 10, availability of a valid updated firmware code is checked while a reliable existing firmware code may still be used when a valid updated firmware code is found unavailable due to a failure in updating the firmware, so as to maintain normal operations of the electronic device 1. Compared with the prior art, the firmware update device 10 provides a more dependable firmware update method.
In Step 23, the validity check is performed using a CRC or a checksum calculation to determine whether the second firmware code is valid. In one embodiment, Step 22 executes a portion of the first firmware code to initiate the validity check on the second firmware code in the second storage unit.
While the invention has been described in terms of what is presently considered to be the most practical and preferred embodiments, it is to be understood that the invention needs not to be limited to the above embodiments. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures.
Number | Date | Country | Kind |
---|---|---|---|
097106731 | Feb 2008 | TW | national |