4.
3. 配置WSL环境
- 运行IDF路径下的
./install.sh
安装工具;然后运行. ./export.sh
导入IDF环境。 - 可能出现
export.sh: line 2: $'\r': command not found
和detect_python.sh: line 13: syntax error near unexpected token '$'do\r''
等,是因为换行符问题。 - 使用
dos2unix
修改下换行符,如dos2unix install.sh
,同样修改export.sh
和./tools/detect_python.sh
。 - 如果缺少
cmake
,像'cmake' must be available on the PATH to use idf.py
,就sudo apt-get update
,然后sudo apt-get install cmake
。 - 如果
idf.py -p /dev/ttyS3 flash
失败,加入-b 115200
调低波特率试试。
2. 切换不同版本IDF
- 方法1:用
ESP-IDF Tools Installers
安装不同版本的IDF的快捷方式。 - 方法2:运行
CMD.exe
,进入不同IDF路径,运行目录下的export.bat
。 - 链接:https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/get-started/windows-setup.html
Create a copy of the shortcut created by the ESP-IDF Tools Installer, and change the working directory of the new shortcut to the ESP-IDF directory you wish to use.
Alternatively, run cmd.exe, then change to the ESP-IDF directory you wish to use, and run export.bat. Note that unlike the previous option, this way requires Python and Git to be present in PATH. If you get errors related to Python or Git not being found, use the first option.
1. 最简单地配置环境
- 下载官方安装工具:ESP-IDF Tools Installers
- 打开桌面快捷方式
PowerShell
或者CMD
。 - 链接:https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/get-started/windows-setup.html