1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/tools/dfu-util.inc.mk
Dylan Laduranty 8dac70db69 makefiles/tools/dfu-util: add option to pass DFU_SERIAL
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2022-08-29 09:39:15 +02:00

28 lines
650 B
Makefile

DFU ?= dfu-util
FLASHER ?= $(DFU)
FLASHFILE ?= $(BINFILE)
DFU_ALT ?= 0
DFU_USB_ID ?= ${USB_VID}:${USB_PID}
ROM_OFFSET ?= 0
_ROM_ADDR_WITH_OFFSET ?= $(shell printf "0x%x" $$(($(ROM_START_ADDR) + $(ROM_OFFSET))))
FLASH_ADDR ?= $(if $(ROM_OFFSET),$(_ROM_ADDR_WITH_OFFSET),$(ROM_START_ADDR))
DFU_USE_DFUSE ?= 0
# Optional flasher flags
DFU_UTIL_FLAGS_OPTS ?=
FFLAGS ?= --device $(DFU_USB_ID) \
--alt $(DFU_ALT) \
--download $(FLASHFILE) \
$(DFU_UTIL_FLAGS_OPTS)
ifeq ($(DFU_USE_DFUSE),1)
FFLAGS += --dfuse-address $(FLASH_ADDR):leave
endif
ifneq (,$(DEBUG_ADAPTER_ID))
FFLAGS += --serial $(DEBUG_ADAPTER_ID)
endif