board/yunjia-nrf51822: use unified openocd script
This commit is contained in:
parent
d973729e13
commit
95bf4e2f94
@ -23,11 +23,12 @@ export AS = $(PREFIX)as
|
|||||||
export LINK = $(PREFIX)gcc
|
export LINK = $(PREFIX)gcc
|
||||||
export SIZE = $(PREFIX)size
|
export SIZE = $(PREFIX)size
|
||||||
export OBJCOPY = $(PREFIX)objcopy
|
export OBJCOPY = $(PREFIX)objcopy
|
||||||
|
export DBG = $(PREFIX)gdb
|
||||||
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
|
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
|
||||||
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
|
export FLASHER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||||
export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
|
export DEBUGGER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||||
export DEBUGSERVER = $(RIOTBOARD)/$(BOARD)/dist/debug-server.sh
|
export DEBUGSERVER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||||
export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
export RESET = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||||
|
|
||||||
# define build specific options
|
# define build specific options
|
||||||
CPU_USAGE = -mcpu=cortex-m0
|
CPU_USAGE = -mcpu=cortex-m0
|
||||||
@ -38,11 +39,12 @@ export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian
|
|||||||
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mno-thumb-interwork -nostartfiles
|
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mno-thumb-interwork -nostartfiles
|
||||||
# $(LINKERSCRIPT) is specified in cpu/Makefile.include
|
# $(LINKERSCRIPT) is specified in cpu/Makefile.include
|
||||||
export LINKFLAGS += -T$(LINKERSCRIPT)
|
export LINKFLAGS += -T$(LINKERSCRIPT)
|
||||||
export OFLAGS = -O binary
|
export OFLAGS = -O ihex
|
||||||
export HEXFILE = $(ELFFILE:.elf=.bin)
|
|
||||||
export TERMFLAGS += -p "$(PORT)"
|
export TERMFLAGS += -p "$(PORT)"
|
||||||
export FFLAGS = $(HEXFILE)
|
export FFLAGS = flash
|
||||||
export DEBUGGER_FLAGS = $(ELFFILE)
|
export DEBUGGER_FLAGS = debug
|
||||||
|
export DEBUGSERVER_FLAGS = debug-server
|
||||||
|
export RESET_FLAGS = reset
|
||||||
|
|
||||||
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
||||||
export CXXUWFLAGS +=
|
export CXXUWFLAGS +=
|
||||||
|
|||||||
17
boards/yunjia-nrf51822/dist/debug-server.sh
vendored
17
boards/yunjia-nrf51822/dist/debug-server.sh
vendored
@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ -L "$0" ]; then
|
|
||||||
FILE=$(readlink "$0")
|
|
||||||
else
|
|
||||||
FILE="$0"
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_FOLDER=$(dirname "${FILE}")
|
|
||||||
|
|
||||||
echo "##"
|
|
||||||
echo "## Starting debug server"
|
|
||||||
echo "##"
|
|
||||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
|
||||||
-c "init" \
|
|
||||||
-c "targets" \
|
|
||||||
-c "reset halt" \
|
|
||||||
19
boards/yunjia-nrf51822/dist/debug.sh
vendored
19
boards/yunjia-nrf51822/dist/debug.sh
vendored
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ ! -f "$1" ]; then
|
|
||||||
echo "ELF-file $1 does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -L "$0" ]; then
|
|
||||||
FILE=$(readlink "$0")
|
|
||||||
else
|
|
||||||
FILE="$0"
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_FOLDER=$(dirname "${FILE}")
|
|
||||||
|
|
||||||
echo "##"
|
|
||||||
echo "## Debugging $1"
|
|
||||||
echo "##"
|
|
||||||
arm-none-eabi-gdb -tui -command="${BIN_FOLDER}/gdb.cfg" $1
|
|
||||||
27
boards/yunjia-nrf51822/dist/flash.sh
vendored
27
boards/yunjia-nrf51822/dist/flash.sh
vendored
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ ! -f "$1" ]; then
|
|
||||||
echo "Binary file $1 does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -L "$0" ]; then
|
|
||||||
FILE=$(readlink "$0")
|
|
||||||
else
|
|
||||||
FILE="$0"
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_FOLDER=$(dirname "${FILE}")
|
|
||||||
|
|
||||||
echo "##"
|
|
||||||
echo "## Flashing $1"
|
|
||||||
echo "##"
|
|
||||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
|
||||||
-c "init" \
|
|
||||||
-c "targets" \
|
|
||||||
-c "flash banks" \
|
|
||||||
-c "reset halt" \
|
|
||||||
-c "flash write_image erase $1 0" \
|
|
||||||
-c "verify_image $1" \
|
|
||||||
-c "reset run"\
|
|
||||||
-c "shutdown"
|
|
||||||
1
boards/yunjia-nrf51822/dist/gdb.cfg
vendored
1
boards/yunjia-nrf51822/dist/gdb.cfg
vendored
@ -1 +0,0 @@
|
|||||||
target extended-remote 127.0.0.1:3333
|
|
||||||
5
boards/yunjia-nrf51822/dist/openocd.cfg
vendored
5
boards/yunjia-nrf51822/dist/openocd.cfg
vendored
@ -1,10 +1,5 @@
|
|||||||
# nRF51822 Target
|
|
||||||
source [find interface/stlink-v2.cfg]
|
source [find interface/stlink-v2.cfg]
|
||||||
|
|
||||||
transport select hla_swd
|
transport select hla_swd
|
||||||
|
|
||||||
set WORKAREASIZE 0x4000
|
set WORKAREASIZE 0x4000
|
||||||
source [find target/nrf51.cfg]
|
source [find target/nrf51.cfg]
|
||||||
|
|
||||||
# use hardware reset, connect under reset
|
|
||||||
#reset_config srst_only srst_nogate
|
|
||||||
|
|||||||
17
boards/yunjia-nrf51822/dist/reset.sh
vendored
17
boards/yunjia-nrf51822/dist/reset.sh
vendored
@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ -L "$0" ]; then
|
|
||||||
FILE=$(readlink "$0")
|
|
||||||
else
|
|
||||||
FILE="$0"
|
|
||||||
fi
|
|
||||||
|
|
||||||
BIN_FOLDER=$(dirname "${FILE}")
|
|
||||||
|
|
||||||
echo "##"
|
|
||||||
echo "## Resetting $BOARD"
|
|
||||||
echo "##"
|
|
||||||
openocd -f "${BIN_FOLDER}/openocd.cfg" \
|
|
||||||
-c "init" \
|
|
||||||
-c "reset run" \
|
|
||||||
-c "shutdown"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user