Add QIO/QOUT/DIO/DOUT select for esptool.py

This commit is contained in:
Jeroen Domburg 2016-09-01 15:47:09 +08:00
parent 68ede76ab5
commit 4272996ebe
2 changed files with 27 additions and 2 deletions

View file

@ -46,4 +46,28 @@ config ESPTOOLPY_COMPRESSED
decompress it on the fly before flashing it. For most payloads, this should result in a
speed increase.
choice ESPTOOLPY_FLASHMODE
prompt "Flash SPI mode"
default ESPTOOLPY_FLASHMODE_QIO
help
Mode the flash chip is flashed in, as well as the default mode for the
binary to run in.
config ESPTOOLPY_FLASHMODE_QIO
bool "QIO"
config ESPTOOLPY_FLASHMODE_QOUT
bool "QOUT"
config ESPTOOLPY_FLASHMODE_DIO
bool "DIO"
config ESPTOOLPY_FLASHMODE_DOUT
bool "DOUT"
endchoice
config ESPTOOLPY_FLASHMODE
string
default "qio" if ESPTOOLPY_FLASHMODE_QIO
default "qout" if ESPTOOLPY_FLASHMODE_QOUT
default "dio" if ESPTOOLPY_FLASHMODE_DIO
default "dout" if ESPTOOLPY_FLASHMODE_DOUT
endmenu

View file

@ -2,6 +2,7 @@
# components have their own flash targets that can use these variables.
ESPPORT ?= $(CONFIG_ESPTOOLPY_PORT)
ESPBAUD ?= $(CONFIG_ESPTOOLPY_BAUD)
ESPFLASHMODE ?= $(CONFIG_ESPTOOLPY_FLASHMODE)
PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
@ -12,12 +13,12 @@ PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
ESPTOOLPY := $(PYTHON) $(IDF_PATH)/bin/esptool.py --chip esp32
ESPTOOLPY_SERIAL := $(ESPTOOLPY) --port $(ESPPORT) --baud $(ESPBAUD)
ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z)
ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z) --flash_mode $(ESPFLASHMODE)
ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_APP_OFFSET) $(APP_BIN)
$(APP_BIN): $(APP_ELF)
$(Q) $(ESPTOOLPY) elf2image -o $@ $<
$(Q) $(ESPTOOLPY) elf2image --flash_mode $(ESPFLASHMODE) -o $@ $<
flash: all_binaries
@echo "Flashing project app to $(CONFIG_APP_OFFSET)..."