• Welcome to Andy's Workshop Forums. Please login or sign up.
 
April 28, 2024, 11:31:39 am

News:

SMF - Just Installed!


Debug in Eclipse?

Started by 2cats, September 30, 2014, 09:17:29 pm

Previous topic - Next topic

2cats

How to debug the examples?I mean both simulation and  with JLINK. I have built  the examples and installed  GDB Hardware Debugging.But When I push "Search Project " button in "Debug Configuration" ,I couldn't find any projects.

By the way ,need I configure the Sconscript as I write more source files and folders ?Are we using scons in Eclipse?

Andy Brown

October 01, 2014, 01:57:48 pm #1 Last Edit: October 01, 2014, 01:59:31 pm by Andy Brown
It sounds like you've almost got it all done. So you've built the examples in Eclipse and you're ready to debug.

Firstly you must have your hardware debug server running. For me that means OpenOCD because I use ST-Link to debug. You can also use OpenOCD with JLink (instructions here) but I believe that JLink actually comes with its own gdb debug server that runs in a window on your desktop - I saw it some years ago and assume that it still exists.

Anyway, to connect to the debug server you need to create a Debug Configuration in Eclipse. Select "Run -> Debug Configurations" and you should see "GDB Hardware Debugging" in the panel. Right click on it and select "New". You need a separate configuration for each program you create. I have literally dozens of these. The tabs that you need to fill in on the right contain the important settings for how to connect to the debug server and what commands to send to it.

If you scroll to the bottom of my ST-Link article you'll see screenshots of my own debug configuration. Bear in mind this is for ST-Link so some things may need to change on your system (e.g. the TCP port number of the debug server).

scons is not used at all in Eclipse, it's only used for command line builds and does not get mixed up in any way with the binaries that you build in Eclipse.

Please let us know how you get on.
It's worse than that, it's physics Jim!

2cats

Is there any way to simulate debugging?

Andy Brown

It sounds like what you want to do is debug in a virtual STM32 environment without being physically attached to the chip, much like you can with some of the small 8 bit MCUs. I'm not aware of any product that will allow you to do that.
It's worse than that, it's physics Jim!