| CPC G06F 8/654 (2018.02) [G06F 9/4401 (2013.01)] | 12 Claims |

|
1. A method of updating firmware by a flash bootloader, the method comprising:
storing current version information included in a trailer block of the firmware stored in a flash memory, wherein the firmware stored in the flash memory includes the trailer block and a header block;
erasing a first sector in which the header block is located while maintaining a second sector in which the trailer block is located in the flash memory;
writing a new header block of a new firmware to be downloaded in the first sector of the flash memory;
determining, by comparing current version information of the new firmware included in the new header block and the stored current version information, whether the firmware is to be downgraded; and
in response to determining that the firmware is not to be downgraded,
erasing the second sector in which the trailer block is located from the flash memory, and
writing a new trailer block of the new firmware in the second sector of the flash memory.
|