ESP32-s3 hello world

安装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仓库

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值