The firmware may contain multiple application modules, which can operate
independent of each other such that upgrade of one application module
does not affect the operation of the other. A compressed backup copy of a
module is stored in a non-volatile memory before upgrading the module
from a previous version to a newer version. If the upgrading operation
fails, the backup copy is used to restore the previous version. To
simplify the upgrading or restoring operations, each application module
may be assigned to a pre-specified area of a non-volatile memory forming
a firmware. As a result, upgrading or restoring may merely require
replacing of a version in the firmware. Compression of the backup copy
may be optional with status data indicating whether the backup copy is
compressed.