ESP8266开发环境搭建

ESP8266与Clion开发环境配置

克隆

1
git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git

安装依赖

最好就是独立创建一个python的虚拟环境来配置

1
pip install --user -r 克隆下来的路径/requirements.txt

下载工具链

下载好随便丢一个目录,后面的环境变量配置需要添加上去。

image-20231211013902935

clion配置

path是必须配置的,PYTHON是看情况

上面三个是利用串口烧录也就是flash要用到的。

环境变量最好是也钩上,不然出什么问题也不知道。

image-20231211013649110

8266环境变量

ESPBAUD 115200
ESPPORT COM3
IDF_PATH F:/Desktop/ESP8266/ESP8266_RTOS_SDK
MONITORBAUD 115200
path F:/Desktop/ESP8266/xtensa-lx106-elf/bin;C:/Users/19693/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin;C:/Users/19693/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin;C:/Users/19693/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin;C:/Users/19693/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin;C:/Users/19693/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin;C:/Users/19693/.espressif/tools/cmake/3.24.0/bin;C:/Users/19693/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin;C:/Users/19693/.espressif/tools/ninja/1.11.1/;C:/Users/19693/.espressif/tools/idf-exe/1.0.3/;C:/Users/19693/.espressif/tools/ccache/4.8/ccache-4.8-windows-x86_64;C:/Users/19693/.espressif/tools/dfu-util/0.11/dfu-util-0.11-win64;C:/Users/19693/.espressif/python_env/idf5.3_py3.11_env/Scripts;C:/Users/19693/esp/esp-idf/tools;D:/Mincoda/condabin;C:/Program Files (x86)/Common Files/Oracle/Java/javapath;D:/CudaDevelopment/bin;D:/CudaDevelopment/libnvvp;C:/Windows/system32;C:/Windows;C:/Windows/System32/Wbem;C:/Windows/System32/WindowsPowerShell/v1.0/;C:/Program Files (x86)/NVIDIA Corporation/PhysX/Common;C:/Program Files/NVIDIA Corporation/NVIDIA NvDLISR;C:/Program Files/dotnet/;D:/Qt/6.2.4/msvc2019_64/bin;D:/Qt/6.2.4/mingw_64/bin;D:/Nodejs/;C:/Program Files/NVIDIA Corporation/Nsight Compute 2022.3.0/;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/lib/x64;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include;D:/wifi;D:/12.2 rel1/bin;D:/OpenOCD-20230712-0.12.0/bin;D:/Qt/Tools/mingw1120_64/bin;C:/Windows/System32/OpenSSH;D:/mingw64/bin;D:/cmake/bin;C:/Users/19693/esp/esp-idf;D:/Mincoda;D:/Mincoda/Scripts;D:/Bandizip;C:/Program Files (x86)/STMicroelectronics/STM32 ST-LINK Utility/ST-LINK Utility;D:/Git/cmd;C:/Users/19693/esp32bat;D:/12.2 rel1/bin;C:/Users/19693/AppData/Local/Microsoft/WindowsApps;D:/CLion 2023.1.1/bin;D:/Qt/6.2.4/msvc2019_64/bin;D:/Qt/6.2.4/mingw_64/bin;C:/Users/19693/AppData/Roaming/npm;D:/PyCharm 2023.1/bin;D:/Microsoft VS Code/bin;C:/Users/19693/AppData/Local/gitkraken/bin;c:/users/19693/appdata/roaming/python/python311/scripts;c:/users/19693/.local/bin;C:/Users/19693/esp/esp-idf;D:/Mincoda;;E:/oh-my-posh/bin;E:/CLion 2023.3/bin;;F:/IntelliJ IDEA 2023.2.5/bin;
PYTHON D:/Mincoda/python.exe

常见错误

没有指定python造成的,需要在cmake的环境变量中指定python。这里调用了系统默认的python,但是我们其实用的不是这个。

image-20231210232707405

Cmake过了,但是报头文件错误

莫名其妙,重刷几次都不行,然后等了一会就行了

image-20240116205417305

参考资料


ESP8266开发环境搭建
https://blog.xsaistudio.cn/uncategorized/2023/12/10/单片机/ESP8266开发环境搭建/
作者
YWM
发布于
2023年12月10日
许可协议