mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
board/airfy-beacon: use unified openocd script
This commit is contained in:
parent
f334a8b317
commit
c737bacace
@ -23,11 +23,12 @@ export AS = $(PREFIX)as
|
||||
export LINK = $(PREFIX)gcc
|
||||
export SIZE = $(PREFIX)size
|
||||
export OBJCOPY = $(PREFIX)objcopy
|
||||
export DBG = $(PREFIX)gdb
|
||||
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm
|
||||
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
|
||||
export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
|
||||
export DEBUGSERVER = $(RIOTBOARD)/$(BOARD)/dist/debug-server.sh
|
||||
export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
||||
export FLASHER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||
export DEBUGGER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||
export DEBUGSERVER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||
export RESET = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||
|
||||
# define build specific options
|
||||
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
|
||||
# $(LINKERSCRIPT) is specified in cpu/Makefile.include
|
||||
export LINKFLAGS += -T$(LINKERSCRIPT)
|
||||
export OFLAGS = -O binary
|
||||
export HEXFILE = $(ELFFILE:.elf=.bin)
|
||||
export OFLAGS = -O ihex
|
||||
export TERMFLAGS += -p "$(PORT)"
|
||||
export FFLAGS = $(HEXFILE)
|
||||
export DEBUGGER_FLAGS = $(ELFFILE)
|
||||
export FFLAGS = flash
|
||||
export DEBUGGER_FLAGS = debug
|
||||
export DEBUGSERVER_FLAGS = debug-server
|
||||
export RESET_FLAGS = reset
|
||||
|
||||
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
||||
export CXXUWFLAGS +=
|
||||
|
17
boards/airfy-beacon/dist/debug-server.sh
vendored
17
boards/airfy-beacon/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/airfy-beacon/dist/debug.sh
vendored
19
boards/airfy-beacon/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/airfy-beacon/dist/flash.sh
vendored
27
boards/airfy-beacon/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 "halt" \
|
||||
-c "flash banks" \
|
||||
-c "flash write_image erase $1 0" \
|
||||
-c "verify_image $1" \
|
||||
-c "reset run"\
|
||||
-c "shutdown"
|
1
boards/airfy-beacon/dist/gdb.cfg
vendored
1
boards/airfy-beacon/dist/gdb.cfg
vendored
@ -1 +0,0 @@
|
||||
target extended-remote 127.0.0.1:3333
|
5
boards/airfy-beacon/dist/openocd.cfg
vendored
5
boards/airfy-beacon/dist/openocd.cfg
vendored
@ -1,10 +1,5 @@
|
||||
# nRF51822 Target
|
||||
source [find interface/stlink-v2.cfg]
|
||||
|
||||
transport select hla_swd
|
||||
|
||||
set WORKAREASIZE 0x4000
|
||||
source [find target/nrf51.cfg]
|
||||
|
||||
# use hardware reset, connect under reset
|
||||
#reset_config srst_only srst_nogate
|
||||
|
17
boards/airfy-beacon/dist/reset.sh
vendored
17
boards/airfy-beacon/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…
Reference in New Issue
Block a user