因开发需求,需要用到esp-idf,在下载离线版本ESP-IDF V5.3.3后出现在编译后链接阶段出现找不到 idf.py 文件导致编译失败
误认为为VSCode+ESP-IDF开发环境配置错误,参照https://blog.csdn.net/RMDYBW/article/details/134427681%E5%B8%96%E5%AD%90%EF%BC%8C%E8%BF%9B%E8%A1%8C%E4%BA%86VSCode%E5%92%8CESP-IDF%E7%9A%84%E9%87%8D%E8%A3%85%E5%B7%A5%E4%BD%9C%E3%80%82
接着,在重新装好后出现了找不到CMAKE相关文件的错误
终端反馈
\build -S e:\Labora_work\cqut_PowerRune\PowerRune24-Motor -DSDKCONFIG='e:\Labora_work\cqut_PowerRune\PowerRune24-Motor\sdkconfig'
-- Compile mode: ReleaseMode
-- Version: v1.0.2
CMake Error at CMakeLists.txt:25 (include):
include could not find requested file:
e:\ESP-IDF\Espressif-5.3.4\v5.3.4\esp-idf/tools/cmake/project.cmake
-- The C compiler identification is GNU 15.2.0
-- The CXX compiler identification is GNU 15.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw64/bin/cc.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:/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
* 终端进程“E:\STM32\STM32CLT\CLT\STM32CubeCLT_1.19.0\CMake\bin\cmake.exe '-G', 'Ninja', '-DPYTHON_DEPS_CHECKED=1', '-DESP_PLATFORM=1', '-B', 'e:\Labora_work\cqut_PowerRune\PowerRune24-Motor\build', '-S', 'e:\Labora_work\cqut_PowerRune\PowerRune24-Motor', '-DSDKCONFIG='e:\Labora_work\cqut_PowerRune\PowerRune24-Motor\sdkconfig''”已终止,退出代码: 1。
查询AI后(本人为在校学生,自主排错能力欠缺)
确定是缺少project.cmake文件
下附cmakelist
# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
set(DEBUG_VERSION "DebugMode")
set(RELEASE_VERSION "ReleaseMode")
set(COMPILE_MODE ${RELEASE_VERSION}) # 编译模式
string(TIMESTAMP COMPILE_TIME %y%m%d%H%M) # 生成编译时间
set(VERSION_MAJOR 1) # 一级版本号
set(VERSION_MINOR 0) # 二级版本号
set(VERSION_LEVEL3 2) # 三级版本号
# Debug模式(目标:上一个版本号+编译时间)
if(${COMPILE_MODE} MATCHES ${DEBUG_VERSION})
message(STATUS "Compile mode: ${COMPILE_MODE}")
set(PROJECT_VER v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_LEVEL3}-${COMPILE_TIME}-debug)
message(STATUS "Version: ${PROJECT_VER}")
# Release模式(目标:版本号)
else()
message(STATUS "Compile mode: ${COMPILE_MODE}")
set(PROJECT_VER v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_LEVEL3})
message(STATUS "Version: ${PROJECT_VER}")
endif()
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(PowerRune24-Motor)
确定报错为include($ENV{IDF_PATH}/tools/cmake/project.cmake)这一句,在搜索网络时未找到解决方案,特此发问寻求提出解决方案