board/stm32f3discovery: use unified openocd script
This commit is contained in:
parent
63f019210c
commit
03858bffe9
@ -23,10 +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 RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
export DEBUGSERVER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||||
|
export RESET = $(RIOTBASE)/dist/tools/openocd/openocd.sh
|
||||||
|
|
||||||
# define build specific options
|
# define build specific options
|
||||||
CPU_USAGE = -mcpu=cortex-m4
|
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 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
|
||||||
export LINKFLAGS += -T$(LINKERSCRIPT)
|
export LINKFLAGS += -T$(LINKERSCRIPT)
|
||||||
export OFLAGS = -O binary
|
export OFLAGS = -O ihex
|
||||||
export TERMFLAGS += -p "$(PORT)"
|
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++
|
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
|
||||||
export CXXUWFLAGS +=
|
export CXXUWFLAGS +=
|
||||||
|
|||||||
32
boards/stm32f3discovery/dist/debug.sh
vendored
32
boards/stm32f3discovery/dist/debug.sh
vendored
@ -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}
|
|
||||||
16
boards/stm32f3discovery/dist/flash.sh
vendored
16
boards/stm32f3discovery/dist/flash.sh
vendored
@ -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"
|
|
||||||
1
boards/stm32f3discovery/dist/gdb.conf
vendored
1
boards/stm32f3discovery/dist/gdb.conf
vendored
@ -1 +0,0 @@
|
|||||||
tar extended-remote :3333
|
|
||||||
1
boards/stm32f3discovery/dist/openocd.cfg
vendored
Normal file
1
boards/stm32f3discovery/dist/openocd.cfg
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
source [find board/stm32f3discovery.cfg]
|
||||||
13
boards/stm32f3discovery/dist/reset.sh
vendored
13
boards/stm32f3discovery/dist/reset.sh
vendored
@ -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"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user