【填坑】ESP-IDF 环境安装常见报错信息和解决方案

Windows 平台 ESP-IDF 环境安装常见报错信息和解决方案

一、install 时报错

Q1 : 错误信息:Download failed 操作超时 或者 installation has failed with exit code -2

在这里插入图片描述

A1:原因和解决方法:网络问题,请换个网络环境重试,如果实在下不下来,可参考以下链接手动安装

Q2 : 错误信息:Download failed: an error occurred in the secure channel support

一般在 Windows 7 比较老的版本出现
在这里插入图片描述

A2:原因和解决方法:下载工具问题,试用以下方法解决

方法一:手动下载安装 python 和 git,然后再试用该工具搭建

方法二:全程手动搭建环境, 如何使用 Gitee 快速搭建 ESP-IDF 开发环境(Windows 版本)

方法三:更新Windows WinHTTP的默认安全协议为TLS 1.1和TLS 1.2

Q3 : 错误信息:‘python’:permission denied

A3:原因和解决方法:系统未安装 python 或 未添加 python 的环境变量

在这里插入图片描述

二、export.bat 时报错

Q1. 错误信息:’.’ 不是内部或外部命令,也不是可运行的程序
>C:\esp-idf>. .\export.bat
'.' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

A1.原因和解决方法: Windows 平台不需要加 . ,去掉即可

C:\esp-idf>.\export.bat
Setting IDF_PATH: C:\esp-idf

Adding ESP-IDF tools to PATH...
WARNING: directory for tool riscv-none-embed-gcc version riscv-none-embed-gcc-8.2.0 is present, but tool was not found
    C:\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin
    C:\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin
    C:\.espressif\tools\xtensa-esp32s3-elf\esp-2020r3-8.4.0\xtensa-esp32s3-elf\bin
    C:\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
    C:\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
    C:\.espressif\tools\cmake\3.16.4\bin
    C:\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200709\openocd-esp32\bin
    C:\.espressif\tools\ninja\1.10.0\
    C:\.espressif\tools\idf-exe\1.0.1\
    C:\.espressif\tools\ccache\3.7\
    C:\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64
    C:\.espressif\python_env\idf4.3_py3.7_env\Scripts
    C:\esp-idf\tools

Checking if Python packages are up to date...
Python requirements from C:\esp-idf\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build
Q2. 错误信息:File “…\lib\subprocess.py”, line 1207, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

在这里插入图片描述

A2.原因和解决方法:该问题是 git 安装时没有勾选添加环境变量

C:\Program Files\Git\cmd 添加到环境变量,具体路径按照 git 的安装位置确定

在这里插入图片描述

三、idf.py build 时报错

Q1. 错误信息: idf.py 不是内部或外部命令,也不是可运行的程序

A1.原因和解决方法:每一个新开窗口都需要重新运行 export.bat 添加环境变量

查看:设置环境变量 Set up the environment variables

Q2. 错误信息: Windows requires an MSYS2 version of gcc on the PATH to build mconf-idf.
$ idf.py build
Executing action: all (aliases: build)
Running cmake in directory c:\esp-idf\examples\get-started\hello_world\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DCCACHE_ENABLE=1 c:\esp-idf\examples\get-started\hell
o_world"...
-- Found Git: C:/Program Files/Git/mingw64/bin/git.exe (found version "2.30.0.windows.1")
CMake Error at C:/esp-idf/tools/cmake/kconfig.cmake:30 (message):
  Windows requires an MSYS2 version of gcc on the PATH to build mconf-idf.
  Consult the setup docs for ESP-IDF on Windows.
Call Stack (most recent call first):
  C:/esp-idf/tools/cmake/build.cmake:162 (__kconfig_init)
  C:/esp-idf/tools/cmake/idf.cmake:49 (__build_init)
  C:/esp-idf/tools/cmake/project.cmake:7 (include)
  CMakeLists.txt:5 (include)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1

A2.原因和解决方法:使用 installer 工具或者使用 install.sh 安装的 4.0+ 以上版本的 IDF,不支持在 MinGW 中编译,需要使用命令提示符 CMD 去编译

  • 10
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值