Arduino主页网址:
Software | Arduino
以windows11版本为例:
Arduino IDE最新版本为2.0.3
左边的按钮是直接下载(免捐赠):
下载安装完成后,更改软件默认语言:
默认的库是不支持ESP32的:
需要单独安装支持库:
这里输入ESP32 ARDUINO的网址。
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
如果安装过其他版本的esp32 package,请先删除,再使用本安装包,删除方法:文件管理器地址栏输入 %LOCALAPPDATA%/Arduino15/packages,回车进入,然后删除掉其中的esp32文件夹
安装支持库网址填在这里:
设置一下代理
确认可以从github正常下载文件:
开始下载相关文件
(有些慢,需要有耐心,如果出现错误,重新点击安装并耐心等待下载完成):
"https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2-patch5/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch5-win64.zip":.....
安装完成:
本地安装方式
不推荐,当无法正常访问github时可考虑采用。
路径填入:
例如:
File:///G:/bsp/ESP32/arduino_esp32/package_esp32_index.json
File:///G:/ESP32/package_esp32_index.json
本地包解压并重命名目录为:ESP32
相关资源压缩包百度搜索即可,由于存在与VSCODE兼容问题,不推荐。
Helloworld例程
开发板选择ESP32S3 Dev Module
示例代码:
void setup() {
// put your setup code here, to run once:
Serial.begin(921600);
Serial.print("hello world!\n");
}
void loop() {
// put your main code here, to run repeatedly:
}
编译及烧写
点击右箭头,进行编译及烧写:
烧写完成,等待手动reset:
打开串口监视器:
每按动一次reset键,输出窗口打印:hello world!
LOG文件:
项目使用 250905 字节(19%)的程序存储空间。最大值为 1310720 字节。
个全局变量使用 18928 个字节(5%)的动态内存,剩下 308752 个字节用于局部变量。最大值为 327680 字节。
esptool.py v4.2.1
Serial port COM28
Connecting....
Chip is ESP32-S3
Features: WiFi, BLE
Crystal is 40MHz
MAC: 7c:df:a1:f9:ff:20
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0004dfff...
Compressed 14768 bytes to 10148...
Writing at 0x00000000... (100 %)
Wrote 14768 bytes (10148 compressed) at 0x00000000 in 0.3 seconds (effective 392.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 625.9 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 847.0 kbit/s)...
Hash of data verified.
Compressed 251296 bytes to 140180...
Writing at 0x00010000... (11 %)
Writing at 0x0001d99a... (22 %)
Writing at 0x00023f29... (33 %)
Writing at 0x00029403... (44 %)
Writing at 0x0002e96e... (55 %)
Writing at 0x00033ff6... (66 %)
Writing at 0x0003d5a7... (77 %)
Writing at 0x000448f0... (88 %)
Writing at 0x0004a0b8... (100 %)
Wrote 251296 bytes (140180 compressed) at 0x00010000 in 3.3 seconds (effective 607.7 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...