报错信息
(1)在使用ESP32IDF的时候出现了如下报错
-- Found Git: D:/git/soft/Git/cmd/git.exe (found version "2.38.1.windows.1")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: F:/HoloCubic/IDF/Enter_ESP-IDF_Tools_directory/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: F:/HoloCubic/IDF/Enter_ESP-IDF_Tools_directory/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-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: F:/HoloCubic/IDF/Enter_ESP-IDF_Tools_directory/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-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
Dependencies lock doesn't exist, solving dependencies.
...................................................................................................................................................................................................................CMake Error at F:/HoloCubic/IDF/Enter_ESP-IDF_container_directory/esp-idf/tools/cmake/build.cmake:540 (message):
HINT: Component "espressif/esp-box" has suitable versions for other
targets: "esp32s3". Is your current target "esp32" set correctly?
ERROR: Solver failed processing dependency "espressif/esp-box" from the
manifest file
"F:/HoloCubic/github_esp_box_V0.5.0/esp-box/components/bsp\idf_component.yml".
Cannot find versions of "espressif/esp-box" satisfying "3.*" for the
current target "esp32".
Call Stack (most recent call first):
F:/HoloCubic/IDF/Enter_ESP-IDF_container_directory/esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
CMakeLists.txt:13 (project)
-- Configuring incomplete, errors occurred!
See also "F:/HoloCubic/github_esp_box_V0.5.0/esp-box/examples/factory_demo/build/CMakeFiles/CMakeOutput.log".
vscode解决办法
(1)打开芯片型号配置界面
(2)设置芯片型号
(3)设置芯片与电脑连接方式,因为我的采用的USB连接,所以选中第二个。
采用命令行处理办法
(1)如果是使用的命令行的话,就只需要输入下面这个命令即可。
idf.py set-target <target>
# 示例
idf.py set-target esp32s3
(2)注意,如果是在vscode命令行中使用这条命令,将不能设置成功,并且出现如下报错。
Target 'esp32' specified on command line is not consistent with target 'esp32s3' in the environment.
验证
(1)打开sdkconfig文件
(2)按ctrl+f
搜索CONFIG_IDF_TARGET
(3)查看是不是目标芯片,例如我是esp32s3型号的芯片,那么就是CONFIG_IDF_TARGET="esp32s3"
如果是esp32型号的芯片,就是CONFIG_IDF_TARGET="esp32"