我重新安装了 ESP-IDF,但无法将目标更改为 esp32s2。
C:\esp\projects\hello_world>idf.py set-target esp32s2
Adding "set-target"'s dependency "fullclean" to list of commands with default set of op
tions.
Executing action: fullclean
Executing action: set-target
Set Target to: esp32s2, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory c:\esp\projects\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32s2 -DCCACHE_ENABLE=1 c:\esp\projects\hello_world"...
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.29.2.windows.3")
CMake Error at C:/esp/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):
C:/esp/esp-idf/tools/cmake/project.cmake:35 (__target_init)
CMakeLists.txt:5 (include)
-- Configuring incomplete, errors occurred!
cmake failed with exit code 1
构建项目会成功但闪烁失败,因为我有一个 esp32s2 芯片。
A fatal error occurred: This chip is ESP32-S2 not ESP32. Wrong --chip argument?
CMake Error at run_serial_tool.cmake:50 (message):
C:/esp/.espressif/python_env/idf4.3_py3.9_env/Scripts/python.exe
C:/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 failed
我的环境是最新的Python,最新的git,今天的ESP-IDF master分支,esp-idf-tools-setup-2.3。
git clone --recursive
https://github.com/espressif/esp-idf.git
谁能告诉我如何创建一个有效的 ESP32S2 构建环境?