diff --git a/builddefs/common_rules.mk b/builddefs/common_rules.mk index e993cc350eaa..816eac49ae8f 100644 --- a/builddefs/common_rules.mk +++ b/builddefs/common_rules.mk @@ -152,6 +152,7 @@ endif # To produce a UF2 file in your build, add to your keyboard's rules.mk: # FIRMWARE_FORMAT = uf2 UF2CONV = $(TOP_DIR)/util/uf2conv.py +UF2CONV_ARGS ?= UF2_FAMILY ?= 0x0 # Compiler flags to generate dependency files. @@ -219,7 +220,7 @@ gccversion : @$(BUILD_CMD) %.uf2: %.elf - $(eval CMD=$(HEX) $< $(BUILD_DIR)/$(TARGET).tmp && $(UF2CONV) $(BUILD_DIR)/$(TARGET).tmp --output $@ --convert --family $(UF2_FAMILY) >/dev/null 2>&1) + $(eval CMD=$(HEX) $< $(BUILD_DIR)/$(TARGET).tmp && $(UF2CONV) $(UF2CONV_ARGS) $(BUILD_DIR)/$(TARGET).tmp --output $@ --convert --family $(UF2_FAMILY) >/dev/null 2>&1) #@$(SILENT) || printf "$(MSG_EXECUTING) '$(CMD)':\n" @$(SILENT) || printf "$(MSG_UF2) $@" | $(AWK_CMD) @$(BUILD_CMD) diff --git a/util/uf2conv.py b/util/uf2conv.py index 52d3861cba0c..578b2b49772d 100755 --- a/util/uf2conv.py +++ b/util/uf2conv.py @@ -151,10 +151,15 @@ def encode(self, blockno, numblocks): flags = 0x0 if familyid: flags |= 0x2000 + if devicetype: + flags |= 0x8000 hd = struct.pack("