summaryrefslogtreecommitdiffstats
path: root/platforms
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-03-07 17:59:06 +0100
committerGitHub <noreply@github.com>2022-03-07 08:59:06 -0800
commit2bface8f893f3f13ddb9a3e10c0f362819d09c5c (patch)
treec1f4eff97cc9c9665532cb1738b03cf9e5337347 /platforms
parent05b71936511402d91e345e615d074cf310cb4ece (diff)
Add flash target for UF2 bootloaders (#16525)
Diffstat (limited to 'platforms')
-rw-r--r--platforms/chibios/flash.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/platforms/chibios/flash.mk b/platforms/chibios/flash.mk
index 6ee53172d2..a91ef2cf35 100644
--- a/platforms/chibios/flash.mk
+++ b/platforms/chibios/flash.mk
@@ -40,6 +40,18 @@ endef
dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
$(call EXEC_DFU_UTIL)
+define EXEC_UF2_UTIL_DEPLOY
+ if ! $(UF2CONV) --deploy $(BUILD_DIR)/$(TARGET).uf2 2>/dev/null; then \
+ printf "$(MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY)" ;\
+ sleep $(BOOTLOADER_RETRY_TIME) ;\
+ while ! $(UF2CONV) --deploy $(BUILD_DIR)/$(TARGET).uf2 2>/dev/null; do \
+ printf "." ;\
+ sleep $(BOOTLOADER_RETRY_TIME) ;\
+ done ;\
+ printf "\n" ;\
+ fi
+endef
+
# TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS
# within the emulated eeprom via dfu-util or another tool
ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-left))
@@ -90,6 +102,8 @@ ifneq ($(strip $(PROGRAM_CMD)),)
$(UNSYNC_OUTPUT_CMD) && $(PROGRAM_CMD)
else ifeq ($(strip $(BOOTLOADER)),kiibohd)
$(UNSYNC_OUTPUT_CMD) && $(call EXEC_DFU_UTIL)
+else ifeq ($(strip $(BOOTLOADER)),tinyuf2)
+ $(UNSYNC_OUTPUT_CMD) && $(call EXEC_UF2_UTIL_DEPLOY)
else ifeq ($(strip $(MCU_FAMILY)),KINETIS)
$(UNSYNC_OUTPUT_CMD) && $(call EXEC_TEENSY)
else ifeq ($(strip $(MCU_FAMILY)),MIMXRT1062)