diff --git a/boards/stm32f3discovery/Makefile.include b/boards/stm32f3discovery/Makefile.include index 99dedb2862..6f4f1eab3e 100644 --- a/boards/stm32f3discovery/Makefile.include +++ b/boards/stm32f3discovery/Makefile.include @@ -23,10 +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 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-m4 @@ -36,8 +38,12 @@ export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin 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 += -T$(LINKERSCRIPT) -export OFLAGS = -O binary +export OFLAGS = -O ihex export TERMFLAGS += -p "$(PORT)" +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/stm32f3discovery/dist/debug.sh b/boards/stm32f3discovery/dist/debug.sh deleted file mode 100755 index 3676c42e13..0000000000 --- a/boards/stm32f3discovery/dist/debug.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -echo "##" -echo "## Debugging ${ELFFILE}" -echo "##" - -# if GDB_PORT does not exist or holds empty string -if [ -z ${GDB_PORT} ]; then - # set to gdb standard port - GDB_PORT=3333 -else - echo "Listening for GDB connection on port ${GDB_PORT}" -fi - -openocd -f "board/stm32f3discovery.cfg" \ - -c "tcl_port 6333" \ - -c "telnet_port 4444" \ - -c "gdb_port ${GDB_PORT}" \ - -c "init" \ - -c "targets" \ - -c "reset halt" \ - -l /dev/null & - -# save pid to terminate afterwards -OCD_PID=$? - -# needed for openocd to set up -sleep 2 - -arm-none-eabi-gdb -tui -command=${RIOTBOARD}/${BOARD}/dist/gdb.conf ${ELFFILE} - -kill ${OCD_PID} diff --git a/boards/stm32f3discovery/dist/flash.sh b/boards/stm32f3discovery/dist/flash.sh deleted file mode 100755 index 1566648460..0000000000 --- a/boards/stm32f3discovery/dist/flash.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -echo "##" -echo "## Flashing ${HEXFILE}" -echo "##" - -openocd -f "board/stm32f3discovery.cfg" \ - -c "tcl_port 0" \ - -c "telnet_port 0" \ - -c "gdb_port 0" \ - -c "init" \ - -c "targets" \ - -c "reset halt" \ - -c "program ${HEXFILE} 0x08000000 verify" \ - -c "reset run"\ - -c "shutdown" diff --git a/boards/stm32f3discovery/dist/gdb.conf b/boards/stm32f3discovery/dist/gdb.conf deleted file mode 100644 index ba7908fdf3..0000000000 --- a/boards/stm32f3discovery/dist/gdb.conf +++ /dev/null @@ -1 +0,0 @@ -tar extended-remote :3333 diff --git a/boards/stm32f3discovery/dist/openocd.cfg b/boards/stm32f3discovery/dist/openocd.cfg new file mode 100644 index 0000000000..f032f7a0c3 --- /dev/null +++ b/boards/stm32f3discovery/dist/openocd.cfg @@ -0,0 +1 @@ +source [find board/stm32f3discovery.cfg] diff --git a/boards/stm32f3discovery/dist/reset.sh b/boards/stm32f3discovery/dist/reset.sh deleted file mode 100755 index b47fa81fa6..0000000000 --- a/boards/stm32f3discovery/dist/reset.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -echo "##" -echo "## Resetting ${BOARD}" -echo "##" - -openocd -f "board/stm32f3discovery.cfg" \ - -c "tcl_port 0" \ - -c "telnet_port 0" \ - -c "gdb_port 0" \ - -c "init" \ - -c "reset run"\ - -c "shutdown"