From c737bacace3cc545e4368eb70f2aacc33c4b7a92 Mon Sep 17 00:00:00 2001 From: haukepetersen Date: Sun, 8 Feb 2015 14:43:51 +0100 Subject: [PATCH] board/airfy-beacon: use unified openocd script --- boards/airfy-beacon/Makefile.include | 18 +++++++++------- boards/airfy-beacon/dist/debug-server.sh | 17 --------------- boards/airfy-beacon/dist/debug.sh | 19 ----------------- boards/airfy-beacon/dist/flash.sh | 27 ------------------------ boards/airfy-beacon/dist/gdb.cfg | 1 - boards/airfy-beacon/dist/openocd.cfg | 5 ----- boards/airfy-beacon/dist/reset.sh | 17 --------------- 7 files changed, 10 insertions(+), 94 deletions(-) delete mode 100755 boards/airfy-beacon/dist/debug-server.sh delete mode 100755 boards/airfy-beacon/dist/debug.sh delete mode 100755 boards/airfy-beacon/dist/flash.sh delete mode 100644 boards/airfy-beacon/dist/gdb.cfg delete mode 100755 boards/airfy-beacon/dist/reset.sh diff --git a/boards/airfy-beacon/Makefile.include b/boards/airfy-beacon/Makefile.include index f31527fe65..afdf74e411 100644 --- a/boards/airfy-beacon/Makefile.include +++ b/boards/airfy-beacon/Makefile.include @@ -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 += diff --git a/boards/airfy-beacon/dist/debug-server.sh b/boards/airfy-beacon/dist/debug-server.sh deleted file mode 100755 index b61c5bdd8b..0000000000 --- a/boards/airfy-beacon/dist/debug-server.sh +++ /dev/null @@ -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" \ diff --git a/boards/airfy-beacon/dist/debug.sh b/boards/airfy-beacon/dist/debug.sh deleted file mode 100755 index a73beba147..0000000000 --- a/boards/airfy-beacon/dist/debug.sh +++ /dev/null @@ -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 diff --git a/boards/airfy-beacon/dist/flash.sh b/boards/airfy-beacon/dist/flash.sh deleted file mode 100755 index 89469bf31a..0000000000 --- a/boards/airfy-beacon/dist/flash.sh +++ /dev/null @@ -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" diff --git a/boards/airfy-beacon/dist/gdb.cfg b/boards/airfy-beacon/dist/gdb.cfg deleted file mode 100644 index 900a550d05..0000000000 --- a/boards/airfy-beacon/dist/gdb.cfg +++ /dev/null @@ -1 +0,0 @@ -target extended-remote 127.0.0.1:3333 diff --git a/boards/airfy-beacon/dist/openocd.cfg b/boards/airfy-beacon/dist/openocd.cfg index 57be9b31a7..111ca5e773 100644 --- a/boards/airfy-beacon/dist/openocd.cfg +++ b/boards/airfy-beacon/dist/openocd.cfg @@ -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 diff --git a/boards/airfy-beacon/dist/reset.sh b/boards/airfy-beacon/dist/reset.sh deleted file mode 100755 index daa5a334f3..0000000000 --- a/boards/airfy-beacon/dist/reset.sh +++ /dev/null @@ -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"