Page 1 of 1

在vscode中安装esp-idf环境,会出现bad config lin2 in file ..//..//bt/controller/libesp32的错误

Posted: Tue Mar 03, 2026 4:11 am
by chwq1011
在vscode中安装esp-idf环境出现错误,已重装很多次不同版本,最后使用EIM的简易安装方法,仍然出现问题,日志如下,请求帮助:
IDF PowerShell Environment
-------------------------
Environment variables set:
IDF_PATH: C:\esp\v5.5.3\esp-idf
IDF_TOOLS_PATH: C:\Espressif\tools
IDF_PYTHON_ENV_PATH: C:\Espressif\tools\python\v5.5.3\venv

Custom commands available:
idf.py - Use this to run IDF commands (e.g., idf.py build)
esptool.py
espefuse.py
espsecure.py
otatool.py
parttool.py

Python environment activated.
You can now use IDF commands and Python tools.
(venv) PS C:\Users\ZhuanZ\Desktop> cd E:\esp_hello\
(venv) PS E:\esp_hello> ls
(venv) PS E:\esp_hello> idf.py create-project my_project
Executing action: create-project
The project was created in E:\esp_hello\my_project
(venv) PS E:\esp_hello> idf.py build
Executing action: all (aliases: build)
CMakeLists.txt not found in project directory E:\esp_hello
(venv) PS E:\esp_hello> cd .\my_project\
(venv) PS E:\esp_hello\my_project> ls


目录: E:\esp_hello\my_project


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2026/3/3 11:35 main
-a---- 2026/3/3 11:35 246 CMakeLists.txt


