diff --git a/makefiles/tools/openocd.inc.mk b/makefiles/tools/openocd.inc.mk index b478ab2711..62cf574da0 100644 --- a/makefiles/tools/openocd.inc.mk +++ b/makefiles/tools/openocd.inc.mk @@ -12,3 +12,9 @@ RESET_FLAGS ?= reset ifneq (,$(DEBUG_ADAPTER)) include $(RIOTMAKE)/tools/openocd-adapters/$(DEBUG_ADAPTER).inc.mk endif + +OPENOCD_CONFIG ?= $(BOARDSDIR)/$(BOARD)/dist/openocd.cfg + +# Export OPENOCD_CONFIG to required targets +OPENOCD_TARGETS = debug% flash% reset +$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_CONFIG)