mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #8856 from aabadie/pr/openocd_debug_reset
dist/tools/openocd: add the possibility to do a reset before halt in openocd debug command
This commit is contained in:
commit
4e872e61c0
@ -12,5 +12,8 @@ include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
export DEBUG_ADAPTER ?= stlink
|
||||
export STLINK_VERSION ?= 2-1
|
||||
|
||||
# call a 'reset halt' command before starting the debugger
|
||||
export OPENOCD_DBG_START_CMD = -c 'reset halt'
|
||||
|
||||
# this board uses openocd
|
||||
include $(RIOTMAKE)/tools/openocd.inc.mk
|
||||
|
6
dist/tools/openocd/openocd.sh
vendored
6
dist/tools/openocd/openocd.sh
vendored
@ -83,6 +83,10 @@
|
||||
# Debugger flags, will be passed to sh -c, remember to escape any quotation signs.
|
||||
# Use ${DBG_DEFAULT_FLAGS} to insert the default flags anywhere in the string
|
||||
: ${DBG_FLAGS:=${DBG_DEFAULT_FLAGS} ${DBG_EXTRA_FLAGS}}
|
||||
# Initial target state when using debug, by default a 'halt' request is sent to
|
||||
# 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'}
|
||||
# This is an optional offset to the base address that can be used to flash an
|
||||
# image in a different location than it is linked at. This feature can be useful
|
||||
# when flashing images for firmware swapping/remapping boot loaders.
|
||||
@ -201,7 +205,7 @@ do_debug() {
|
||||
-c 'gdb_port ${GDB_PORT}' \
|
||||
-c 'init' \
|
||||
-c 'targets' \
|
||||
-c 'halt' \
|
||||
${OPENOCD_DBG_START_CMD} \
|
||||
-l /dev/null & \
|
||||
echo \$! > $OCD_PIDFILE" &
|
||||
# Export to be able to access these from the sh -c command lines, may be
|
||||
|
Loading…
Reference in New Issue
Block a user