串口下载报错,如何切换芯片型号

bravosix
Posts: 3
Joined: Tue Sep 07, 2021 5:01 am

串口下载报错,如何切换芯片型号

Postby bravosix » Tue Sep 07, 2021 5:05 am

在Windows上使用VScode进行编译LED例程下载,
提示A fatal error occurred: This chip is ESP32-C3 not ESP32. Wrong --chip argument?,
如何切换芯片型号

ESP_ICY
Posts: 404
Joined: Mon Aug 23, 2021 11:10 am

Re: 串口下载报错,如何切换芯片型号

Postby ESP_ICY » Tue Sep 07, 2021 6:45 am

使用命令

Code: Select all

 idf.py set-target xxxx
,比如你要用 ESP32 系列芯片,就写

Code: Select all

idf.py set-target esp32
,详细可以查看IDF编程指南中的该部分:https://docs.espressif.com/projects/esp ... idf-target

bravosix
Posts: 3
Joined: Tue Sep 07, 2021 5:01 am

Re: 串口下载报错,如何切换芯片型号

Postby bravosix » Wed Sep 08, 2021 1:53 am

芯片类型已改为esp32c3,但仍出现报错
[469/961] Performing configure step for 'bootloader'
FAILED: bootloader-prefix/src/bootloader-stamp/bootloader-configure
cmd.exe /C "cd /D C:\Users\chen\esp\esp-idf\examples\get-started\test2\blink\build\bootloader && C:\Users\chen\esp\.espressif\tools\cmake\3.16.4\bin\cmake.exe -DSDKCONFIG=C:/Users/chen/esp/esp-idf/examples/get-started/test2/blink/sdkconfig -DIDF_PATH=C:/Users/chen/esp/esp-idf -DIDF_TARGET=esp32c3 -DPYTHON_DEPS_CHECKED=1 -DPYTHON=C:/Users/chen/esp/.espressif/python_env/idf4.3_py3.8_env/Scripts/python.exe -DEXTRA_COMPONENT_DIRS=C:/Users/chen/esp/esp-idf/components/bootloader -DLEGACY_INCLUDE_COMMON_HEADERS= -GNinja C:/Users/chen/esp/esp-idf/components/bootloader/subproject && C:\Users\chen\esp\.espressif\tools\cmake\3.16.4\bin\cmake.exe -E touch C:/Users/chen/esp/esp-idf/examples/get-started/test2/blink/build/bootloader-prefix/src/bootloader-stamp/bootloader-configure"
-- Found Git: C:/Users/chen/esp/.espressif/tools/idf-git/2.30.1/cmd/git.exe (found version "2.30.1.windows.1")
CMake Error at C:/Users/chen/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:/Users/chen/esp/esp-idf/tools/cmake/project.cmake:35 (__target_init)
CMakeLists.txt:34 (include)

ESP_ICY
Posts: 404
Joined: Mon Aug 23, 2021 11:10 am

Re: 串口下载报错,如何切换芯片型号

Postby ESP_ICY » Wed Sep 08, 2021 2:37 am

先执行

Code: Select all

idf.py fullclean
或者

Code: Select all

rm -rf build/
操作清除刚才已经编译好的 build文件夹然后再设置新的芯片型号,再执行

Code: Select all

idy.py build 
进行重新烧录。

Who is online

Users browsing this forum: No registered users and 69 guests