summaryrefslogtreecommitdiff
path: root/ports/esp32s2
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-01-07 15:01:33 -0600
committerJeff Epler <jepler@gmail.com>2021-01-07 15:01:33 -0600
commit7bb196b9d2133477bf967d6b1d5dafe0971f765f (patch)
treeb57257d4a513605f27c1aef20112d746f4bcaa8b /ports/esp32s2
parent30c6dd3f76e7d3c0f8b3a6eb20de627b097dbf09 (diff)
esp32s2: 'make flash': Allow customizing the esptool flags
This can be useful so that e.g., on a Kaluga when programming via the FTDI chip, you can override the variable to specify "--after=hard_reset" to automatically return to running CircuitPython, choose a different baud rate (921600 is about 2s faster than 460800), etc: make BOARD=espressif_kaluga_1 ESPTOOL_FLAGS="-b 921600 --before=default_reset --after=hard_reset"
Diffstat (limited to 'ports/esp32s2')
-rw-r--r--ports/esp32s2/Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile
index 4a334a2eb..88bc8ce63 100644
--- a/ports/esp32s2/Makefile
+++ b/ports/esp32s2/Makefile
@@ -300,6 +300,8 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld $(BUILD)/esp-id
FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE)
+ESPTOOL_FLAGS ?= -b 460800 --before=default_reset --after=no_reset write_flash
+
all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2
.PHONY: esp-idf-stamp
@@ -338,10 +340,10 @@ $(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin
$(Q)$(PYTHON3) $(TOP)/tools/uf2/utils/uf2conv.py -f 0xbfdd4eee -b 0x0000 -c -o $@ $^
flash: $(BUILD)/firmware.bin
- esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=no_reset write_flash $(FLASH_FLAGS) 0x0000 $^
+ esptool.py --chip esp32s2 -p $(PORT) $(ESPTOOL_FLAGS) write_flash $(FLASH_FLAGS) 0x0000 $^
flash-circuitpython-only: $(BUILD)/circuitpython-firmware.bin
- esptool.py --chip esp32s2 -p $(PORT) -b 460800 --before=default_reset --after=no_reset write_flash $(FLASH_FLAGS) 0x10000 $^
+ esptool.py --chip esp32s2 -p $(PORT) $(ESPTOOL_FLAGS) write_flash $(FLASH_FLAGS) 0x10000 $^
include $(TOP)/py/mkrules.mk