Skip to content

Commit c09f0c8

Browse files
authored
Merge pull request #2943 from jerryneedell/jerryn_esp32s2_make
allow PORT specification for esp32s2 flashing
2 parents 285eb71 + 93df3b8 commit c09f0c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ports/esp32s2/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ else
3131
endif
3232
endif
3333

34+
# If the flash PORT is not given, use the default /dev/tty.SLAB_USBtoUART.
35+
PORT ?= /dev/tty.SLAB_USBtoUART
36+
3437
# If the build directory is not given, make it reflect the board name.
3538
BUILD ?= build-$(BOARD)
3639

@@ -270,7 +273,7 @@ $(BUILD)/firmware.bin: $(BUILD)/esp-idf/partition_table/partition-table.bin $(BU
270273
$(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
271274

272275
flash: $(BUILD)/firmware.bin
273-
esptool.py --chip esp32s2 -p /dev/tty.SLAB_USBtoUART -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^
276+
esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash $(FLASH_FLAGS) 0x0000 $^
274277

275278
include $(TOP)/py/mkrules.mk
276279

0 commit comments

Comments
 (0)