Using RST in SWD Debugging Port

1. Introduction

In the development of STM32 microcontrollers, using SWD for program downloading only requires two pins. So, when do we need to use the microcontroller’s RST port? This involves the pin configuration of the microcontroller. In the CubeMX software configuration, there are five options regarding system debugging settings. If you choose SWD debugging, you can see that PA13 and PA14 pins are occupied. If you choose no debugging port, these two pins will not be occupied. At this point, when using SWD to download the program, you need to connect the RST pin. If there are enough pins available, it is generally set to use the SWD debugging function. Thus, in the microcontroller debugging port, only two wires are actually needed.

Using RST in SWD Debugging Port

2. Experimental Verification

This is a test circuit board designed yesterday, with the core chip being F103. The debugging probe on the circuit board does not have a RESET lead, only the two SWD pins introduced to the microcontroller. The RESET pull-up resistor of the microcontroller is next to the chip and is not connected to the RESET line in the ST-LINK. You can use the probe on the debugging platform to manually connect the RESET line from the ST-LINK to the microcontroller’s RESET pull-up resistor.

Using RST in SWD Debugging Port

Now, the microcontroller has previously burned a program that does not set the SWD pins, and since the RESET lead is not connected, it is now impossible to download software in the Keil environment using only the two SWD lines. Next, manually connect the RESET line from the ST-LINK to the microcontroller’s reset pull-up resistor. This way, the RESET line in the ST-LINK is connected to the microcontroller. It can be seen that at this time, the microcontroller can complete a normal download.

Using RST in SWD Debugging Port

Next, reset the SWD pins to generate a new application. After compilation, download it to the current microcontroller. Then, remove the RESET connection line. You can see that now, just under the action of the two SWD pins, the microcontroller can be downloaded with the program.

Using RST in SWD Debugging Port

※ Conclusion ※

This article records the function of setting SWD pins in the STM32 microcontroller. If the SWD pins were set during the last programming, then in the future, only the two SWD pins in the ST-LINK will be needed for debugging, without the need for the RESET lead.

Using RST in SWD Debugging Port

Leave a Comment