System capable of upgrading firmware in background and method for upgrading firmware in background
AssigneeRealtek Semiconductor Corp.
InventorsWEN-JUAN NI, HAO ZHOU, YUE-CHENG ZHAO, RONG CHEN
Life of this patent
Estimating the term…
Abstract
A system capable of upgrading a firmware in the background and a method for upgrading a firmware in the background are provided. The method for upgrading the firmware in the background partitions the memory module of an electronic device, one user code sector is used to normally execute an initial firmware and an upgrade flow, and the other user code sector is used to store an upgrade firmware.
Claims20
A method for upgrading a firmware in background applicable to an electronic device including a processing unit and a memory module, the method comprising:
- configuring the processing unit of the electronic device to execute a boot process, wherein the memory module includes a boot sector, a first user code sector, a second user code sector, and a flag sector, the boot sector stores the boot process, each of the first user code sector and the second user code sector stores an initial firmware, and the flag sector stores a plurality of upgrade auxiliary variables, and the boot process includes:
- importing the initial firmware into the boot sector;
- determining the first user code sector and the second user code sector as a firmware operating sector and a firmware backup sector, respectively, according to an execution priority of the plurality of upgrade auxiliary variables;
- and
- selecting the initial firmware of the firmware operating sector to execute a firmware main process;
- configuring a host connected to the electronic device to execute an upgrade process associated with an upgrade firmware, wherein the firmware main process and the upgrade process are cooperated to perform an upgrade flow, which includes:
- configuring the host to obtain a firmware version of the initial firmware from the electronic device, and determining whether the firmware version is smaller than a version of the upgrade firmware;
- configuring the host to, in response to the firmware version being less than the version of the upgrade firmware, send a background firmware upgrade request to the electronic device;
- configuring the processing unit to return an upgrade request result according to an operation state of the electronic device, wherein the upgrade request result is used to indicate that the electronic device is in an idle state or a busy state;
- configuring the processing unit to, in response to the upgrade request result indicating that the electronic device is in the idle state, determine whether or not the electronic device is in a system idle state;
- configuring the processing unit to, in response to the processing unit determining that the electronic device is in the system idle state, detect the execution priority to determine how the first user code sector and the second user code sector are allocated to the firmware operating sector and the firmware backup sector, and set the firmware backup sector as a current upgrade sector;
- configuring the host to send a firmware data write request to the electronic device to configure the processing unit to perform an erasing operation on the current upgrade sector and write data of the upgrade firmware into the current upgrade sector;
- and
- configuring the processing unit to, in response to the data of the upgrade firmware being written, return an operation result indicating a successful upgrade operation;
- in response to the electronic device being restarted, configuring the processing unit to execute the boot process to determine which of the first user code sector and the second user code sector has been upgraded, and modify the execution priority accordingly;
- and
- configuring the processing unit to execute another firmware main process by selecting the upgraded initial firmware in the firmware operating sector according to the modified execution priority.
A system capable of upgrading a firmware in background, comprising:
- an electronic device, including:
- a processing unit;
- and
- a memory module, including:
- a boot sector storing a boot process;
- a first user code sector and a second user code sector, each storing an initial firmware;
- and
- a flag sector storing a plurality of upgrade auxiliary variables;
- and
- a host configured to execute an upgrade process associated with an upgrade firmware, wherein the processing unit is configured to execute the boot process, which includes:
- importing the initial firmware into the boot sector;
- determining the first user code sector and the second user code sector as a firmware operating sector and a firmware backup sector, respectively, according to an execution priority of the plurality of upgrade auxiliary variables;
- and
- selecting the initial firmware of the firmware operating sector to execute a firmware main process;
- wherein the firmware main process and the upgrade process are cooperated to perform an upgrade flow, which includes:
- configuring the host to obtain a firmware version of the initial firmware from the electronic device, and determine whether the firmware version is smaller than a version of the upgrade firmware;
- configuring the host to, in response to the firmware version being less than the version of the upgrade firmware, send a background firmware upgrade request to the electronic device;
- configuring the processing unit to return an upgrade request result according to an operation state of the electronic device, wherein the upgrade request result is used to indicate that the electronic device is in an idle state or a busy state;
- configuring the processing unit to, in response to the upgrade request result indicating that the electronic device is in the idle state, determine whether the electronic device is in a system idle state;
- configuring the processing unit to, in response to the processing unit determining that the electronic device is in the system idle state, detect the execution priority to determine how the first user code sector and the second user code sector are allocated to the firmware operating sector and the firmware backup sector, and set the firmware backup sector as a current upgrade sector;
- configuring the host to send a firmware data write request to the electronic device to configure the processing unit to perform an erasing operation on the current upgrade sector and write data of the upgrade firmware into the current upgrade sector;
- and
- configuring the processing unit to, in response to the data of the upgrade firmware being written, return an operation result indicating a successful upgrade operation;
- wherein, in response to the electronic device being restarted, the processing unit is configured to execute the boot process to determine which of the first user code sector and the second user code sector has been upgraded, and modify the execution priority accordingly;
- and
- wherein the processing unit is configured to execute another firmware main process by selecting the upgraded initial firmware in the firmware operating sector according to the modified execution priority.
Dependencies are inferred from the claim text.