cancel
Showing results for 
Search instead for 
Did you mean: 

Start 3rd party GDB server (or any script) - from debug config - possible? (Renode with GDB)

SKled.1
Senior II

In CubeIDE, in the Debug Configurations window, there is the Debugger tab, where you can select "Autostart local GDB server" or "Connect to remote GDB server".

Now, what I have been doing to debug code running on the Renode emulator, is manually start Renode & manually start its GDB server, and use the "remote GDB" option in the debug config.

What I'd like to do is that when I start debugging / running from CubeIDE, that everything happens automatically,
i.e. somehow Renode and its GDB are started, and _then_ (it needs to be mare sure to be running for connecting, of course) connecting to that GDB server, to load the binary & debug it.
And optimally, close Renode down after it.

Is there some trick to somehow achieve that?

A follow-up question then would be: - is it possible somehow to have the simulated UART output, which is also seen from a SSH connection to Renode, from within CubeIDE?
I remember to have seen setups where remove SSH sessions were started from within Eclipse CDT environment when debugging, to see the output from & interact with the target. I can't quite remember whether special plugins were used or anything based on Eclipse would allow that, I didn't use it myself.

It would be practical in this case, as my goal here is to run unit tests for my STM32 modules on Renode, and see the result outut of that from within the IDE, without having to open & mess around with external windows like PuTTY.

Perhaps some plugin for such things exist that I don't know.

1 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @SKled.1 

To automate the process of starting Renode and its GDB server from STM32CubeIDE, you can utilize the External Tools feature within the IDE. This allows you to create a configuration that will run scripts or commands before starting the debugger. Here’s how you can set it up:
Automating Renode and GDB Server Start
1- Create a Script:

Write a script (e.g., a shell script or batch file) that:
Starts Renode.
Starts the GDB server within Renode.
Waits for the GDB server to be ready.

2- Configure External Tools in STM32CubeIDE:
Go to Run > External Tools > External Tools Configurations....

GhofraneGSOURI_0-1729771045703.png

 


Create a new configuration for your script.

GhofraneGSOURI_1-1729771066587.png

 

Set the location of your script and any necessary arguments.
3-Set Debug Configuration:
In the Debug Configurations window, under the Debugger tab, select Connect to remote GDB server.
Specify the GDB server address (usually localhost with the appropriate port).
4- Run the External Tool Before Debugging:
Before starting your debug session, run your external tool configuration to start Renode and its GDB server.
Close Renode After Debugging