From aefd48b80118c45e43e591e73aea1cda778e3676 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 3 Sep 2024 10:58:07 +0200 Subject: [PATCH] samd/Makefile: Specify UF2 family in firmware.uf2. Set the UF2 firmware images family to Microchip SAMD21 or SAMD51. This helps tools such as file to identify built firmware. Signed-off-by: Alexandre Iooss --- ports/samd/Makefile | 2 +- ports/samd/mcu/samd21/mpconfigmcu.mk | 2 ++ ports/samd/mcu/samd51/mpconfigmcu.mk | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/samd/Makefile b/ports/samd/Makefile index 487a9cb38..75a4d9b1d 100644 --- a/ports/samd/Makefile +++ b/ports/samd/Makefile @@ -183,7 +183,7 @@ $(BUILD)/firmware.bin: $(BUILD)/firmware.elf $(Q)$(OBJCOPY) -O binary -j .isr_vector -j .text -j .data $^ $(BUILD)/firmware.bin $(BUILD)/firmware.uf2: $(BUILD)/firmware.bin - $(Q)$(PYTHON) $(UF2CONV) -b $(TEXT0) -c -o $@ $< + $(Q)$(PYTHON) $(UF2CONV) $(UF2CONV_FLAGS) -b $(TEXT0) -c -o $@ $< # pin_af.c: $(BUILD)/$(GEN_PIN_AF) | $(HEADER_BUILD) diff --git a/ports/samd/mcu/samd21/mpconfigmcu.mk b/ports/samd/mcu/samd21/mpconfigmcu.mk index 89e63c3aa..34209775c 100644 --- a/ports/samd/mcu/samd21/mpconfigmcu.mk +++ b/ports/samd/mcu/samd21/mpconfigmcu.mk @@ -13,3 +13,5 @@ endif MICROPY_VFS_LFS1 ?= 1 SRC_S += shared/runtime/gchelper_thumb1.s + +UF2CONV_FLAGS += -f 0x68ed2b88 diff --git a/ports/samd/mcu/samd51/mpconfigmcu.mk b/ports/samd/mcu/samd51/mpconfigmcu.mk index 0201bacff..9bef5eca1 100644 --- a/ports/samd/mcu/samd51/mpconfigmcu.mk +++ b/ports/samd/mcu/samd51/mpconfigmcu.mk @@ -14,3 +14,5 @@ SRC_S += shared/runtime/gchelper_thumb2.s SRC_C += \ fatfs_port.c \ + +UF2CONV_FLAGS += -f 0x55114460