You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eric Ponce edited this page Nov 22, 2017
·
1 revision
This pages covers some rough instruction to using OpenOCD combined with arm-none-eabi-gdb to debug your code
.gdbinit file
A .gdbinit file should be placed within the main directory of your project. It contains setup commands for gdb. A fairly sufficient example is shown below:
# connect to the remote debug server
target remote localhost:3333
# firmware .elf file
file bin/uart_hal.elf
# reset and halt the device
mon reset halt
# set a breakpoint at main()
tbreak main
# continue until break
c
# define reset within gdb
define reset
mon reset halt
end
Starting the debug server
To get started debugging, you need to create a debug server that GDB can use to communicate with the device. OpenOCD takes care of that for us with the following command (assuming your configuration file is correct)