diff --git a/add_path.sh b/add_path.sh new file mode 100644 index 000000000..681c2e94b --- /dev/null +++ b/add_path.sh @@ -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: +# +# source ${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/:${IDF_PATH}/components/partition_table/" + export PATH="${PATH}:${IDF_ADD_PATHS_EXTRAS}" + echo "Added to PATH: ${IDF_ADD_PATHS_EXTRAS}" +fi + + diff --git a/components/esptool_py/Makefile.projbuild b/components/esptool_py/Makefile.projbuild index 576e526d5..44dcf62ec 100644 --- a/components/esptool_py/Makefile.projbuild +++ b/components/esptool_py/Makefile.projbuild @@ -9,7 +9,7 @@ PYTHON ?= $(call dequote,$(CONFIG_PYTHON)) # 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) $(IDF_PATH)/bin/esptool.py --chip esp32 +ESPTOOLPY := $(PYTHON) $(IDF_PATH)/components/esptool_py/esptool.py --chip esp32 ESPTOOLPY_SERIAL := $(ESPTOOLPY) --port $(ESPPORT) --baud $(ESPBAUD) ESPTOOLPY_WRITE_FLASH=$(ESPTOOLPY_SERIAL) write_flash $(if $(CONFIG_ESPTOOLPY_COMPRESSED),-z) diff --git a/bin/esptool.py b/components/esptool_py/esptool.py similarity index 100% rename from bin/esptool.py rename to components/esptool_py/esptool.py diff --git a/components/partition_table/Makefile.projbuild b/components/partition_table/Makefile.projbuild index 0790733ac..98631cc85 100644 --- a/components/partition_table/Makefile.projbuild +++ b/components/partition_table/Makefile.projbuild @@ -9,7 +9,7 @@ .PHONY: partition_table partition_table-flash partition_table-clean # 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 # partition CSV files, but relative to component dir otherwise.$ diff --git a/bin/gen_esp32part.py b/components/partition_table/gen_esp32part.py similarity index 100% rename from bin/gen_esp32part.py rename to components/partition_table/gen_esp32part.py