From 8cba8bdb1675b88edc345f57c4c03c9a8ad06571 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Sun, 19 Jan 2020 20:22:01 +0100 Subject: [PATCH 1/3] makefiles/tools/openocd-adapters: add iotlab-usb --- makefiles/tools/openocd-adapters/iotlab.inc.mk | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 makefiles/tools/openocd-adapters/iotlab.inc.mk diff --git a/makefiles/tools/openocd-adapters/iotlab.inc.mk b/makefiles/tools/openocd-adapters/iotlab.inc.mk new file mode 100644 index 0000000000..f5d6e84cbf --- /dev/null +++ b/makefiles/tools/openocd-adapters/iotlab.inc.mk @@ -0,0 +1,8 @@ +# iotlab-usb debug adapter +OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/ftdi/iotlab-usb.cfg]' + +# Add serial matching command, only if DEBUG_ADAPTER_ID was specified +ifneq (,$(DEBUG_ADAPTER_ID)) + OPENOCD_ADAPTER_INIT += -c 'ftdi_serial $(DEBUG_ADAPTER_ID)' +endif +export OPENOCD_ADAPTER_INIT From f79397f7be0bec463c3c44956ab8153e490cbaae Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Tue, 28 Jan 2020 11:52:37 +0100 Subject: [PATCH 2/3] boards/iotlab-%: use common openocd config --- boards/common/iotlab/Makefile.include | 2 ++ boards/{iotlab-a8-m3 => common/iotlab}/dist/openocd.cfg | 0 boards/iotlab-m3/dist/openocd.cfg | 7 ------- 3 files changed, 2 insertions(+), 7 deletions(-) rename boards/{iotlab-a8-m3 => common/iotlab}/dist/openocd.cfg (100%) delete mode 100644 boards/iotlab-m3/dist/openocd.cfg diff --git a/boards/common/iotlab/Makefile.include b/boards/common/iotlab/Makefile.include index 7dc738d8fd..9af1e88235 100644 --- a/boards/common/iotlab/Makefile.include +++ b/boards/common/iotlab/Makefile.include @@ -9,6 +9,8 @@ include $(RIOTMAKE)/tools/serial.inc.mk # Using connect_assert_srst removes errors on flash from invalid state export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 +export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/iotlab/dist/openocd.cfg + # this board uses openocd include $(RIOTMAKE)/tools/openocd.inc.mk diff --git a/boards/iotlab-a8-m3/dist/openocd.cfg b/boards/common/iotlab/dist/openocd.cfg similarity index 100% rename from boards/iotlab-a8-m3/dist/openocd.cfg rename to boards/common/iotlab/dist/openocd.cfg diff --git a/boards/iotlab-m3/dist/openocd.cfg b/boards/iotlab-m3/dist/openocd.cfg deleted file mode 100644 index 13970b67ca..0000000000 --- a/boards/iotlab-m3/dist/openocd.cfg +++ /dev/null @@ -1,7 +0,0 @@ -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 -reset_config trst_and_srst - -$_TARGETNAME configure -rtos auto From 94853d5e1dcad9c34a8978b699c45f07b0e3ff03 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Tue, 28 Jan 2020 11:56:56 +0100 Subject: [PATCH 3/3] boards/iotlab-%: define DEBUG_ADAPTER --- boards/common/iotlab/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/common/iotlab/Makefile.include b/boards/common/iotlab/Makefile.include index 9af1e88235..fba8ff326e 100644 --- a/boards/common/iotlab/Makefile.include +++ b/boards/common/iotlab/Makefile.include @@ -9,6 +9,8 @@ include $(RIOTMAKE)/tools/serial.inc.mk # Using connect_assert_srst removes errors on flash from invalid state export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST ?= 1 +DEBUG_ADAPTER ?= iotlab + export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/iotlab/dist/openocd.cfg # this board uses openocd