board/stm32f3discovery: use unified openocd script

This commit is contained in:
haukepetersen 2015-02-08 14:07:09 +01:00 committed by Hauke Petersen
parent 63f019210c
commit 03858bffe9
6 changed files with 11 additions and 66 deletions

View File

@ -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 +=

View File

@ -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}

View File

@ -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"

View File

@ -1 +0,0 @@
tar extended-remote :3333

View File

@ -0,0 +1 @@
source [find board/stm32f3discovery.cfg]

View File

@ -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"