2019-02-28 13:47:19 +01:00
|
|
|
DFU ?= dfu-util
|
|
|
|
FLASHER ?= $(DFU)
|
2019-06-14 16:05:53 +02:00
|
|
|
FLASHFILE ?= $(BINFILE)
|
2019-02-28 13:47:19 +01:00
|
|
|
|
2019-03-28 12:46:15 +01:00
|
|
|
DFU_ALT ?= 0
|
2020-12-15 17:17:44 +01:00
|
|
|
DFU_USB_ID ?= ${USB_VID}:${USB_PID}
|
2019-03-28 12:46:15 +01:00
|
|
|
ROM_OFFSET ?= 0
|
2019-02-28 13:47:19 +01:00
|
|
|
|
2019-03-28 12:46:15 +01:00
|
|
|
_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))
|
2020-12-09 11:49:57 +01:00
|
|
|
DFU_USE_DFUSE ?= 0
|
2021-02-23 15:29:08 +01:00
|
|
|
|
2019-03-28 12:46:15 +01:00
|
|
|
# Optional flasher flags
|
2021-02-18 17:53:43 +01:00
|
|
|
DFU_UTIL_FLAGS_OPTS ?=
|
2019-03-28 12:46:15 +01:00
|
|
|
|
|
|
|
FFLAGS ?= --device $(DFU_USB_ID) \
|
|
|
|
--alt $(DFU_ALT) \
|
|
|
|
--download $(FLASHFILE) \
|
2021-02-18 17:53:43 +01:00
|
|
|
$(DFU_UTIL_FLAGS_OPTS)
|
2020-12-09 11:49:57 +01:00
|
|
|
|
|
|
|
ifeq ($(DFU_USE_DFUSE),1)
|
|
|
|
FFLAGS += --dfuse-address $(FLASH_ADDR):leave
|
|
|
|
endif
|
2022-08-27 22:37:44 +02:00
|
|
|
|
|
|
|
ifneq (,$(DEBUG_ADAPTER_ID))
|
|
|
|
FFLAGS += --serial $(DEBUG_ADAPTER_ID)
|
|
|
|
endif
|