From f24a3802c7d353d365e39f96d7a8e313b795c76f Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Mon, 4 Nov 2019 21:21:42 +0100 Subject: [PATCH] boards/atmega256rfr2-xpro: configure debug --- boards/atmega256rfr2-xpro/Makefile.include | 2 ++ boards/atmega256rfr2-xpro/dist/debug.sh | 11 +++++++++++ boards/atmega256rfr2-xpro/dist/debug_srv.sh | 7 +++++++ boards/atmega256rfr2-xpro/dist/gdb.conf | 1 + 4 files changed, 21 insertions(+) create mode 100755 boards/atmega256rfr2-xpro/dist/debug.sh create mode 100755 boards/atmega256rfr2-xpro/dist/debug_srv.sh create mode 100644 boards/atmega256rfr2-xpro/dist/gdb.conf diff --git a/boards/atmega256rfr2-xpro/Makefile.include b/boards/atmega256rfr2-xpro/Makefile.include index ae118a9a52..3f55b658d4 100644 --- a/boards/atmega256rfr2-xpro/Makefile.include +++ b/boards/atmega256rfr2-xpro/Makefile.include @@ -9,6 +9,8 @@ PROGRAMMER ?= xplainedpro # This board can be reset via avrdude RESET ?= avrdude -c $(PROGRAMMER) -p m256rfr2 +# Use edbg interface for debugging +DEBUGSERVER_INTERFACE ?= --edbg include $(RIOTMAKE)/tools/avrdude.inc.mk include $(RIOTBOARD)/common/atmega/Makefile.include diff --git a/boards/atmega256rfr2-xpro/dist/debug.sh b/boards/atmega256rfr2-xpro/dist/debug.sh new file mode 100755 index 0000000000..d1fb3d67ea --- /dev/null +++ b/boards/atmega256rfr2-xpro/dist/debug.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice +: ${SETSID:=setsid} + +sleep 2 +${SETSID} -w avarice $1 & +sleep 3 && avr-gdb -ex "target remote localhost:$3" $4 + +# avarice exits with 1 if the connection is released, therefore we always exit with 0 +exit 0 diff --git a/boards/atmega256rfr2-xpro/dist/debug_srv.sh b/boards/atmega256rfr2-xpro/dist/debug_srv.sh new file mode 100755 index 0000000000..8e7de053ab --- /dev/null +++ b/boards/atmega256rfr2-xpro/dist/debug_srv.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +sleep 2 +avarice $1 + +# avarice exits with 1 if the connection is released, therefore we always exit with 0 +exit 0 diff --git a/boards/atmega256rfr2-xpro/dist/gdb.conf b/boards/atmega256rfr2-xpro/dist/gdb.conf new file mode 100644 index 0000000000..ca68eb344c --- /dev/null +++ b/boards/atmega256rfr2-xpro/dist/gdb.conf @@ -0,0 +1 @@ +set $pc=0x00