diff --git a/boards/common/iotlab/Makefile.include b/boards/common/iotlab/Makefile.include index 7dc738d8fd..fba8ff326e 100644 --- a/boards/common/iotlab/Makefile.include +++ b/boards/common/iotlab/Makefile.include @@ -9,6 +9,10 @@ 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 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 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