mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
14eb490bb3
Also added 'make help' target which prints some useful usage summary.
27 lines
969 B
Makefile
27 lines
969 B
Makefile
# 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
|
|
ESPTOOLPY := $(PYTHON) $(SDK_PATH)/bin/esptool.py --chip esp32
|
|
ESPTOOLPY_SERIAL := $(ESPTOOLPY) --port $(ESPPORT) --baud $(ESPBAUD)
|
|
|
|
APP_FLASH_COMMAND=$(ESPTOOLPY_SERIAL) write_flash $(CONFIG_APP_OFFSET) $(APP_BIN)
|
|
ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_APP_OFFSET) $(APP_BIN)
|
|
|
|
$(APP_BIN): $(APP_ELF)
|
|
$(Q) $(ESPTOOLPY) elf2image -o $@ $<
|
|
|
|
flash: all_binaries
|
|
@echo "Flashing project app to $(CONFIG_APP_OFFSET)..."
|
|
$(Q) $(ESPTOOLPY_SERIAL) write_flash $(ESPTOOL_ALL_FLASH_ARGS)
|
|
|
|
app-flash: $(APP_BIN)
|
|
$(Q) $(APP_FLASH_COMMAND)
|