A method and system for automatically detecting invalid or superseded firmware
and replacing at least a portion of the firmware stored in rewritable, nonvolatile
memory of an electronic device. Boot code of the device firmware checks whether
any portion of the device firmware is corrupt or superseded by a later version.
The boot code stores a status indication of the firmware, and communicates the
status to a host device over a bus or network. If the firmware is corrupt or superseded,
the host accesses a replacement firmware that is stored on a local or remote storage.
The replacement firmware may comprise the entire firmware or a portion of the firmware.
The host then communicates at least a portion of the replacement firmware to the
electronic device. Upon receipt, the electronic device overwrites at least a portion
of the existing firmware with the replacement firmware in the rewritable, nonvolatile memory.