diff --git a/Makefile.include b/Makefile.include index 055968e430..546b8485cb 100644 --- a/Makefile.include +++ b/Makefile.include @@ -461,6 +461,11 @@ else include $(RIOTMAKE)/dependency_resolution.inc.mk endif +# Include dfu-util configuration when using riotboot_dfu bootloader before +# including the board's Makefile.include which could define dfu-util +# configuration for other DFU bootloaders in use. +include $(RIOTMAKE)/boot/riotboot_dfu-util.mk + # Include Board and CPU configuration INCLUDES += $(addprefix -I,$(wildcard $(BOARDDIR)/include)) include $(BOARDDIR)/Makefile.include diff --git a/makefiles/boot/riotboot_dfu-util.mk b/makefiles/boot/riotboot_dfu-util.mk new file mode 100644 index 0000000000..457fe53a80 --- /dev/null +++ b/makefiles/boot/riotboot_dfu-util.mk @@ -0,0 +1,10 @@ +ifneq (,$(filter usbus_dfu,$(USEMODULE))) + ifeq (,$(filter riotboot_usb_dfu,$(USEMODULE))) + # If module usbus_dfu is used but not module riotboot_usb_dfu, the + # application uses DFU Runtime and dfu-util as programmer to flash the + # application with the bootloader riotboot_dfu which uses the VID/PID pair + # allocated for the RIOT bootloader https://pid.codes/1209/7D02/ + DFU_USB_ID ?= 1209:7d02 + DFU_USE_DFUSE ?= 0 + endif +endif