实用工具安装

下载/调试工具

配合cargo可以一键下载运行程序,也可以单独使用,用于烧录并复位芯片。

cargo install probe-rs-tools

单独使用probe-rs

# 将xxx.elf固件烧录到目标芯片
probe-rs download xxx.elf --chip STM32F405RG
# 复位目标芯片
probe-rs reset --chip STM32F405RG

零碎工具

cargo install cargo-binutils
rustup component add llvm-tools

包含以下这些工具

Cargo 封装工具Rust 原生底层工具
cargo-cov.exerust-ar.exe
cargo-nm.exerust-as.exe
cargo-objcopy.exerust-cov.exe
cargo-objdump.exerust-ld.exe
cargo-profdata.exerust-lld.exe
cargo-readobj.exerust-nm.exe
cargo-size.exerust-objcopy.exe
cargo-strip.exerust-objdump.exe
rust-profdata.exe
rust-readobj.exe
rust-size.exe
rust-strip.exe

使用cargo-size 查看固件大小

D:\MCU-Projects\STM32-Projects\RUST\h7\embassy\embassy_h7_blink>cargo size
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.16s
   text    data     bss     dec     hex filename
  31488      80    5532   37100    90ec embassy_h7_blink