diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index 0054a3f41915398320d8379791fd08688c043f74..603c277d3f6b1d1659bea7f4830f8188a51a22fb 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -6,17 +6,11 @@ export CPU_MODEL = cc2538sf53 PORT_LINUX ?= /dev/ttyUSB0 PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbserial-* | head -n 1) -# -export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh -export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh -export DEBUGSERVER = JLinkGDBServer -device CC2538SF53 -export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh - -export OFLAGS = -O binary -export HEXFILE = $(ELFFILE:.elf=.bin) -export FFLAGS = $(BINDIR) $(HEXFILE) -export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE) -export RESET_FLAGS = $(BINDIR) +# setup JLink for flashing +export JLINK_DEVICE := cc2538sf53 +export JLINK_FLASH_ADDR := 200000 +export JLINK_IF := JTAG +include $(RIOTBOARD)/Makefile.include.jlink # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/openmote-cc2538/dist/debug.sh b/boards/openmote-cc2538/dist/debug.sh deleted file mode 100755 index 24bdbae0f64f06cfd0aec7ab536f4e8d6a901a0a..0000000000000000000000000000000000000000 --- a/boards/openmote-cc2538/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 <hauke.petersen@fu-berlin.de> - -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/openmote-cc2538/dist/flash.sh b/boards/openmote-cc2538/dist/flash.sh deleted file mode 100755 index 49e063535822bdbaf5a65d4c744d9376c5890dd7..0000000000000000000000000000000000000000 --- a/boards/openmote-cc2538/dist/flash.sh +++ /dev/null @@ -1,23 +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 Hauke Petersen <hauke.petersen@fu-berlin.de> - -BINDIR=$1 -HEXFILE=$2 -FLASHADDR=200000 - -# setup JLink command file -echo "speed 1000" >> $BINDIR/burn.seg -echo "loadbin $HEXFILE $FLASHADDR" >> $BINDIR/burn.seg -echo "r" >> $BINDIR/burn.seg -echo "g" >> $BINDIR/burn.seg -echo "exit" >> $BINDIR/burn.seg - -# flash new binary to the board -JLinkExe -device CC2538SF53 < $BINDIR/burn.seg -echo "" diff --git a/boards/openmote-cc2538/dist/reset.sh b/boards/openmote-cc2538/dist/reset.sh deleted file mode 100755 index bb4da65c0ecf3ddbb4cb852d39e028ce4b2d6248..0000000000000000000000000000000000000000 --- a/boards/openmote-cc2538/dist/reset.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# This script resets a CC2538SF53 target using JLink called -# with a pre-defined reset sequence. - -# @author Hauke Petersen <hauke.petersen@fu-berlin.de> - -BINDIR=$1 - -# create JLink command file for resetting the board -echo "r" >> $BINDIR/reset.seg -echo "g" >> $BINDIR/reset.seg -echo "exit" >> $BINDIR/reset.seg - -# reset the board -JLinkExe -device CC2538SF53 < $BINDIR/reset.seg -echo "" diff --git a/boards/pca10000/Makefile.include b/boards/pca10000/Makefile.include index a596a23c7c17592d0bb9eb517853346b12e344d4..a2fb34f60f5a4c427442e306dd5a9fa7fb778e4c 100644 --- a/boards/pca10000/Makefile.include +++ b/boards/pca10000/Makefile.include @@ -6,18 +6,10 @@ export CPU_MODEL = nrf51x22xxaa 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 +export JLINK_PRE_FLASH := w4 4001e504 1 +include $(RIOTBOARD)/Makefile.include.jlink # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/pca10000/dist/debug.sh b/boards/pca10000/dist/debug.sh deleted file mode 100755 index 24bdbae0f64f06cfd0aec7ab536f4e8d6a901a0a..0000000000000000000000000000000000000000 --- a/boards/pca10000/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 <hauke.petersen@fu-berlin.de> - -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/pca10000/dist/flash.sh b/boards/pca10000/dist/flash.sh deleted file mode 100755 index 0f4bbb33c7d77f6e738c07b3e817b2f7c37e3177..0000000000000000000000000000000000000000 --- a/boards/pca10000/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 <timo.ziegler@fu-berlin.de> -# @author Hauke Petersen <hauke.petersen@fu-berlin.de> - -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/pca10000/dist/reset.sh b/boards/pca10000/dist/reset.sh deleted file mode 100755 index 509f127ea42beeaaf2e4316ab5e76e7be5e408a7..0000000000000000000000000000000000000000 --- a/boards/pca10000/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 <hauke.petersen@fu-berlin.de> - -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 diff --git a/boards/pca10005/Makefile.include b/boards/pca10005/Makefile.include index 6fcf0d217d2618db2d1feb155898ec3279da263a..ee3ebaa2355fdcaafec9fa2fe9995db11fe97f03 100644 --- a/boards/pca10005/Makefile.include +++ b/boards/pca10005/Makefile.include @@ -6,18 +6,10 @@ export CPU_MODEL = nrf51x22xxaa PORT_LINUX ?= /dev/ttyUSB0 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 +export JLINK_PRE_FLASH := w4 4001e504 1 +include $(RIOTBOARD)/Makefile.include.jlink # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/pca10005/dist/debug.sh b/boards/pca10005/dist/debug.sh deleted file mode 100755 index 24bdbae0f64f06cfd0aec7ab536f4e8d6a901a0a..0000000000000000000000000000000000000000 --- a/boards/pca10005/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 <hauke.petersen@fu-berlin.de> - -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/pca10005/dist/flash.sh b/boards/pca10005/dist/flash.sh deleted file mode 100755 index 0f4bbb33c7d77f6e738c07b3e817b2f7c37e3177..0000000000000000000000000000000000000000 --- a/boards/pca10005/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 <timo.ziegler@fu-berlin.de> -# @author Hauke Petersen <hauke.petersen@fu-berlin.de> - -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/pca10005/dist/reset.sh b/boards/pca10005/dist/reset.sh deleted file mode 100755 index 509f127ea42beeaaf2e4316ab5e76e7be5e408a7..0000000000000000000000000000000000000000 --- a/boards/pca10005/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 <hauke.petersen@fu-berlin.de> - -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 diff --git a/dist/tools/jlink/jlink.sh b/dist/tools/jlink/jlink.sh index 7256f85789a02c2475c83fcc36821d36b3c097c6..00c8b697e620c4fa92b103ad4334f5057a998c2f 100755 --- a/dist/tools/jlink/jlink.sh +++ b/dist/tools/jlink/jlink.sh @@ -132,7 +132,7 @@ do_flash() { /bin/echo -n "" > ${BINDIR}/burn.seg # create temporary burn file if [ ! -z "${JLINK_PRE_FLASH}" ]; then - echo "${JLINK_PRE_FLASH}" >> ${BINDIR}/burn.segg + echo "${JLINK_PRE_FLASH}" >> ${BINDIR}/burn.seg fi echo "loadbin ${HEXFILE} ${JLINK_FLASH_ADDR}" >> ${BINDIR}/burn.seg if [ ! -z "${JLINK_POST_FLASH}" ]; then