From c1b32fe1f333e5cb04e0bd111bb6521d115db935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 2 Sep 2019 16:12:55 +0200 Subject: [PATCH] boards/iotlab: rely on OPENOCD_RESET_USE_CONNECT_ASSERT_SRST Use the new OPENOCD_RESET_USE_CONNECT_ASSERT_SRST to configure 'reset_config connect_assert_srst' when flashing and resetting only. This removes the need for a special debug configuration and should allow connecting to a running target again. --- boards/common/iotlab/Makefile.include | 5 ++--- boards/iotlab-a8-m3/dist/openocd.cfg | 3 +-- boards/iotlab-m3/dist/openocd.cfg | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/boards/common/iotlab/Makefile.include b/boards/common/iotlab/Makefile.include index 155c5b74df..7dc738d8fd 100644 --- a/boards/common/iotlab/Makefile.include +++ b/boards/common/iotlab/Makefile.include @@ -6,9 +6,8 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*B))) export BAUD = 500000 include $(RIOTMAKE)/tools/serial.inc.mk -# call a 'reset halt' command before starting the debugger -# it is required as `connect_assert_srst` is set -export OPENOCD_DBG_START_CMD = -c 'reset halt' +# Using connect_assert_srst removes errors on flash from invalid state +export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 # this board uses openocd include $(RIOTMAKE)/tools/openocd.inc.mk diff --git a/boards/iotlab-a8-m3/dist/openocd.cfg b/boards/iotlab-a8-m3/dist/openocd.cfg index 0b9d3c7900..13970b67ca 100644 --- a/boards/iotlab-a8-m3/dist/openocd.cfg +++ b/boards/iotlab-a8-m3/dist/openocd.cfg @@ -2,7 +2,6 @@ source [find interface/ftdi/iotlab-usb.cfg] source [find target/stm32f1x.cfg] # use combined on interfaces or targets that can't set TRST/SRST separately -# Using connect_assert_srst removes errors on first flash -reset_config trst_and_srst connect_assert_srst +reset_config trst_and_srst $_TARGETNAME configure -rtos auto diff --git a/boards/iotlab-m3/dist/openocd.cfg b/boards/iotlab-m3/dist/openocd.cfg index 0b9d3c7900..13970b67ca 100644 --- a/boards/iotlab-m3/dist/openocd.cfg +++ b/boards/iotlab-m3/dist/openocd.cfg @@ -2,7 +2,6 @@ source [find interface/ftdi/iotlab-usb.cfg] source [find target/stm32f1x.cfg] # use combined on interfaces or targets that can't set TRST/SRST separately -# Using connect_assert_srst removes errors on first flash -reset_config trst_and_srst connect_assert_srst +reset_config trst_and_srst $_TARGETNAME configure -rtos auto