1.安装clang环境
clang
2.安装cargo命令
cargo install cargo-generate
cargo install ldproxy
cargo install espflash
cargo install espmonitor
3.安装esp idf环境
esp idf
4.从模板创建工程
从idf打开配置好的环境
通过模板创建工程
cargo generate --vcs none --git https://github.com/esp-rs/esp-idf-template cargo
创建过程回提示输入工程名,rust的版本这里选择nightly,是否使用stb,idf的版本这里选4.4,是否产生git vscode配置
- 编译烧录
cd 工程
cargo build编译
编译过程中碰到了
错误
不太清楚是不是最新的库有问题了将embuild在cargo.lock中强制绑定到0.29.1就可以编译过了
烧录使用
espflash comX target\riscv32imc-esp-espidf\debug\mytest
[[package]]
name = "embuild"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bc16ec3ed3e8c7bfa3d03dd02c5db29a7bc2ed906f3c34cb986778c3f969248"
dependencies = [
"anyhow",
"bindgen",
"bitflags",
"cargo_toml",
"cmake",
"dirs",
"globwalk",
"log",
"remove_dir_all 0.7.0",
"serde",
"serde_json",
"shlex",
"strum",
"tempfile",
"thiserror",
"toml",
"ureq",
"which",
"xmas-elf",
]