1. What is bootlloader?
In an embedded operating system, BootLoader runs before the operating system kernel runs. It can initialize hardware devices and establish memory space mapping, thereby bringing the system's software and hardware environment to a suitable state, so as to prepare the correct environment for the final call to the operating system kernel. Therefore, the loading and startup tasks of the entire system are completely completed by BootLoader.
The above is the description of bootloader on Baidu Encyclopedia, but the bootloader we are talking about here is a boot program written to realize the IAP function of the microcontroller, so that the program data of our APP can be written into the Flash program space through serial port and other communication methods to finally achieve the purpose of self-programming and program update. This is what we are talking about here. Bootloader.
2. Program architecture
A complete application system program with bootloader is divided into two parts: 1. APP program: application system function implementation layer (in layman's terms, it is the program we want to write ourselves); 2. Bootloader boot program: it is the entry program when the system starts or resets. The main functions include clock initialization, Uart communication initialization, and judgment of whether to execute the boot serial port upgrade program or jump to execute the APP program. The program architecture of Bootloader is shown in the figure below:
|