安装CP210x驱动
驱动链接https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads
ESP32-S3 支持两种下载方式:UART0 下载和 USB 下载
ESP32S3 固件烧录需满足的硬件环境整理
vscode激活虚拟环境
点击右下角的环境配置,然后点击解释器选择,选这个虚拟环境中scripts中的python.exe就可以了
构建工程
使用vscode创建工程后,可以通过下面的方式进入命令行构建工程并烧录等操作
1.设置烧录的目标
idf.py --list-targets #查看支持的列表
idf.py set-target esp32s3 #设置自己的目标芯片
idf.py menuconfig #可以使用可视化桌面做Wi-Fi 网络名称、密码和处理器速度等配置,也可以跳过
查询后会打印出以下几种芯片
2.构建工程
idf.py build #构建工程
$ idf.py build
Running cmake in directory /path/to/hello_world/build
Executing "cmake -G Ninja --warn-uninitialized /path/to/hello_world"...
Warn about uninitialized values.
-- Found Git:/usr/bin/git (found version "2.17.0")
-- Building empty aws_iot component due to configuration
-- Component names: ...
-- Component paths: ...
... (more lines of build system output)
[527/527] Generating hello-world.bin
esptool.py v2.3.1
Project build complete. To flash, run this command:
../../../components/esptool_py/esptool/esptool.py -p (PORT) -b 921600 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x10000 build/hello-world.bin build 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin
or run 'idf.py -p PORT flash'
如果一切正常,编译完成后将生成 .bin 文件,并有烧录的提示
4.烧录工程
idf.py -p PORT [-b BAUD] flash #
PORT 替换为 ESP32-C3 开发板的串口名称
BAUD 替换为您希望的烧录波特率。默认波特率为 460800
可以通过设备管理器查看自己连接的端口号
5.清除构建
清除构建输出:clean
idf.py clean
此命令可清除 build 目录中的构建输出文件,下次构建时,工程将完全重新构建。注意,使用此选项不会删除 build 文件夹内的 CMake 配置输出。
删除所有构建内容:fullclean
idf.py fullclean
此命令将删除所有 build 目录下的内容,包括 CMake 配置输出。下次构建时,CMake 将重新配置其输出。注意,此命令将递归删除 build 目录下的 所有 文件(工程配置将保留),请谨慎使用
6.监视器
您可以使用 idf.py -p PORT monitor
命令,监视 “hello_world” 工程的运行情况。注意,不要忘记将 PORT 替换为您的串口名称
使用快捷键 Ctrl+]
,可退出 ESP-IDF 监视器。
您也可以运行以下命令,一次性执行构建、烧录和监视过程:
idf.py -p PORT flash monitor
7.擦除 flash
ESP-IDF 支持擦除 flash。请运行以下命令,擦除整个 flash:
idf.py -p PORT erase-flash
若存在需要擦除的 OTA 数据,请运行以下命令:
idf.py -p PORT erase-otadata
擦除 flash 需要一段时间,在擦除过程中,请勿断开设备连接。
【问题解决】ESP32报错:A fatal error occurred: Invalid head of packet (0xE0)
https://blog.csdn.net/p1279030826/article/details/111695334
【问题解决】esp32下载过程报错:Failed to connect to ESP32: No serial data received
https://blog.csdn.net/weixin_45844053/article/details/136361461
【问题解决】版本不匹配:Target ‘esp32s3’ specified on command line is not consistent with target ‘esp32’ in the environment
确保在vscode一致,如果在vscode中设置idf.py set-target esp32s3
不生效,直接使用vscode 交互修改
参考链接:
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/api-guides/tools/idf-py.html#selecting-idf-target
https://docs.espressif.com/projects/esp-idf/zh_CN/v4.3/esp32c3/get-started/index.html#id19
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32s3/get-started/windows-setup.html
https://docs.espressif.com/projects/esp-idf/zh_CN/v5.2.2/esp32s3/get-started/windows-setup.html#get-started-windows-first-steps
ESP-IDF安装及使用总结
ESP-CSI:使用ESP32进行CSI(信道状态信息)采集
与 ESP32-S3 创建串口连接
espressif git仓库