Using the sleep mode of the stm32 microcontroller, the microcontroller is intermittently dormant to achieve low power consumption. It is often impossible to wake up after going to sleep, causing the next program to burn. The usual solution is: the general development board or the minimum system of the microcontroller will have a reset button, press and hold the reset button, click to download, and then release the reset button.
The problem I encountered was: I stumbled into the STOP mode of stm32 (STM32L051C6T6) and did not write the corresponding wake-up method, which caused subsequent programs to not download. When using MDK5, click on load will always appear No target connected. The smallest system designed by myself has not added the reset button. . .
There are several solutions:
1. The NRST pin of the MCU can be pulled out and the reset button can be connected externally. (About the pin view available ST official software STM32cubeMX, very convenient)
2, through the ISP way to download the program, you must connect boot0 to the high level, boot1 (PB2) connected to the low level, and then must be powered off and restart, then the microcontroller will enter the ISP mode, you can pass the serial port 1 (general microcontroller It is only the serial port 1 can download the program) and then use the flymcu and other software to burn the hex file.
Regarding boot0 and boot1, there are two pins in each stm32 microcontroller. The level state of these two pins at reset determines the area from which the chip starts executing after reset.
Boot1=x boot0=0 Boot from user flash, which is the normal mode of operation.
Boot1=0 boot0=1 Boot from system memory (enter ISP mode).
Boot1=1 boot0=1 Boot from the built-in SRAM, this mode can be used for debugging.
In this way, the microcontroller cannot enter the normal working mode, and it is impossible to sleep, and the program can be downloaded through the ISP.
3, using STlink programming, STlink must connect at least 4 lines (SWDIO, SWCLK, GND, SW-RST), the general download program only needs the first three, but in case of sleep can not wake up, this When there is a reset button, SWDIO and SWCLK can be reset. If the board design does not correspond to SW-RST, then NRST on the microcontroller needs to be connected to SW-RST. Boot0 is connected to the high level before the program is downloaded, and boot1 does not need to be managed (it also needs to be restarted after power off).
Download the configuration here as follows, RESET where HW RESET and SYSRESETREQ are optional.
After configuration, load an empty program, do not burn a sleep program, and then you can burn the program.
Summary: Due to board design and other reasons, the third method is used, and the first two methods are also available.
25*50mm Low Profile White Faceplate
included or excluded keystones for Keystones, or designed with PC board
fixtures and fittings provided
for Solid Cat 5 or Cat 6 cable
size is 25*50mm basing on UK type standard
Material as ABS, PC, PBT in UL94V-0 standards
Operation temperture -40~70 ℃
Could accept any combination of UONICRE Keystone Jack or RJ45 connectors
UK Face Plate,Outlet Face Plate,Wall Socket Face Plate,Face Plate Wall Socket
NINGBO UONICORE ELECTRONICS CO., LTD , https://www.uonicore.com