This guide demonstrates how to debug embedded targets using Dronecode Probe (or Black Magic Probe in general) and the Eclipse IDE.
- Open your Eclipse project.
- Go
Window
→Preferences
→Run/Debug
→Launching
→Default Launchers
:- Select
GDB Hardware Debugging
→[Debug]
, then tick onlyLegacy GDB Hardware Debugging Launcher
, and make sure that the option for GDB (DSF) is disabled.
- Select
- Go
Run
→Debug Configurations
:- Invoke the context menu for
GDB Hardware Debugging
, select New. - Tab
Debugger
:- Set the field
GDB Command
toarm-none-eabi-gdb
(or other if necessary). - Untick
Use remote target
.
- Set the field
- Tab
Startup
:- If a boot loader is used, make sure that
Image offset
is configured correctly. - [Optional] Enter the following line in the field
Run Commands
:run
. - Enter the following in the field
Initialization Commands
:
- If a boot loader is used, make sure that
- Invoke the context menu for
# Make sure to select the correct port here target extended /dev/ttyACM0 # Use jtag_scan instead of swdp_scan if necessary monitor swdp_scan attach 1
You should keep in mind that Eclipse IDE is extremely unreliable in general, and especially so when it comes to debugging embedded targets via GDB. Sometimes it may just stop working, in which case you should perform the following steps to revive it:
- Power down the target.
- Disconnect the debugger from USB.
- Shut down Eclipse and double check that all of its processes have terminated (
killall eclipse && killall java
). - Connect the debugger back and start up Eclipse again.
- Power up the target.