summaryrefslogtreecommitdiffstats
path: root/platforms/chibios/flash.mk
diff options
context:
space:
mode:
authorJoy Lee <chang.li@westberrytech.com>2021-11-27 06:28:18 +0800
committerGitHub <noreply@github.com>2021-11-27 09:28:18 +1100
commit68838bb700413144c6fdaf680f3d412b8231b584 (patch)
tree771e7fea9bc145c9e833ac66dcb712af9b55e532 /platforms/chibios/flash.mk
parentb04f66f2452494206673323c9495ea6a56c0cb06 (diff)
Westberrytech pr (#14422)
* Added support for WB32 MCU * Modified eeprom_wb32.c * Remove the eeprom_wb32-related code
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