summaryrefslogtreecommitdiffstats
path: root/platforms/chibios/flash.mk
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/chibios/flash.mk')
-rw-r--r--platforms/chibios/flash.mk16
1 files changed, 16 insertions, 0 deletions
diff --git a/platforms/chibios/flash.mk b/platforms/chibios/flash.mk
index 31f69595da..6ee53172d2 100644
--- a/platforms/chibios/flash.mk
+++ b/platforms/chibios/flash.mk
@@ -23,6 +23,20 @@ define EXEC_DFU_UTIL
$(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin
endef
+
+define EXEC_WB32_DFU_UPDATER
+ if ! wb32-dfu-updater_cli -l | grep -q "Found DFU"; then \
+ printf "$(MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY)" ;\
+ sleep $(BOOTLOADER_RETRY_TIME) ;\
+ while ! wb32-dfu-updater_cli -l | grep -q "Found DFU"; do \
+ printf "." ;\
+ sleep $(BOOTLOADER_RETRY_TIME) ;\
+ done ;\
+ printf "\n" ;\
+ fi
+ wb32-dfu-updater_cli -D $(BUILD_DIR)/$(TARGET).bin
+endef
+
dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
$(call EXEC_DFU_UTIL)
@@ -82,6 +96,8 @@ else ifeq ($(strip $(MCU_FAMILY)),MIMXRT1062)
$(UNSYNC_OUTPUT_CMD) && $(call EXEC_TEENSY)
else ifeq ($(strip $(MCU_FAMILY)),STM32)
$(UNSYNC_OUTPUT_CMD) && $(call EXEC_DFU_UTIL)
+else ifeq ($(strip $(MCU_FAMILY)),WB32)
+ $(UNSYNC_OUTPUT_CMD) && $(call EXEC_WB32_DFU_UPDATER)
else ifeq ($(strip $(MCU_FAMILY)),GD32V)
$(UNSYNC_OUTPUT_CMD) && $(call EXEC_DFU_UTIL)
else