First, three BOOT mode introduction
The so-called startup, generally means that after we have a good program, when the chip is restarted, the fourth rising edge of SYSCLK, the value of the BOOT pin will be latched. The user can select the startup mode after reset by setting the state of the BOOT1 and BOOT0 pins.
Main Flash memory
It is the built-in Flash of STM32. Generally, when we use JTAG or SWD mode to download the program, it is downloaded to this. After restarting, it also starts the program directly from this.
System memory
Boot from system memory, the program function initiated by this mode is set by the manufacturer. In general, this type of startup is used less. The system memory is a specific area inside the chip. When the STM32 is shipped from the factory, the ST has a BootLoader preset in this area. This is the ISP program we often say. This is a ROM that cannot be modified after leaving the factory. Generally speaking, when we use this startup mode, we download the program from the serial port. Because the BootLoader provided by the manufacturer provides the firmware of the serial download program, the program can be downloaded to the system Flash through the BootLoader. But this download method requires the following steps:
Step1: Set BOOT0 to 1, BOOT1 to 0, and then press the reset button to start BootLoader from system memory.
Step2: Finally, with the help of BootLoader, download the program to Flash through the serial port.
Step3: After the program download is completed, it is necessary to set BOOT0 to GND and reset manually. In this way, STM32 can be booted from Flash. You can see that using the serial port to download the program is quite troublesome. You need to jump over the cap and jump. Very not paying attention to the user experience.
Embedded Memory
Built-in SRAM, since it is SRAM, naturally there is no program storage capability. This mode is generally used for program debugging. If I only modified a small place in the code, then I need to erase the entire Flash again. The time-consuming comparison can be considered to start the code from this mode (that is, the memory of STM32) for fast program debugging, etc. After the program debugging is completed, the program is downloaded to the SRAM.
Second, the development of BOOT mode selection
1, usually use the program code stored in the main flash memory, configuration mode: BOOT0 = 0, BOOT1 = X;
2, Flash lock solution:
During the development and debugging process, the internal flash is locked for some reason, the SWD and Jtag debugging cannot be connected, and the device cannot be read. The code can be rewritten by modifying the BOOT mode.
Modified to BOOT0=1, BOOT1=0 can be booted from the system memory, ST comes with the Bootloader program, SWD and JTAG debug interface are dedicated. After re-programming, you can change the BOOT mode to BOOT0=0, BOOT1=X to use normally.
LCD Tonch Screen For Iphone 13
Lcd Tonch Screen For Iphone 13,Mobile Lcd For Iphone 13Promax,Lcd Touch Screen For Iphone 13Pro,Lcd Display For Iphone 13Pro
Shenzhen Xiangying touch photoelectric co., ltd. , https://www.starstp.com