我有一个带有 ULP 模块的 esp-idf 程序,如下所示:
idf_component_register(SRCS "ulp-experiment.c" INCLUDE_DIRS "." REQUIRES ulp)
# a name for the app that runs on the low power chip
set(ulp_app_name lp_core_main)
# sources for the program that runs on the low power chip
set(ulp_sources "ulp/ulp.c")
# sources that run on the main CPU and need to directly include generated interfaces to low power device
set(ulp_exp_dep_srcs "ulp-experiment.c")
# embed the low power program into the main program
ulp_embed_binary(${ulp_app_name} "${ulp_sources}" "${ulp_exp_dep_srcs}")
我正在为esp32c6芯片编译。
当我使用 idf.py build 构建时,我得到:
CMake 错误位于 /home/alex/code/esp-idf/tools/cmake/tool_version_check.cmake:36(消息):
Tool doesn't match supported version from list ['2.35_20220830']:
/usr/bin/cc
Please try to run 'idf.py fullclean' to solve it.
Call Stack (most recent call first):
CMakeLists.txt:15 (check_expected_tool_version)
我尝试按照建议运行 idf.py fullclean,但没有帮助。我应该怎么做才能解决这个问题?
检查 /usr/bin/cc 的版本会给出以下结果:
$ /usr/bin/cc --version
cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
我不确定为什么框架要访问我的常规 C 编译器。我以为它有自己的适用于 esp32c6 架构的 C 编译器。
构建日志的相关部分如下所示:
[123/274] Building C object esp-idf/esp_lcd/CMakeFiles/__idf_esp_lcd.dir/src/esp_lcd_panel_io_i2c_v1.c.obj
[124/274] Building C object esp-idf/esp_hid/CMakeFiles/__idf_esp_hid.dir/src/esp_hidh.c.obj
[125/274] Building C object esp-idf/console/CMakeFiles/__idf_console.dir/argtable3/arg_rex.c.obj
[126/274] Performing configure step for 'lp_core_main'
FAILED: esp-idf/main/lp_core_main-prefix/src/lp_core_main-stamp/lp_core_main-configure /home/alex/code/maple-gateboard/ulp-experiment/build/esp-idf/main/lp_core_main-prefix/src/lp_core_main-stamp/lp_core_main-configure
解决方案是运行
idf.py menuconfig
并启用 ULP 模块。