Skip to content
Snippets Groups Projects
Commit 0200db5e authored by Hauke Petersen's avatar Hauke Petersen
Browse files

Merge pull request #1590 from haukepetersen/fix_nrf_maketargets

board/pca10000: added make targets
parents 8147216d 46a791fd
No related branches found
No related tags found
No related merge requests found
......@@ -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
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)
......
#!/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
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
#!/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
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment