Datasheet
line, and enter the following command:
$ ./arm-none-eabi-gdb something.ino.elf
` something.ino.elf ` is the name of the .elf file generated when you built your sketch. You can find this by enabling
'Show verbose output during: [x] compilation' in the Arduino IDE preferences. You CAN run GDB without the .elf file,
but pointing to the .elf file will give you all of the meta data like displaying the actual source code at a specific
address, etc.
Once you have the (gdb) prompt, enter the following command to connect to the Segger GDB server (updating
your IP address accordingly, since the HW isn't necessarily local!):
(gdb) target remote 127.0.0.1:2331
If everything went well, you should see the current line of code where the device is halted (normally execution on
the nRF52 will halt as soon as you start the Segger GDB Server).
At this point, you can send GDB debug commands, which is a tutorial in itself! As a crash course, though:
To continue execution, type ' monitor go ' then ' continue '
To stop execution (to read register values, for example.), type ' monitor halt '
To display the current stack trace (when halted) enter ' bt '
To get information on the current stack frame (normally the currently executing function), try these:
info frame : Display info on the current stack frame
info args : Display info on the arguments passed into the stack frame
info locals : Display local variables in the stack frame
info registers : Dump the core ARM register values, which can be useful for debugging specific fault
conditions
Are there any other cross platform or free debugging options other than GDB?
If you have a Segger J-Link, you can also use Segger's OZone debugger GUI to interact with the device, though
check the license terms since there are usage restrictions depending on the J-Link module you have.
You will need to connect your nRF52 to the J-Link via the SWD and SWCLK pins on the bottom of the PCB, or if you
are OK with fine pitch soldering via the SWD header.
You can either solder on a standard 2x5 SWD header on the pad available in the board, or you can solder wires to
the SWD and SWCLK pads on the bottom of the PCB and use an SWD Cable Breakout Board, or just connect cables
directly to your J-Link via some other means.
You will also need to connect the VTRef pin on the JLink to 3.3V on the Feather to let the J-Link know what voltage
level the target has, and share a common GND by connecting the GND pins on each device.
Before you can start to debug, you will need to get the .elf file that contains all the debug info for your sketch. You
can find this file by enabling Show Verbose Output During: compilation in the Arduino Preferences dialogue box.
When you build your sketch, you need to look at the log output, and find the .elf file, which will resemble something
like this (it will vary depending on the OS
used): /var/folders/86/hb2vp14n5_5_yvdz_z8w9x_c0000gn/T/arduino_build_118496/ancs_oled.ino.elf
In the OZone New Project Wizard, when prompted to select a target device in OZone select nRF52832_xxAA, then
make sure that you have set the Target Interface for the debugger to SWD, and finally point to the .elf file above:
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 172 of 175