The invention belongs to the technical field of program updating, and particularly relates to a method for flashing Bootloader
software, which comprises the following steps of: judging the validity of an application program by an operation starting manager, judging the validity of a
programming mark if the application program is valid, and skipping to the operation of the application program if the
programming mark is invalid; flashing the
software of the second version of the boot
loader and the effective copy mark into the flash area, and resetting the micro-
control unit; the application program judges whether the copy effective mark is effective or not, if yes, the
software of the second-version boot
loader is copied to the position where the software of the first-version boot
loader is located, after
copying is completed, the copy effective mark is removed, and the software of the second-version boot loader is copied. And starting a
memory protection unit preset by the micro-
control unit to perform write access protection of all memories except for using the
EEPROM, and enabling the application program to wait for other tasks. According to the method, the problem that the
brick is damaged due to power failure when the power failure occurs in the process of flashing the Bootloader by running the APP is solved.