Skip to content

Commit

Permalink
Merge pull request RIOT-OS#11976 from fjmolinas/pr_stm32f0x_extra_flash
Browse files Browse the repository at this point in the history
dist/tools/openocd: add OPENOCD_EXTRA_INIT_RESET use for nucleo-f091rc
  • Loading branch information
MrKevinWeiss authored Sep 2, 2019
2 parents f74381c + 06c830e commit d9b0db0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions boards/nucleo-f091rc/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# nucleo-f091rc can become un-flashable after a hardfault, use connect_assert_srst
# to always be able to flash or reset the board.
export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1

# load the common Makefile.include for Nucleo boards
include $(RIOTBOARD)/common/nucleo64/Makefile.include
11 changes: 10 additions & 1 deletion dist/tools/openocd/openocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
: ${OPENOCD_EXTRA_INIT:=}
# Debugger interface initialization commands to pass to OpenOCD
: ${OPENOCD_ADAPTER_INIT:=}
# If set to 1 'reset_config' will use 'connect_assert_srst' before 'flash' or 'reset.
: ${OPENOCD_RESET_USE_CONNECT_ASSERT_SRST:=}
# The setsid command is needed so that Ctrl+C in GDB doesn't kill OpenOCD
: ${SETSID:=setsid}
# GDB command, usually a separate command for each platform (e.g. arm-none-eabi-gdb)
Expand Down Expand Up @@ -106,7 +108,6 @@
#
# Examples of alternative debugger configurations
#

# Using the GDB text UI:
# DBG_EXTRA_FLAGS=-tui make debug
# or to always use TUI, put in your .profile:
Expand All @@ -119,6 +120,11 @@
# export DBG_FLAGS='--debugger "${GDB} ${DBG_DEFAULT_FLAGS}"'
# The single quotes are important on the line above, or it will not work.

# Handle OPENOCD_RESET_USE_CONNECT_ASSERT_SRST
if [ "${OPENOCD_RESET_USE_CONNECT_ASSERT_SRST}" -eq 1 ]; then
OPENOCD_EXTRA_RESET_INIT+="-c 'reset_config connect_assert_srst'"
fi

#
# a couple of tests for certain configuration options
#
Expand Down Expand Up @@ -205,6 +211,7 @@ _flash_list_raw() {
sh -c "${OPENOCD} \
${OPENOCD_ADAPTER_INIT} \
-f '${OPENOCD_CONFIG}' \
${OPENOCD_EXTRA_RESET_INIT} \
-c 'init' \
-c 'flash probe 0' \
-c 'flash list' \
Expand Down Expand Up @@ -274,6 +281,7 @@ do_flash() {
${OPENOCD_ADAPTER_INIT} \
-f '${OPENOCD_CONFIG}' \
${OPENOCD_EXTRA_INIT} \
${OPENOCD_EXTRA_RESET_INIT} \
-c 'tcl_port 0' \
-c 'telnet_port 0' \
-c 'gdb_port 0' \
Expand Down Expand Up @@ -353,6 +361,7 @@ do_reset() {
${OPENOCD_ADAPTER_INIT} \
-f '${OPENOCD_CONFIG}' \
${OPENOCD_EXTRA_INIT} \
${OPENOCD_EXTRA_RESET_INIT} \
-c 'tcl_port 0' \
-c 'telnet_port 0' \
-c 'gdb_port 0' \
Expand Down

0 comments on commit d9b0db0

Please sign in to comment.