Ver Fonte

tools: Support external Esptool wrappers

Implements https://github.com/jimparis/esptool-ftdi/issues/3

Closes https://github.com/espressif/esp-idf/pull/6879
Martin Babutzka há 4 anos atrás
pai
commit
6faf4941cc

+ 1 - 1
components/esptool_py/project_include.cmake

@@ -12,7 +12,7 @@ if(target STREQUAL "esp32s3")
     endif()
 endif()
 
-set(ESPTOOLPY ${python} "${CMAKE_CURRENT_LIST_DIR}/esptool/esptool.py" --chip ${chip_model})
+set(ESPTOOLPY ${python} "$ENV{ESPTOOL_WRAPPER}" "${CMAKE_CURRENT_LIST_DIR}/esptool/esptool.py" --chip ${chip_model})
 set(ESPSECUREPY ${python} "${CMAKE_CURRENT_LIST_DIR}/esptool/espsecure.py")
 set(ESPEFUSEPY ${python} "${CMAKE_CURRENT_LIST_DIR}/esptool/espefuse.py")
 set(ESPMONITOR ${python} "${idf_path}/tools/idf_monitor.py")

+ 5 - 1
tools/idf_py_actions/serial_ext.py

@@ -37,9 +37,13 @@ def action_extensions(base_actions, project_path):
 
     def _get_esptool_args(args):
         esptool_path = os.path.join(os.environ['IDF_PATH'], 'components/esptool_py/esptool/esptool.py')
+        esptool_wrapper_path = os.environ.get('ESPTOOL_WRAPPER', '')
         if args.port is None:
             args.port = _get_default_serial_port(args)
-        result = [PYTHON, esptool_path]
+        result = [PYTHON]
+        if os.path.exists(esptool_wrapper_path):
+            result += [esptool_wrapper_path]
+        result += [esptool_path]
         result += ['-p', args.port]
         result += ['-b', str(args.baud)]