(venv) PS E:\esp_hello\my_project> idf.py build
Executing action: all (aliases: build)
Running cmake in directory E:\esp_hello\my_project\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=C:\Espressif\tools\python\v5.5.3\venv\Scripts\python.exe -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 E:\esp_hello\my_project"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: D:/Program Files/Git/cmd/git.exe (found version "2.53.0.windows.1")
-- git describe returned 'fatal: bad config line 2 in file C:/esp/v5.5.3/esp-idf/.git/modules/components/bt/controller/lib_esp32/config'
fatal: bad config line 2 in file C:/esp/v5.5.3/esp-idf/.git/modules/components/bt/controller/lib_esp32/config
-- Initialising new submodule components/bootloader/subproject/components/micro-ecc/micro-ecc...
Submodule 'components/bootloader/subproject/components/micro-ecc/micro-ecc' (https://jihulab.com/esp-mirror/kmackay/micro-ecc.git) registered for path 'components/bootloader/subproject/components/micro-ecc/micro-ecc'
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bootloader/subproject/components/micro-ecc/micro-ecc'...
Submodule path 'components/bootloader/subproject/components/micro-ecc/micro-ecc': checked out '24c60e243580c7868f4334a1ba3123481fe1aa48'
-- Minimal build - OFF
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20251107/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20251107/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20251107/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
-- ESP-TEE is currently supported only on the esp32c6;esp32h2;esp32c5 SoCs
CMake Error at C:/esp/v5.5.3/esp-idf/tools/cmake/component.cmake:231 (message):
CMake Warning (dev) at build_properties.temp.cmake:8:

Syntax Warning in cmake code at column 106



Argument not separated from preceding token by whitespace.

Call Stack (most recent call first):

C:/esp/v5.5.3/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:3 (include)

This warning is for project developers. Use -Wno-dev to suppress it.



CMake Error at C:/esp/v5.5.3/esp-idf/components/mqtt/CMakeLists.txt:3
(message):

Missing esp-mqtt submodule. Please run 'git submodule update --init
--recursive' in ESP-IDF directory to fix this.

Call Stack (most recent call first):

C:/esp/v5.5.3/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:107 (include)
C:/esp/v5.5.3/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:160 (__component_get_requirements)





Call Stack (most recent call first):
C:/esp/v5.5.3/esp-idf/tools/cmake/build.cmake:666 (__component_get_requirements)
C:/esp/v5.5.3/esp-idf/tools/cmake/project.cmake:741 (idf_build_process)
CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the E:\esp_hello\my_project\build\log\idf_py_stderr_output_15964 and E:\esp_hello\my_project\build\log\idf_py_stdout_output_15964

(venv) PS E:\esp_hello\my_project> cd C:\esp\v5.5.3\
(venv) PS C:\esp\v5.5.3> ls


目录: C:\esp\v5.5.3


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2026/3/3 11:26 esp-idf


(venv) PS C:\esp\v5.5.3> cd .\esp-idf\
(venv) PS C:\esp\v5.5.3\esp-idf> ls


目录: C:\esp\v5.5.3\esp-idf


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2026/3/3 11:36 .git
d----- 2026/3/3 11:26 .github
d----- 2026/3/3 11:26 .gitlab
d----- 2026/3/3 11:26 components
d----- 2026/3/3 11:26 docs
d----- 2026/3/3 11:26 examples
d----- 2026/3/3 11:35 tools
-a---- 2026/3/3 11:26 306 .codespellrc
-a---- 2026/3/3 11:26 616 .editorconfig
-a---- 2026/3/3 11:26 1628 .gitignore
-a---- 2026/3/3 11:26 1335 .gitlab-ci.yml
-a---- 2026/3/3 11:26 5931 .gitmodules
-a---- 2026/3/3 11:26 985 .mypy.ini
-a---- 2026/3/3 11:26 9468 .pre-commit-config.yaml
-a---- 2026/3/3 11:26 539 .readthedocs.yml
-a---- 2026/3/3 11:26 164 .shellcheckrc
-a---- 2026/3/3 11:26 3428 .vale.ini
-a---- 2026/3/3 11:26 721 add_path.sh
-a---- 2026/3/3 11:26 12374 CMakeLists.txt
-a---- 2026/3/3 11:26 6361 COMPATIBILITY.md
-a---- 2026/3/3 11:26 6506 COMPATIBILITY_CN.md
-a---- 2026/3/3 11:26 23654 conftest.py
-a---- 2026/3/3 11:26 314 CONTRIBUTING.md
-a---- 2026/3/3 11:26 2079 export.bat
-a---- 2026/3/3 11:26 966 export.fish
-a---- 2026/3/3 11:26 864 export.ps1
-a---- 2026/3/3 11:26 2248 export.sh
-a---- 2026/3/3 11:26 2203 install.bat
-a---- 2026/3/3 11:26 1040 install.fish
-a---- 2026/3/3 11:26 1488 install.ps1
-a---- 2026/3/3 11:26 1065 install.sh
-a---- 2026/3/3 11:26 29845 Kconfig
-a---- 2026/3/3 11:26 11358 LICENSE
-a---- 2026/3/3 11:26 970 pytest.ini
-a---- 2026/3/3 11:26 6571 README.md
-a---- 2026/3/3 11:26 6389 README_CN.md
-a---- 2026/3/3 11:26 6544 ROADMAP.md
-a---- 2026/3/3 11:26 6286 ROADMAP_CN.md
-a---- 2026/3/3 11:26 1709 ruff.toml
-a---- 2026/3/3 11:26 2044 sdkconfig.rename
-a---- 2026/3/3 11:26 532 SECURITY.md
-a---- 2026/3/3 11:26 32 sgconfig.yml
-a---- 2026/3/3 11:26 530 sonar-project.properties
-a---- 2026/3/3 11:26 3714 SUPPORT_POLICY.md
-a---- 2026/3/3 11:26 3397 SUPPORT_POLICY_CN.md


(venv) PS C:\esp\v5.5.3\esp-idf> git submodule update --init --recursive
Submodule 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib' (https://jihulab.com/esp-mirror/espressi ... bt-lib.git) registered for path 'components/bt/controller/lib_esp32c2/esp32c2-bt-lib'
Submodule 'components/bt/controller/lib_esp32c3_family' (https://jihulab.com/esp-mirror/espressi ... bt-lib.git) registered for path 'components/bt/controller/lib_esp32c3_family'
Submodule 'components/bt/controller/lib_esp32c5/esp32c5-bt-lib' (https://jihulab.com/esp-mirror/espressi ... bt-lib.git) registered for path 'components/bt/controller/lib_esp32c5/esp32c5-bt-lib'
Submodule 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib' (https://jihulab.com/esp-mirror/espressi ... bt-lib.git) registered for path 'components/bt/controller/lib_esp32c6/esp32c6-bt-lib'
Submodule 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib' (https://jihulab.com/esp-mirror/espressi ... bt-lib.git) registered for path 'components/bt/controller/lib_esp32h2/esp32h2-bt-lib'
Submodule 'components/bt/esp_ble_mesh/lib/lib' (https://jihulab.com/esp-mirror/espressi ... sh-lib.git) registered for path 'components/bt/esp_ble_mesh/lib/lib'
Submodule 'components/bt/host/nimble/nimble' (https://jihulab.com/esp-mirror/espressif/esp-nimble.git) registered for path 'components/bt/host/nimble/nimble'
Submodule 'components/cmock/CMock' (https://jihulab.com/esp-mirror/ThrowTheSwitch/CMock.git) registered for path 'components/cmock/CMock'
Submodule 'components/esp_coex/lib' (https://jihulab.com/esp-mirror/espressi ... ex-lib.git) registered for path 'components/esp_coex/lib'
Submodule 'components/esp_phy/lib' (https://jihulab.com/esp-mirror/espressi ... hy-lib.git) registered for path 'components/esp_phy/lib'
Submodule 'components/esp_wifi/lib' (https://jihulab.com/esp-mirror/espressi ... fi-lib.git) registered for path 'components/esp_wifi/lib'
Submodule 'components/heap/tlsf' (https://jihulab.com/esp-mirror/espressif/tlsf.git) registered for path 'components/heap/tlsf'
Submodule 'components/json/cJSON' (https://jihulab.com/esp-mirror/DaveGamble/cJSON.git) registered for path 'components/json/cJSON'
Submodule 'components/lwip/lwip' (https://jihulab.com/esp-mirror/espressif/esp-lwip.git) registered for path 'components/lwip/lwip'
Submodule 'components/mbedtls/mbedtls' (https://jihulab.com/esp-mirror/espressif/mbedtls.git) registered for path 'components/mbedtls/mbedtls'
Submodule 'components/mqtt/esp-mqtt' (https://jihulab.com/esp-mirror/espressif/esp-mqtt.git) registered for path 'components/mqtt/esp-mqtt'
Submodule 'components/openthread/lib' (https://jihulab.com/esp-mirror/espressi ... ad-lib.git) registered for path 'components/openthread/lib'
Submodule 'components/openthread/openthread' (https://jihulab.com/esp-mirror/espressif/openthread.git) registered for path 'components/openthread/openthread'
Submodule 'components/protobuf-c/protobuf-c' (https://jihulab.com/esp-mirror/protobuf ... obuf-c.git) registered for path 'components/protobuf-c/protobuf-c'
Submodule 'components/spiffs/spiffs' (https://jihulab.com/esp-mirror/pellepl/spiffs.git) registered for path 'components/spiffs/spiffs'
Submodule 'components/unity/unity' (https://jihulab.com/esp-mirror/ThrowTheSwitch/Unity.git) registered for path 'components/unity/unity'
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/controller/lib_esp32c2/esp32c2-bt-lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/controller/lib_esp32c3_family'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/controller/lib_esp32c5/esp32c5-bt-lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/controller/lib_esp32c6/esp32c6-bt-lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/controller/lib_esp32h2/esp32h2-bt-lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/esp_ble_mesh/lib/lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/bt/host/nimble/nimble'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/cmock/CMock'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/esp_coex/lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/esp_phy/lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/esp_wifi/lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/heap/tlsf'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/json/cJSON'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/lwip/lwip'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/mbedtls/mbedtls'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/mqtt/esp-mqtt'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/openthread/lib'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/openthread/openthread'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/protobuf-c/protobuf-c'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/spiffs/spiffs'...
Cloning into 'C:/esp/v5.5.3/esp-idf/components/unity/unity'...
fatal: bad config line 2 in file C:/esp/v5.5.3/esp-idf/.git/modules/components/bt/controller/lib_esp32/config
(venv) PS C:\esp\v5.5.3\esp-idf>