forked from espressif/esp-idf
Merge branch 'feature/esptool_upstream'
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
|||||||
[submodule "components/esp32/lib"]
|
[submodule "components/esp32/lib"]
|
||||||
path = components/esp32/lib
|
path = components/esp32/lib
|
||||||
url = https://github.com/espressif/esp32-wifi-lib.git
|
url = https://github.com/espressif/esp32-wifi-lib.git
|
||||||
|
[submodule "components/esptool_py/esptool"]
|
||||||
|
path = components/esptool_py/esptool
|
||||||
|
url = https://github.com/themadinventor/esptool.git
|
||||||
|
17
add_path.sh
Normal file
17
add_path.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# This shell snippet appends useful esp-idf tools to your PATH environment
|
||||||
|
# variable. This means you can run esp-idf tools without needing to give the
|
||||||
|
# full path.
|
||||||
|
#
|
||||||
|
# Use this script like this:
|
||||||
|
#
|
||||||
|
# . ${IDF_PATH}/add_path.sh
|
||||||
|
#
|
||||||
|
if [ -z ${IDF_PATH} ]; then
|
||||||
|
echo "IDF_PATH must be set before including this script."
|
||||||
|
else
|
||||||
|
IDF_ADD_PATHS_EXTRAS="${IDF_PATH}/components/esptool_py/esptool:${IDF_PATH}/components/partition_table/"
|
||||||
|
export PATH="${PATH}:${IDF_ADD_PATHS_EXTRAS}"
|
||||||
|
echo "Added to PATH: ${IDF_ADD_PATHS_EXTRAS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
1810
bin/esptool.py
1810
bin/esptool.py
File diff suppressed because it is too large
Load Diff
@@ -37,14 +37,9 @@ include $(IDF_PATH)/make/component_common.mk
|
|||||||
|
|
||||||
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
ALL_LIB_FILES := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
|
||||||
|
|
||||||
# The binary libraries are in a git submodule, so this target will
|
# automatically trigger a git submodule update
|
||||||
# be invoked if any modules are missing (probably because
|
# if any libraries are missing
|
||||||
# git submodule update --init needs to be run).
|
$(eval $(call SubmoduleRequiredForFiles,$(ALL_LIB_FILES)))
|
||||||
$(ALL_LIB_FILES):
|
|
||||||
$(Q) [ -d ${IDF_PATH}/.git ] || ( @echo "ERROR: Missing libraries in esp32 component. esp-idf must be cloned from git to work."; exit 1 )
|
|
||||||
$(Q) [ -x $(which git) ] || ( @echo "ERROR: Missing libraries in esp32 component. Need to run 'git submodule update --init' in esp-idf root directory."; exit 1 )
|
|
||||||
@echo "Warning: Missing libraries in components/esp32/lib/ submodule. Going to try running 'git submodule update --init' in esp-idf root directory..."
|
|
||||||
cd ${IDF_PATH} && git submodule update --init
|
|
||||||
|
|
||||||
# this is a hack to make sure the app is re-linked if the binary
|
# this is a hack to make sure the app is re-linked if the binary
|
||||||
# libraries change or are updated. If they change, the main esp32
|
# libraries change or are updated. If they change, the main esp32
|
||||||
|
@@ -11,19 +11,23 @@ PYTHON ?= $(call dequote,$(CONFIG_PYTHON))
|
|||||||
# to invoke esptool.py (with or without serial port args)
|
# to invoke esptool.py (with or without serial port args)
|
||||||
#
|
#
|
||||||
# NB: esptool.py lives in the sdk/bin directory not the component directory
|
# NB: esptool.py lives in the sdk/bin directory not the component directory
|
||||||
ESPTOOLPY := $(PYTHON) $(IDF_PATH)/bin/esptool.py --chip esp32
|
ESPTOOLPY_SRC := $(COMPONENT_PATH)/esptool/esptool.py
|
||||||
|
ESPTOOLPY := $(PYTHON) $(ESPTOOLPY_SRC) --chip esp32
|
||||||
ESPTOOLPY_SERIAL := $(ESPTOOLPY) --port $(ESPPORT) --baud $(ESPBAUD)
|
ESPTOOLPY_SERIAL := $(ESPTOOLPY) --port $(ESPPORT) --baud $(ESPBAUD)
|
||||||
|
|
||||||
ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z) --flash_mode $(ESPFLASHMODE) --flash_freq $(ESPFLASHFREQ)
|
# the no-stub argument is temporary until esptool.py fully supports compressed uploads
|
||||||
|
ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) $(if $(CONFIG_ESPTOOLPY_COMPRESSED),--no-stub) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z) --flash_mode $(ESPFLASHMODE) --flash_freq $(ESPFLASHFREQ)
|
||||||
|
|
||||||
ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_APP_OFFSET) $(APP_BIN)
|
ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_APP_OFFSET) $(APP_BIN)
|
||||||
|
|
||||||
$(APP_BIN): $(APP_ELF)
|
$(APP_BIN): $(APP_ELF) $(ESPTOOLPY_SRC)
|
||||||
$(Q) $(ESPTOOLPY) elf2image --flash_mode $(ESPFLASHMODE) --flash_freq $(ESPFLASHFREQ) -o $@ $<
|
$(Q) $(ESPTOOLPY) elf2image --flash_mode $(ESPFLASHMODE) --flash_freq $(ESPFLASHFREQ) -o $@ $<
|
||||||
|
|
||||||
flash: all_binaries
|
flash: all_binaries $(ESPTOOLPY_SRC)
|
||||||
@echo "Flashing project app to $(CONFIG_APP_OFFSET)..."
|
@echo "Flashing project app to $(CONFIG_APP_OFFSET)..."
|
||||||
$(Q) $(ESPTOOLPY_WRITE_FLASH) $(ESPTOOL_ALL_FLASH_ARGS)
|
$(Q) $(ESPTOOLPY_WRITE_FLASH) $(ESPTOOL_ALL_FLASH_ARGS)
|
||||||
|
|
||||||
app-flash: $(APP_BIN)
|
app-flash: $(APP_BIN) $(ESPTOOLPY_SRC)
|
||||||
$(Q) $(ESPTOOLPY_WRITE_FLASH) $(CONFIG_APP_OFFSET) $(APP_BIN)
|
$(Q) $(ESPTOOLPY_WRITE_FLASH) $(CONFIG_APP_OFFSET) $(APP_BIN)
|
||||||
|
|
||||||
|
$(eval $(call SubmoduleRequiredForFiles,$(ESPTOOLPY_SRC)))
|
||||||
|
1
components/esptool_py/esptool
Submodule
1
components/esptool_py/esptool
Submodule
Submodule components/esptool_py/esptool added at 7c84dd4335
@@ -9,7 +9,7 @@
|
|||||||
.PHONY: partition_table partition_table-flash partition_table-clean
|
.PHONY: partition_table partition_table-flash partition_table-clean
|
||||||
|
|
||||||
# NB: gen_esp32part.py lives in the sdk/bin/ dir not component dir
|
# NB: gen_esp32part.py lives in the sdk/bin/ dir not component dir
|
||||||
GEN_ESP32PART := $(PYTHON) $(IDF_PATH)/bin/gen_esp32part.py -q
|
GEN_ESP32PART := $(PYTHON) $(COMPONENT_PATH)/gen_esp32part.py -q
|
||||||
|
|
||||||
# Path to partition CSV file is relative to project path for custom
|
# Path to partition CSV file is relative to project path for custom
|
||||||
# partition CSV files, but relative to component dir otherwise.$
|
# partition CSV files, but relative to component dir otherwise.$
|
||||||
|
@@ -49,6 +49,23 @@ summary := @echo
|
|||||||
details := @true
|
details := @true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Pseudo-target to handle the case where submodules need to be
|
||||||
|
# re-initialised.
|
||||||
|
#
|
||||||
|
# $(eval $(call SubmoduleRequiredForFiles,FILENAMES)) to create a target that
|
||||||
|
# automatically runs 'git submodule update --init' if those files
|
||||||
|
# are missing, and fails if this is not possible.
|
||||||
|
define SubmoduleRequiredForFiles
|
||||||
|
$(1):
|
||||||
|
@echo "WARNING: Missing submodule for $$@..."
|
||||||
|
$(Q) [ -d ${IDF_PATH}/.git ] || ( echo "ERROR: esp-idf must be cloned from git to work."; exit 1)
|
||||||
|
$(Q) [ -x $(which git) ] || ( echo "ERROR: Need to run 'git submodule --init' in esp-idf root directory."; exit 1)
|
||||||
|
@echo "Attempting 'git submodule update --init' in esp-idf root directory..."
|
||||||
|
cd ${IDF_PATH} && git submodule update --init
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# General make utilities
|
# General make utilities
|
||||||
|
|
||||||
# convenience variable for printing an 80 asterisk wide separator line
|
# convenience variable for printing an 80 asterisk wide separator line
|
||||||
|
Reference in New Issue
Block a user