2014-10-30 19:43:39 +01:00
|
|
|
#!/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
|
2018-10-11 17:43:26 +02:00
|
|
|
BINFILE=$2
|
2014-10-30 19:43:39 +01:00
|
|
|
FLASHADDR=200000
|
|
|
|
|
|
|
|
# setup JLink command file
|
2016-02-04 04:44:21 +01:00
|
|
|
echo "speed 1000" > $BINDIR/burn.seg
|
2018-10-11 17:43:26 +02:00
|
|
|
echo "loadbin $BINFILE $FLASHADDR" >> $BINDIR/burn.seg
|
2014-10-30 19:43:39 +01:00
|
|
|
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 ""
|