Skebのリクエストありがとうございました🌸
433 字
2 分钟
用rust开发esp32的基础流程
在安装好Rust开发环境的基础上进行:
一、安装ESP32 Rust工具
esp32的rust开发工具链由espup这个工具进行管理
cargo install espup安装对应esp32型号target的工具链,例如esp32s3的Xtensa工具链
espup install --targets esp32s3安装烧录工具espflash
cargo install espflash二、烧录和监视串口
如果使用串口进行烧录
直接使用Cargo runner进行烧录
cargo +esp run --release这个runner是在.cargo/config.toml中定义的
[build]target = "xtensa-esp32s3-none-elf"
[target.xtensa-esp32s3-none-elf]runner = "espflash flash --monitor"rustflags = [ "-C", "link-arg=-Tlinkall.x",]
[unstable]build-std = ["core"]或者可以用espflash指定串口进行烧录
espflash flash --monitor --port /dev/ttyUSB0 target/xtensa-esp32s3-none-elf/release/ir_imu_ble_esp32_rust烧录日志
cargo +esp run --release Finished `release` profile [optimized + debuginfo] target(s) in 0.09s Running `espflash flash --monitor target/xtensa-esp32s3-none-elf/release/ir_imu_ble_esp32_rust`[2026-06-10T08:40:08Z INFO ] Serial port: '/dev/ttyUSB0'[2026-06-10T08:40:08Z INFO ] Connecting...[2026-06-10T08:40:08Z INFO ] Using flash stubChip type: esp32s3 (revision v0.2)Crystal frequency: 40 MHzFlash size: 8MBFeatures: WiFi, BLE, Embedded FlashMAC address: 70:04:1d:d5:0a:a4App/part. size: 87,072/8,323,072 bytes, 1.05%[00:00:01] [========================================] 1/1 0x0 Verifying... OK![00:00:00] [========================================] 1/1 0x8000 Verifying... OK![00:00:02] [========================================] 2/2 0x10000 Verifying... OK! [2026-06-10T08:40:13Z INFO ] Flashing has completed!Commands: CTRL+R Reset chip CTRL+C Exit
ESP-ROM:esp32s3-20210327Build:Mar 27 2021rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)SPIWP:0xeemode:DIO, clock div:2load:0x3fce2820,len:0x158cload:0x403c8700,len:0xd24load:0x403cb700,len:0x2f34entry 0x403c8924I (29) boot: ESP-IDF v5.5.1-838-gd66ebb86d2e 2nd stage bootloaderI (30) boot: compile time Nov 26 2025 12:27:56I (30) boot: Multicore bootloaderI (31) boot: chip revision: v0.2I (34) boot: efuse block revision: v1.3I (38) boot.esp32s3: Boot SPI Speed : 40MHzI (42) boot.esp32s3: SPI Mode : DIOI (45) boot.esp32s3: SPI Flash Size : 8MBI (49) boot: Enabling RNG early entropy source...I (54) boot: Partition Table:I (56) boot: ## Label Usage Type ST Offset LengthI (63) boot: 0 nvs WiFi data 01 02 00009000 00006000I (69) boot: 1 phy_init RF data 01 01 0000f000 00001000I (76) boot: 2 factory factory app 00 00 00010000 007f0000I (82) boot: End of partition tableI (85) esp_image: segment 0: paddr=00010020 vaddr=3c000020 size=01ecch ( 7884) mapE (93) boot_comm: Image requires efuse blk rev >= v128.5, but chip is v1.3E (99) boot: Factory app partition is not bootableE (104) boot: No bootable app partitions in the partition table 用rust开发esp32的基础流程
https://haoyn231.github.io/posts/嵌入式/用rust开发esp32的基础流程/ 评论