mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #4904 from haukepetersen/opt_nrf51dongle_jlink
boards/nrf51dongle: use global JLink script
This commit is contained in:
commit
fde38f0158
@ -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
|
||||
|
17
boards/nrf51dongle/dist/debug.sh
vendored
17
boards/nrf51dongle/dist/debug.sh
vendored
@ -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
|
25
boards/nrf51dongle/dist/flash.sh
vendored
25
boards/nrf51dongle/dist/flash.sh
vendored
@ -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
|
18
boards/nrf51dongle/dist/reset.sh
vendored
18
boards/nrf51dongle/dist/reset.sh
vendored
@ -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
|
Loading…
Reference in New Issue
Block a user