About BOOT0 and BOOT1 of STM32

Publisher:JFETLatest update time:2018-05-13 Source: eefocusKeywords:STM32  BOOT0  BOOT1 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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)


Keywords:STM32  BOOT0  BOOT1 Reference address:About BOOT0 and BOOT1 of STM32

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

Example of STM32 external interrupt implemented based on STM32CubeIDE software
This article uses STM32CubeIDE software to implement STM32 external interrupt examples. New Construction "File"-"New"-"STM32 Project". Enter the chip model STM32F103ZE. Select the appropriate package and proceed to the next step. Fill in the project name, select the project location, and click next. Configure
[Microcontroller]
Example of STM32 external interrupt implemented based on STM32CubeIDE software
The first new product, Mier STM32MP2 core board is launched! High performance + multiple interfaces + edge computing power
Mir released the MYC-LD25X core board and development board based on the STM32MP257 embedded processor module. The core board is based on the STM32MP2 series, which is the latest generation of industrial-grade 64-bit microprocessors launched by STMicroelectronics. It adopts LGA 252 PIN design, storage configuration
[Embedded]
The first new product, Mier STM32MP2 core board is launched! High performance + multiple interfaces + edge computing power
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号