Using ST-Link for Debugging in Embedded Studio

Follow andstar our public account to not miss exciting content

Using ST-Link for Debugging in Embedded Studio

Source | Microtech

The ST examples provided by Segger are debugged using J-Link. But what if we only have the ST-Link emulator? This article will introduce how to use ST-Link for debugging in Segger Embedded Studio.

Operating Environment:1. Embedded Studio for ARM v4.52. ST Nucleo-L476RG BoardSetting Up ST-Link in Embedded Studio:We are using the emBOS-STM32L476RG project provided by SeggerUsing ST-Link for Debugging in Embedded Studio

Select the project, right-click, and choose Options:

Using ST-Link for Debugging in Embedded StudioSelect Debug->Debugger->Target Connection, click on the rightmost side to bring up a dropdown checkbox, click the arrow to pop up the checkbox, and select GDB Server:Using ST-Link for Debugging in Embedded StudioThen select GDB Server->Type on the left side, click on the rightmost side to bring up a dropdown checkbox, click the arrow to pop up the checkbox, and select ST-Link:Using ST-Link for Debugging in Embedded StudioOther options can be left as default, click OK to save.Using ST-Link for Debugging in Embedded StudioStart the GDB server, we are using the ST-Link GDB Server in TrueSTUDIO for STM32 9.3.0, before debugging, run D:\atollic\TrueSTUDIO for STM32 9.3.0\Servers\ST-LINK_gdbserver\ ST-LINK_gdbserver.bat(Note: Atollic is a Swedish embedded software tool development company, currently acquired by ST. Its embedded development environment is TrueSTUDIO, and we need to use the gdbserver software that supports ST-Link, which can be downloaded from TrueSTUDIO’s website at https://atollic.com/truestudio.)Using ST-Link for Debugging in Embedded Studio

The running results are shown below:

Using ST-Link for Debugging in Embedded StudioNow, we select Target->Connect GDB Server from the main menu of Embedded Studio:Using ST-Link for Debugging in Embedded Studio

At this point, we can see in the OUTPUT window of the IDE that the GDB Server connection is complete, and a GDB Server is displayed in the lower right prompt bar.

Using ST-Link for Debugging in Embedded Studio

Now, we select Debug->Go from the main menu

Using ST-Link for Debugging in Embedded Studio

In the Output window, we can see the download information as shown below:

Using ST-Link for Debugging in Embedded Studio

We see that the program stops at the Main function, and we can start debugging.

Using ST-Link for Debugging in Embedded Studio

Conclusion

Many ST development boards do not provide JTAG or SWD interfaces, only providing onboard ST-Link. This method allows for easy debugging of programs using ST-Link in Segger Embedded Studio.

———— END ————Recommended Reading:USB PD Fast Charging Communication PrinciplesPrinciples of Object-Oriented Implementation in C LanguagePrinciples of Preemptive Operating Systems without MMUFollow the public account “strongerHuang”, reply “1024” to see more content, reply “Join Group” to join the technical exchange group according to the rules.

Using ST-Link for Debugging in Embedded Studio

Long press to go to the public account in the image and follow

Click “Read the original text” to see more shares, welcome to share, collect, like, and read.

Leave a Comment