2016-08-17 15:08:22 +00:00
|
|
|
# Component support for esptool.py. Doesn't do much by itself,
|
|
|
|
# components have their own flash targets that can use these variables.
|
|
|
|
ESPPORT ?= $(CONFIG_ESPTOOLPY_PORT)
|
|
|
|
ESPBAUD ?= $(CONFIG_ESPTOOLPY_BAUD)
|
|
|
|
|
|
|
|
PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
|
|
|
|
|
|
|
|
# two commands that can be used from other components
|
|
|
|
# to invoke esptool.py (with or without serial port args)
|
|
|
|
#
|
|
|
|
# NB: esptool.py lives in the sdk/bin directory not the component directory
|
2016-09-01 08:27:51 +00:00
|
|
|
ESPTOOLPY := $(PYTHON) $(IDF_PATH)/components/esptool_py/esptool.py --chip esp32
|
2016-08-17 15:08:22 +00:00
|
|
|
ESPTOOLPY_SERIAL := $(ESPTOOLPY) --port $(ESPPORT) --baud $(ESPBAUD)
|
|
|
|
|
2016-08-22 10:43:47 +00:00
|
|
|
ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z)
|
|
|
|
|
2016-08-18 09:11:27 +00:00
|
|
|
ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_APP_OFFSET) $(APP_BIN)
|
2016-08-17 15:08:22 +00:00
|
|
|
|
2016-08-18 09:11:27 +00:00
|
|
|
$(APP_BIN): $(APP_ELF)
|
2016-08-17 15:08:22 +00:00
|
|
|
$(Q) $(ESPTOOLPY) elf2image -o $@ $<
|
|
|
|
|
2016-08-18 09:11:27 +00:00
|
|
|
flash: all_binaries
|
2016-08-17 15:08:22 +00:00
|
|
|
@echo "Flashing project app to $(CONFIG_APP_OFFSET)..."
|
2016-08-22 10:43:47 +00:00
|
|
|
$(Q) $(ESPTOOLPY_WRITE_FLASH) $(ESPTOOL_ALL_FLASH_ARGS)
|
2016-08-17 15:08:22 +00:00
|
|
|
|
2016-08-18 09:11:27 +00:00
|
|
|
app-flash: $(APP_BIN)
|
2016-08-22 10:43:47 +00:00
|
|
|
$(Q) $(ESPTOOLPY_WRITE_FLASH) $(CONFIG_APP_OFFSET) $(APP_BIN)
|