The present invention relates to the field of
system architecture design, and particularly to a
firmware upgrade method and
system for a Bootloader architecture. The method includes the following steps: S1. Start the
embedded system, initialize the
serial port, run boot, read and print the status of bootsel. If bootsel = 2 is recognized, enter the
firmware upgrade mode and execute step S2; if bootsel = 0 is recognized, enter the default startup mode and execute step S3; S2. Initialize functions such as spi and uart, establish a connection with the on-
chip flash through the spi communication protocol, perform erase, read, and write operations on the flash, write the
firmware into the flash from the
serial port through the
serial port interrupt function, and complete the firmware update by restarting and switching to the main mode; S3. Add ddr initialization to the original firmware program, write the firmware
upgrade program into ddr through jlink, run the program in ddr, and update the original firmware in the flash through the serial port interrupt to complete the firmware upgrade of the bootloader. The present invention has strong
scalability and obvious advantages in
software update and function expansion.