1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 14:03:55 +01:00

board/pca1000x: added/fixed dist scripts

- pca10000: added author to debug.sh
- pca10005: added debug and reset scripts
- pca10005: fixed flash script
- pca10005: adjusted env vars in Makefile.include
This commit is contained in:
Hauke Petersen 2014-08-27 15:15:20 +02:00
parent 9745a78c02
commit f4c68cf466
5 changed files with 53 additions and 24 deletions

View File

@ -5,6 +5,8 @@
#
# Start the GDB server first using the 'make debugserver' target
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
BINDIR=$1
ELFFILE=$2

View File

@ -23,8 +23,10 @@ export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh $(BINDIR) $(RIOTBASE) $(APPLICATION) $(BOARD)
export HEXFILE = $(ELFFILE:.elf=.bin)
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
# define build specific options
CPU_USAGE = -mcpu=cortex-m0
@ -36,7 +38,11 @@ export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endi
# $(LINKERSCRIPT) is specified in cpu/Makefile.include
export LINKFLAGS += -T$(LINKERSCRIPT)
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)
# use the nano-specs of the NewLib when available
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)

17
boards/pca10005/dist/debug.sh vendored Executable file
View File

@ -0,0 +1,17 @@
#!/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

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/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).
@ -6,34 +6,20 @@
# latest .bin file to the board.
# @author Timo Ziegler <timo.ziegler@fu-berlin.de>
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
BINDIR=$1
RIOTBASE=$2
APPLICATION=$3
BOARD=$4
HEXFILE=$2
if [[ $APPLICATION == test_* ]]
then
TYPE=tests
else
TYPE=examples
fi
echo "log /dev/null" > $BINDIR/burn.seg
echo "device nrf51822" >> $BINDIR/burn.seg
# 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 $RIOTBASE/$TYPE/$APPLICATION/bin/$BOARD/$APPLICATION.bin 0" >> $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
if [ -f JLink.log ]
then
rm JLink.log
fi
if [ -f ~/JLink.log ]
then
rm ~/JLink.log
fi

18
boards/pca10005/dist/reset.sh vendored Executable file
View File

@ -0,0 +1,18 @@
#!/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