- Power down nRF52DK
- Power up nRF52DK while holding down
IF BOOT/RESET
button - Drag JLink bootloader binary to
BOOTLOADER
volume - Power-cycle
At this point, the MBed bootloader has been replaced with JLink's.
$ JLinkGDBServer -Device NRF52 -If SWD -Speed 4000
$ mbed compile -c --profile mbed-os/tools/profiles/debug.json
Create debug_jlink.gdb
in project root:
set history save on
target extended-remote localhost:2331
break _exit
commands
up 3
end
define reload
load
start
end
reload
You can debug using plain GDB
, or CGDB
, which is a wrapper around GDB
and provides a better TUI.
$ arm-none-eabi-gdb BUILD/NRF52_DK/GCC_ARM/<APP>.elf -x debug_jlink.gdb
$ cgdb -d arm-none-eabi-gdb -- BUILD/NRF52_DK/GCC_ARM/<APP>.elf -x debug_jlink.gdb