Launching the Debugger

Get Yourself Connected

Go ahead and plug in the following. This will be necessary for all debugging sessions.

  • Micro USB Feather <--> USB Computer
  • Segger J-Link USB <--> USB Computer
  • Make sure JST 2-pin connector is plugged in
  • Make sure J-Link is connected to Adafruit Board and the SWD 2x5 ribbon is connected to the FeatherWing Header Board we have made.

J-LINK GDB Server

Download: file
$ sudo /usr/local/bin/JLinkGDBServer \ 
  -device Cortex-M0 -speed auto -if SWD

Launch the  J-Link GDB server from the command line. 

This is what it looks like when the GDB Server is launched and waiting for a the GDB client to connect.

.gdbinit file

Download: file
target remote localhost:2331 
monitor device Cortex-M0 
monitor speed auto
file /var/folders/_t/fsyrnxxs53v59j1l1xkn9k8r0000gp/T/arduino_build_244528/feather-m0.ino.elf
load
monitor reset

A .gdbinit file in your home directory ~/.gdbinit will greatly improve your quality of life when debugging. It gets around the problem of needing to remember the command sequence, connection ports and file paths to get the debugger going.

GDB client

Download: file
$ /usr/local/bin/arm-none-eabi-gdb

The above command will start the gdb client.

and we are off...Now the code is running in full debug mode on our Feather M0 board.

This guide was first published on Jan 30, 2017. It was last updated on Jan 30, 2017. This page (Launching the Debugger) was last updated on Sep 21, 2019.