关于 VS code idf.py set-target esp32s3指令的报错

Moderator: ESP_ZT

cqf123
Posts: 6
Joined: Sun Jun 12, 2022 8:02 am

关于 VS code idf.py set-target esp32s3指令的报错

Postby cqf123 » Mon Jun 20, 2022 12:17 pm

VS Code 在ESP_IDE终端输入 idf.py set-target esp32s3 报错
报错信息为
————————————————————————
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Executing action: set-target
Set Target to: esp32s3, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory d:\esp\esp\project\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=1 d:\esp\esp\project\hello_world"...
CMake Error at D:/ESP/ESP_IDE/esp-idf/tools/cmake/targets.cmake:19 (message):
IDF_TARGET in CMake cache does not match IDF_TARGET environment variable.
To change the target, clear the build directory and sdkconfig file, and
build the project again
Call Stack (most recent call first):
D:/ESP/ESP_IDE/esp-idf/tools/cmake/project.cmake:7 (__target_init)
CMakeLists.txt:5 (include)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1
————————————————————————————
输入idf.py clean 重试依然报错 请问应该怎么解决

ESP_Bob
Posts: 80
Joined: Fri Nov 27, 2020 12:52 pm

Re: 关于 VS code idf.py set-target esp32s3指令的报错

Postby ESP_Bob » Tue Jun 21, 2022 2:53 am

看起来是由于 IDF 插件图型界面和命令行混合使用导致的冲突

如果命令行是 powershell,执行:

Code: Select all

del Env:\IDF_TARGET
idf.py fullclean
idf.py set-target esp32s3

如果命令行是 CMD,执行:

Code: Select all

set IDF_TARGET= #等号后为空,等于删除该环境变量
idf.py fullclean
idf.py set-target esp32s3

建议、要么连续使用插件的 UI 图标操作,要么完全使用命令行

Who is online

Users browsing this forum: No registered users and 12 guests