Hardware Debugging In Eclipse
Build a binary with debugging information using command line or via Eclipse make target.
Example Eclipse make target
GDB and OpenOCD
start openocd
Create a new debug configuration in eclipse :
you can control openocd with a telnet connection:
stop the board, flash the firmware, restart:
A this point you can launch the debug in Eclispe.
GDB and J Link
Here are some screenshots showing Hydra’s configuration of Eclipse (Kepler)
If you use cygwin to build the binaries then be sure to have configured your common Source Lookup Path
, Path Mappings
first, like this:
Create a new GDB Hardware Debugging
launch configuration from the Run
menu
It’s important to have build the executable compiled with GDB debugging information first. Select the appropriate .elf file (not hex file) - In these examples the target platform is an OLIMEXINO, not a naze32.
DISABLE auto-build
Choose the appropriate gdb executable - ideally from the same toolchain that you use to build the executable.
Configure Startup as follows
Initialization commands
It may be useful to specify run commands too:
If you use cygwin an additional entry should be shown on the Source tab (not present in this screenshot)
Nothing to change from the defaults on the Common tab
Start up the J-Link server in USB mode
If it connects to your target device it should look like this
From Eclipse launch the application using the Run/Debug Configurations…, Eclipse should upload the compiled file to the target device which looks like this
When it’s running the J-Link server should look like this.
Then finally you can use Eclipse debug features to inspect variables, memory, stacktrace, set breakpoints, step over code, etc.
If Eclipse can’t find your breakpoints and they are ignored then check your path mappings (if using cygwin) or use the other debugging launcher as follows. Note the ‘Select other…’ at the bottom of the configuration window.