Skip to content

Dual firmware boot mode*

1. overview*

Dual firmware boot, which we call MultiBoot

MultiBoot When a flash stores two firmware, the flash starts from the first firmware by default. When the flash starts from a power failure, the first firmware is started by default.

After startup, you can call the interface:

void SwitchAnotherFirmeware(void)

The second firmware will be launched with a Watch Dog reboot.

The image distribution after the two firmware versions are combined is as follows:

flashaddr    0                second
                              bin off
        #  * ---------------------------------
        #  * |            |   |              |
        #  * |    bin1    |   |     bin2     |
        #  * |            |   |              |
        #  * ---------------------------------

Generally, we need to switch between official firmware and factory firmware, or we need to support dual models, we can use this function.

2. Use procedure*

Below the SDK on https://gitlab.com/nationalchip/lvp_tws, for example, to introduce use.

  • Download the 8002 SDK and have a 8002 GRUS_DEV_V1.X development board
  • cp configs/release/grus_gx8002b_dev_1v.config .config
  • Name the.config first.config and second.config, respectively, in the same directory as the original.config
  • A make multiboot compilation produces the final two pieces of firmware in one, located at output/mcu_nor.bin
  • Refer to the SDK application development materials to implement a trigger point, such as keystroke or voice wake up, at which the call is made SwitchAnotherFirmeware()
  • By printing UART1 on the development board, you can see that the system restarts and switches to the second firmware (you can judge which firmware is running by printing the first time when the system starts printing).

first.config is the configuration of the first firmware, and second.config is the configuration of the second firmware.