embedded-rust
Installation
SKILL.md
Embedded Rust
Contract
| Field | Bound contract |
|---|---|
| Trigger | A Rust firmware project needs to be set up or fixed: #![no_std] #![no_main] layout, cortex-m-rt startup, probe-rs flashing and log streaming, defmt logging, an RTIC application, or the choice of panic handler. |
| Authority | Reversible local: writes only the project files under the directory the user names (Cargo.toml, .cargo/config.toml, memory.x, src/); rollback is deleting that directory or reverting it in version control. No remote mutation. |
| Side effect | New or edited project files in the named directory. Flashing a board writes the board's flash, which the next cargo run overwrites. |
| Done | cargo build --release produces an ELF for the target triple, cargo run --release flashes it and streams defmt output to the terminal, and exactly one panic handler is linked. |
Inputs
- MCU part and its probe-rs chip name (
probe-rs chip listprints the names). - Core: which Cortex-M or RISC-V core, and whether it has an FPU. This picks the target triple.
- Flash and RAM origin and size from the datasheet (for
memory.x). - Concurrency model: plain
#[entry]loop, RTIC, or Embassy. - Debug probe on hand, or none (this picks the panic handler and the
defmttransport).