1.以前一直用arduino来编写esp8266,由于最近想尝试esp32系列的s3,所以决定搭建esp-idf的开发环境

#这个是乐鑫官网,Wireless SoCs, Software, Cloud and AIoT Solutions | Espressif SystemsEspressif is a global high-tech leader in wireless communication, IoT, AI SoCs, software, and solutions, for a smarter and greener future.https://www.espressif.com.cn/en
https://www.espressif.com.cn/en
观望中看到一系列的解决方案,都大概点开看了一眼
#这个是乐鑫的组件和案例,先看一眼

ESP Component RegistryESP Component Registryhttps://components.espressif.com/
https://components.espressif.com/#下面这个是对应的芯片开发文档

ESP-IDF Getting Started | Espressif SystemsESP-IDF is Espressif’s official IoT Development Framework for the ESP32, ESP32-S and ESP32-C series of SoCs. It provides a self-sufficient SDK for any generic application development on these platforms, using programming languages such as C and C++. ESP-IDF currently powers millions of devices in the field, and enables building a variety of network-connected products, ranging from simple light bulbs and toys to big appliances and industrial devices.https://idf.espressif.com/
https://idf.espressif.com/#这回由于要使用S3,所以这个是S3的开发文档

API 参考 - ESP32-S3 - — ESP-IDF 编程指南 v5.4 文档https://docs.espressif.com/projects/esp-idf/zh_CN/v5.4/esp32s3/api-reference/index.html
https://docs.espressif.com/projects/esp-idf/zh_CN/v5.4/esp32s3/api-reference/index.html大概介绍就这些了,需要用的时候找对应的链接
2.下载esp-idf
有个尴尬的事,乐鑫居然把代码全部放在github上,这事是挺专业,就是访问起来要刷好几遍,看运气,实在不行就那啥吧,他X的github

https://github.com/espressif/esp-idf?tab=readme-ov-filehttps://github.com/espressif/esp-idf?tab=readme-ov-file
https://github.com/espressif/esp-idf?tab=readme-ov-file
下载后解压缩,我放在了c盘【这里提示,下载的不可以用,还是直接建立仓库才行,后面会讲怎么建立,路径位置一致】

里面有安装脚本,本人是windows系统,所以直接执行install.bat就行
打开cmd,执行

然后再运行export.bat
这么搞有个前提是需要安装有git
Git - Downloading Packagehttps://git-scm.com/downloads/win
https://git-scm.com/downloads/win

然后python要升级,

再下来,手工命令行安装,会要去github下载,他X的,后面我试试自动安装
每次碰到这种事,就突然觉得马斯克很牛逼,很佩服那位钢铁侠

下载贼长贼慢,我这么试试看,完事后准备自动安装吧。太慢了,辣鸡

安装成功
再执行export.bat

测一下
cd C:\esp-idf-master\esp-idf-master\examples\get-started\hello_world
自带了一个hellowrold
idf.py build
这时候就会碰到提示

这个就是因为不是通过git建立的,直接下载了zip还不行,所以重新来过。
git clone --recursive https://github.com/espressif/esp-idf.git C:\esp-idf-master\esp-idf-master
然后再试一次编译

这回终于成功编译了
#关于卸载,
删除目录就行了
方法二,官方提供了一个安装工具,这个挺好啊,我试了试,用这个也可以安装

Windows 平台工具链的标准设置 - ESP32 - — ESP-IDF 编程指南 latest 文档https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/windows-setup.html
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/windows-setup.html

然后下载,我选择了V5.4,安装包太大啦

安装完成,跳出来集成环境的cmd
直接编译,成了,太简单了,还是自动安装靠谱。哈哈哈哈
