STM32 has three startup modes. In RM0008 downloaded from the ST official website, you can find the startup-related configuration instructions:
Translated into Chinese:
The storage media corresponding to the three boot modes of STM32 are all built-in to the chip, they are:
1) User Flash = Flash built into the chip.
2) SRAM = RAM area built into the chip, that is, memory.
3) System Memory = A specific area inside the chip. A Bootloader is preset in this area when the chip leaves the factory, which is usually called the ISP program. The content of this
area cannot be modified or erased after the chip leaves the factory, that is, it is a ROM area.
There are two pins BOOT0 and BOOT1 on each STM32 chip. The level state of these two pins when the chip is reset determines which area the program starts to
execute , see the table below:
BOOT1=x BOOT0=0 Boot from user flash memory, this is the normal working mode.
BOOT1=0 BOOT0=1 Boot from system memory. The program function started in this mode is set by the manufacturer.
BOOT1=1 BOOT0=1 Boot from built-in SRAM. This mode can be used for debugging.
Main Flash memory
is the built-in Flash of STM32. Generally, when we download programs using JTAG or SWD mode, they are downloaded to this memory. After restarting, the program is started directly from this memory.
System memory
is started from system memory. The program function started in this mode is set by the manufacturer. Generally speaking, this startup mode is rarely used. System memory is a specific area inside the chip. When STM32 leaves the factory, ST presets a BootLoader in this area, which is what we often call the ISP program. This is a ROM and cannot be modified after leaving the factory. Generally speaking, when we choose this startup mode, it is to download the program from the serial port, because the firmware of the serial port download program is provided in the BootLoader provided by the manufacturer, and the program can be downloaded to the system's Flash through this BootLoader. However, this download method requires the following steps:
Step1: Set BOOT0 to 1, BOOT1 to 0, and then press the reset button to start the BootLoader from the system memory.
Step2: Finally, with the help of BootLoader, download the program to Flash through the serial port
. Step3: After the program is downloaded, it is necessary to set BOOT0 to GND and reset it manually. In this way, STM32 can be started from Flash.
It can be seen that it is quite troublesome to download programs via the serial port. It requires jumping back and forth, and does not pay much attention to user experience.
Embedded Memory
has built-in SRAM. Since it is SRAM, it naturally has no program storage capability. This mode is generally used for program debugging. If I only modify a small part of the code, then I need to erase the entire Flash again, which is quite time-consuming. I can consider starting the code from this mode (that is, in the memory of STM32) for fast program debugging. After the program debugging is completed, the program can be downloaded to the Flash.
It should be noted that the built-in SRAM is generally not used for booting (BOOT1=1 BOOT0=1), because the data in the SRAM will be lost after power failure. In most cases, SRAM is only used for debugging, and it can also be used for other purposes. For example, to do local fault diagnosis, write a small program and load it into the SRAM to diagnose other circuits on the board, or use this method to read and write the Flash or EEPROM on the board. This method can also be used to remove the read and write protection of the internal Flash. Of course, when the read and write protection is removed, the contents of the Flash are automatically cleared to prevent malicious software from copying.
Generally, the BOOT0 and BOOT1 jumpers are jumped to 0 (ground)
Previous article:stm32 FSMC-External SRAM IS62WV51216
Next article:Learning STM32 (3) - Power supply, clock, reset circuit
Recommended ReadingLatest update time:2024-11-16 07:47
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Creative Gift Winners List|2020-2021 ON Semiconductor and Avnet IoT Creative Design Competition
- E103-W01-BF test version use
- Pingtouge Xuantie CPU debugging system
- Python Software Foundation Welcomes Google as First Top-Level Visionary Sponsor
- What do strong pull-up, strong pull-down, weak pull-up, and weak pull-down mean?
- 2019 TI Automotive Electronics Applications Seminar Highlights Video Review
- I decided to quit my job and develop my operating system full-time (transferred)
- Design rules for four-layer PCB
- If there is no reference ground at all, do you think it is still possible to control the impedance?
- Why is the stm32 pin reading different from the oscilloscope measurement?