1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tools/openocd: add OPENOCD_DBG_EXTRA_CMD

This commit is contained in:
Koen Zandberg 2020-02-09 12:45:29 +01:00
parent bdeec688f5
commit aff18b9599
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
2 changed files with 10 additions and 0 deletions

View File

@ -96,6 +96,8 @@
# the target when starting a debug session. 'reset halt' can also be used
# depending on the type of target.
: ${OPENOCD_DBG_START_CMD:=-c 'halt'}
# Extra commands to add when using debug
: ${OPENOCD_DBG_EXTRA_CMD:=}
# command used to reset the board
: ${OPENOCD_CMD_RESET_RUN:="-c 'reset run'"}
# This is an optional offset to the base address that can be used to flash an
@ -329,6 +331,7 @@ do_debug() {
-c 'telnet_port ${TELNET_PORT}' \
-c 'gdb_port ${GDB_PORT}' \
-c 'init' \
${OPENOCD_DBG_EXTRA_CMD} \
-c 'targets' \
${OPENOCD_DBG_START_CMD} \
-l /dev/null & \
@ -356,6 +359,7 @@ do_debugserver() {
-c 'telnet_port ${TELNET_PORT}' \
-c 'gdb_port ${GDB_PORT}' \
-c 'init' \
${OPENOCD_DBG_EXTRA_CMD} \
-c 'targets' \
-c 'halt'"
}

View File

@ -29,4 +29,10 @@ else ifeq ($(RIOT_TERMINAL),miniterm)
else ifeq ($(RIOT_TERMINAL),jlink)
TERMPROG = $(RIOTTOOLS)/jlink/jlink.sh
TERMFLAGS = term-rtt
else ifeq ($(RIOT_TERMINAL),semihosting)
TERMPROG = $(DEBUGGER)
TERMFLAGS = $(DEBUGGER_FLAGS)
OPENOCD_DBG_EXTRA_CMD += -c 'arm semihosting enable'
OPENOCD_DBG_EXTRA_CMD += -c 'set remotetimeout 10000'
$(call target-export-variables,term cleanterm,OPENOCD_DBG_EXTRA_CMD)
endif