Follow andstar our public account to not miss exciting content

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 Segger
Select the project, right-click, and choose Options:
Select 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:
Then 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:
Other options can be left as default, click OK to save.
Start 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.)
The running results are shown below:
Now, we select Target->Connect GDB Server from the main menu of 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.

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

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

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

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.

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.