Skip to main content
SKled.1
Senior
November 2, 2022
Question

Connect to running GDB server without ST-Link

  • November 2, 2022
  • 4 replies
  • 4180 views

I am trying to debug a program in STM32CubeIDE on a Renode emulator, with a running gdbserver, started by Renode.

So in Debug Configurations dialog, Debugger tab, there is a radiobutton Connect to remote GDB server, but when clicking Debug, it complains about no ST-link being found.

Is it possible somehow to set things up such that I'm debugging only with GDB, without requiring a hardware debugger?

4 replies

MM..1
Chief III
November 2, 2022

I mean this works only with

0693W00000VOjhWQAT.png 

SKled.1
SKled.1Author
Senior
November 3, 2022

I'm not sure I can, out of that batch, make a running Renode instance start a gdb server.

Perhaps one can start a new renode instance with all the stuff needed, like loading a platform model, AND starting gdbserver... I'll look into that.

Is the ST-LINK_gdbserver _the_ thing that requires the HW debugger? Because, I set in the debug config to connect to a "remote server", which souns to me like it would not do anything with the ST-LINK_gdbserver.

MM..1
Chief III
November 3, 2022

This i use with stlink remotely. But i mean isnt for renode.

Maybe this 0693W00000VOpNDQA1.png

Semer CHERNI
ST Employee
November 3, 2022

Hello @Community member​ 

First let me thank you for posting.

Unfortunately, this is emulator is not officially supported by ST.

But if you are able to make it work it is going to be interesting to share the details with the community.

Thx

Semer.

SKled.1
SKled.1Author
Senior
November 3, 2022

Hello,

depending on how things go with what "MM..1" showed & I found out, well, if it's innate in CubeIDE to want the ST-link (or Segger) present, I have no chance of making that work, right?

Btw,

let me state that it might be in ST-Micro's interest to allow easy interoperability between their default IDE and Renode, for at least two reasons:

  • given long lead times for actually getting STM32 products in recent years, it might motivate some companies looking at other vendors' offerings to stay with their known vendor, if they can at least easily write & test their firmware before the hardware is available
  • Antmicro, the maker of Renode, has already collaborated / is collaborating with e.g. Microchip for some of their offerings. I'll leave it at that. ;)

Pavel A.
Super User
November 3, 2022

CubeIDE debugger has also OpenOCD option. It is opensource, you can hack it.

Chris F
Associate
March 7, 2024

With the hints provided by other users here in this thread, I got remote debugging of an application running on an emulated STM32 MCU in renode working:

  1. Load your machine in the renode monitor shell. For example: (monitor) include @scripts/single-node/nucleo_l433rc_p.resc 
  2. Start the GDB server in the machine to listen on port 3333 (or any other unused port): (nucleo_l433rc_p) machine StartGdbServer 3333

  3. In CubeIDE (v1.13.2) add a GDB Hardware Debug configuration like this:GDB-remote-Debug-Configurations.png

  4. Click the Debug button so that the debugger connects to the GDB server
  5. Start your machine in renode
  6. Use the debugger in the CubeIDE
Visitor II
April 4, 2025

Hey Chris, This is almost working for me. Couple of things I might be missing. Do I need to run arm-none-eabi-gdb Sample.elf at some point in this sequence? Also, target remote localhost:3333?

Thanks,

Keith

Visitor II
April 4, 2025

Nevermind, I got it. Arm-gdb and target weren't needed, I had just tweaked my code and was getting thrown off.

Thanks!