湖北省网站建设_网站建设公司_页面权重_seo优化
2026/1/2 16:08:03 网站建设 项目流程

一、写在前面

  • 硬件板子:XIAO ESP32 S3 Sense

  • ESP-IDF下载:dl.espressif.cn/dl/esp-idf/ 选择最新的Offline Installer (比如 ESP-IDF v5.4.2), 避免因网络问题导致的下载失败。
    ESP-IDF相当于ESP32的SDK, 开发ESP32程序需要基于ESP-IDF, 编译出的文件才能在ESP32芯片上运行

Espressif-5.4.2
├── IDFdocumentation.html
├── Initialize-Idf.ps1
├── dist
├── esp_idf.json
├── espidf.constraints.v5.4.txt
├── frameworks	# ESP-IDF: https://github.com/espressif/esp-idf
├── idf-env.exe
├── idf-env.json
├── idf_cmd_init.bat
├── python_env
├── tools
├── unins000.dat
└── unins000.exe

二、编译ESP-IDF工程

打开ESP-IDF 5.x Powershell (配置了ESP-IDF的环境变量,包括python, git以及IDF_PATH路径等) (编译工具相关:cmake, ninja等)

进入ESP-IDF目录,选择examples --> get-started --> hello_world

编译HelloWorld工程:

# 查看IDF版本
idf.py --version | ESP-IDF v5.4.2# 查询支持的芯片
idf.py --list-targets# 设置目标芯片 (以esp32s3为例)
idf.py set-target esp32s3# 编译ESP32工程, 会生出xxx.bin文件
idf.py build# 烧录编译的文件
idf.py flash
idf.py flash -p PORT # 通过设备管理器,查看端口COM口# 监控esp32硬件
idf.py monitor
# Ctrl + ] 退出监控

print chip information every 10 seconds

Hello world!
This is esp32s3 chip with 2 CPU core(s), WiFi/BLE, silicon revision v0.2, 2MB external flash
Minimum free heap size: 389956 bytes
  • 通过idf.py menuconfig来修改配置文件
  • 具体地,设置LED类型 (LED strip或GPIO LED) 和LED的GPIO
  CONFIG_BLINK_LED_GPIO=y # LED的类型CONFIG_BLINK_GPIO=21 # LED的GPIO, for XIAO ESP32 Board

参考材料:

  • 【ESP32 开发平台对比:ESP-IDF VS Arduino】 https://www.bilibili.com/video/BV1ry4y1F7rw/
  • idf.py build 编译的底层:https://poe.com/s/JEFV3QshNn0LySZnTwED
  • Seeed Studio XIAO ESP32S3 wiki: https://wiki.seeedstudio.com/cn/xiao_esp32s3_getting_started/

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询