diff --git a/boards/samr21-xpro/Makefile.include b/boards/samr21-xpro/Makefile.include index 074dd7fb3a..89d53d2c09 100644 --- a/boards/samr21-xpro/Makefile.include +++ b/boards/samr21-xpro/Makefile.include @@ -29,6 +29,7 @@ export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endi export LINKFLAGS += -T$(LINKERSCRIPT) export OFLAGS += -O binary export FFLAGS += $(HEXFILE) +export DEBUGGER_FLAGS = $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE) export TERMFLAGS += "$(PORT)" # unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ diff --git a/boards/samr21-xpro/dist/debug.sh b/boards/samr21-xpro/dist/debug.sh index 2e424babfb..5b0fad1f71 100755 --- a/boards/samr21-xpro/dist/debug.sh +++ b/boards/samr21-xpro/dist/debug.sh @@ -5,4 +5,15 @@ openocd -f "board/atmel_samr21_xplained_pro.cfg" \ -c "telnet_port 4444" \ -c "init" \ -c "targets" \ - -c "reset halt" + -c "reset halt" \ + -l /dev/null & + +# save pid to terminate afterwards +OCD_PID=$? + +# needed for openocd to set up +sleep 5 + +arm-none-eabi-gdb -tui --command=${1} ${2} + +kill ${OCD_PID} diff --git a/boards/samr21-xpro/dist/gdb.conf b/boards/samr21-xpro/dist/gdb.conf new file mode 100644 index 0000000000..8a693c6a03 --- /dev/null +++ b/boards/samr21-xpro/dist/gdb.conf @@ -0,0 +1,2 @@ +target remote localhost:3333 +monitor reset halt