diff --git a/makefiles/boards/sam0.inc.mk b/makefiles/boards/sam0.inc.mk index fec2026a48..debdebe33d 100644 --- a/makefiles/boards/sam0.inc.mk +++ b/makefiles/boards/sam0.inc.mk @@ -41,10 +41,3 @@ ifeq ($(PROGRAMMER),) PROGRAMMER ?= openocd endif endif - -ifeq ($(PROGRAMMER),edbg) - # use edbg for flashing. must be included before openocd - include $(RIOTMAKE)/tools/edbg.inc.mk - # use openocd for debugging - include $(RIOTMAKE)/tools/openocd.inc.mk -endif diff --git a/makefiles/tools/edbg.inc.mk b/makefiles/tools/edbg.inc.mk index 472146567e..2fe20b1084 100644 --- a/makefiles/tools/edbg.inc.mk +++ b/makefiles/tools/edbg.inc.mk @@ -31,3 +31,7 @@ define edbg-flash-recipe endef flash-recipe = $(edbg-flash-recipe) + +# use openocd for debugging, must be included at the end so FLASHER/RESET +# variables are already set for edbg. +include $(RIOTMAKE)/tools/openocd.inc.mk