Skip to content

Commit f52f60b

Browse files
committed
Add UF2 build target
1 parent 7b56617 commit f52f60b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ports/esp32s2/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-id
258258

259259
FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE)
260260

261-
all: $(BUILD)/firmware.bin
261+
all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2
262262

263263
$(BUILD)/firmware.elf: $(OBJ) | $(ESP_IDF_COMPONENTS_EXPANDED) $(ESP_AUTOGEN_LD)
264264
$(STEPECHO) "LINK $@"
@@ -274,6 +274,10 @@ $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf
274274
$(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BUILD)/esp-idf/bootloader/bootloader.bin $(BUILD)/circuitpython-firmware.bin
275275
$(Q)$(PYTHON) ../../tools/join_bins.py $@ 0x1000 $(BUILD)/esp-idf/bootloader/bootloader.bin 0x8000 $(BUILD)/esp-idf/partition_table/partition-table.bin 0x10000 $(BUILD)/circuitpython-firmware.bin
276276

277+
$(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin
278+
$(STEPECHO) "Create $@"
279+
$(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^
280+
277281
flash: $(BUILD)/firmware.bin
278282
esptool.py --chip esp32s2 -p $(PORT) --no-stub -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^
279283

0 commit comments

Comments
 (0)