Detailed explanation of STM32 ISP settings and usage instructions

Publisher:tyloo820Latest update time:2016-10-09 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. Overview of STM32 BOOT

The storage media corresponding to the three startup modes of STM32 are all built-in to the chip, they are:

User Flash: BOOT1=x BOOT0=0 The built-in Flash of the chip, i.e. the main memory Flash

SRAM: BOOT1=1 BOOT0=1 The SRAM area built into the chip is the memory. 

System memory: BOOT1=0 BOOT0=1 A specific area inside the chip is called system memory. 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 status of these two pins when the chip is reset determines which area the program starts from after the chip is reset, see the table below:

BOOT1=x BOOT0=0 Boot from user flash memory, which 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.

It should be noted that the built-in SRAM is generally not used for startup (BOOT1=1 BOOT0=1), because the data in the SRAM will be lost after the power is off. In most cases, SRAM is only used for debugging, and it can also be used for other purposes. For example, to do local diagnosis of faults, write a small program to 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 removing the read and write protection, the content of the Flash is also automatically cleared to prevent malicious software from copying.

Generally, both BOOT0 and BOOT1 jumpers are set to 0 (GND), which means the system runs normally from the on-chip Flash. However, in the case of ISP download, you need to set BOOT0=1 and BOOT1=0. After the download is complete, connect the BOOT0 jumper back to 0 so that the system can run normally.

For general applications, you can directly ground the BOOT0 and BOOT1 pins without setting jumpers. When using the IAR debugger, you can choose RAM debugging or Flash debugging, which has nothing to do with the configuration of BOOT0 and BOOT1.

When I was designing the program for stm32, I encountered a conflict between the nss pins of spi3 and the pins of JTAG. So in order to solve this problem and make spi3 work normally, I disabled the JTAG function through the library function GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);, so that spi3 can be used normally, but the result is that the program cannot be burned through JTAG! Therefore, the topic of burning the program through the ISP serial port has surfaced!

 

2. The usage process of STM32 ISP tool.
Before using the following burning tool to upgrade the ISP code, you need to configure the hardware first: Boot0=1, Boot1=0, that is, either pull-up resistors or pull-down resistors are acceptable. In addition, the serial port line connects the PC and the UART1 of the STM32 hardware circuit board. It must not be UART1, and other lines are not acceptable.
1. FlyMcu.exe can be used normally. After selecting the corresponding serial port, press the read device information button. The software starts to communicate with stm32 and reads the chip model, version, capacity and other information, indicating that the communication is successful. If it shows that it is always connected, you need to reset the stm32 circuit board to connect successfully.
2. Flash Loader demo needs to be installed on the PC. After opening the software and setting the above hardware connections, the following parameters of the software must be set in particular: Parity: Even, Echo: Disabled. Then, immediately press Next in the software after resetting the hardware circuit board. Generally, the connection will be successful. Otherwise, retry the above actions. The unreasonable part of this software is that you must press Next immediately after resetting the board each time, instead of being able to connect by pressing Reset during the Next connection. This is where the software needs to be improved and upgraded.
3. When using SIMISP.exe, you must also press "Connect Device" immediately after resetting the hardware. At this time, the lower right corner will display "Connected", the green light will be on, and the connection is successful. After selecting the file to be burned, click "Start Flash" to start the burning process. However, since this software burns program files too slowly, it is not used for the time being.
Note: When I started using the above three software, I couldn't connect the PC and STM32 hardware board normally. After trying many methods, I finally found that it was necessary to reset the hardware development board and connect the software immediately. If the hardware is not rested, or the software is connected after a few seconds after the hardware is reset, it is generally not possible to connect successfully. So remember: press the connection software immediately after resetting the hardware! ! ! After the connection is successful, according to the interface information, you can erase and burn the flash!
Keywords:STM32 Reference address:Detailed explanation of STM32 ISP settings and usage instructions

Previous article:stm32 adc sampling rate
Next article:Differences between STM32 advanced timers, general timers, and basic timers

Latest Microcontroller Articles
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号