diff --git a/boards/nrf51dongle/Makefile.include b/boards/nrf51dongle/Makefile.include index 6181022622..76f48a1f71 100644 --- a/boards/nrf51dongle/Makefile.include +++ b/boards/nrf51dongle/Makefile.include @@ -6,18 +6,9 @@ export CPU_MODEL = nrf51x22xxab PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) -# define flash and debugging environment -export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh -export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh -export DEBUGSERVER = JLinkGDBServer -device nrf51822 -if SWD -export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh - -export OFLAGS = -O binary -export HEXFILE = $(ELFFILE:.elf=.bin) -export TERMFLAGS += -p "$(PORT)" -export FFLAGS = $(BINDIR) $(HEXFILE) -export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -export RESET_FLAGS = $(BINDIR) +# setup JLink for flashing +export JLINK_DEVICE := nrf51822 +include $(RIOTBOARD)/Makefile.include.jlink # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/nrf51dongle/dist/debug.sh b/boards/nrf51dongle/dist/debug.sh deleted file mode 100755 index 24bdbae0f6..0000000000 --- a/boards/nrf51dongle/dist/debug.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# Start in-circuit debugging on this board: this script starts up the GDB -# client and connects to a GDB server. -# -# Start the GDB server first using the 'make debugserver' target - -# @author Hauke Petersen - -BINDIR=$1 -ELFFILE=$2 - -# write GDB config file -echo "target extended-remote 127.0.0.1:2331" > $BINDIR/gdb.cfg - -# run GDB -arm-none-eabi-gdb -tui -command=$BINDIR/gdb.cfg $ELFFILE diff --git a/boards/nrf51dongle/dist/flash.sh b/boards/nrf51dongle/dist/flash.sh deleted file mode 100755 index 0f4bbb33c7..0000000000 --- a/boards/nrf51dongle/dist/flash.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# This flash script dynamically generates a file with a set of commands which -# have to be handed to the flashing script of SEGGER (JLinkExe >4.84). -# After that, JLinkExe will be executed with that set of commands to flash the -# latest .bin file to the board. - -# @author Timo Ziegler -# @author Hauke Petersen - -BINDIR=$1 -HEXFILE=$2 - -# setup JLink command file -echo "device nrf51822" > $BINDIR/burn.seg -echo "speed 1000" >> $BINDIR/burn.seg -echo "w4 4001e504 1" >> $BINDIR/burn.seg -echo "loadbin $HEXFILE 0" >> $BINDIR/burn.seg -echo "r" >> $BINDIR/burn.seg -echo "g" >> $BINDIR/burn.seg -echo "exit" >> $BINDIR/burn.seg -echo "" >> $BINDIR/burn.seg - -# flash new binary to the board -JLinkExe < $BINDIR/burn.seg diff --git a/boards/nrf51dongle/dist/reset.sh b/boards/nrf51dongle/dist/reset.sh deleted file mode 100755 index 509f127ea4..0000000000 --- a/boards/nrf51dongle/dist/reset.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# This script resets a nrf51822 target using JLink called -# with a pre-defined reset sequence. - -# @author Hauke Petersen - -BINDIR=$1 - -# create JLink command file for resetting the board -echo "device nrf51822" > $BINDIR/reset.seg -echo "r" >> $BINDIR/reset.seg -echo "g" >> $BINDIR/reset.seg -echo "exit" >> $BINDIR/reset.seg -echo " " >> $BINDIR/reset.seg - -# reset the board -JLinkExe < $BINDIR/reset.seg