rust-embedded
Installation
SKILL.md
Embedded Development
Domain Constraints
| Domain Rule | Design Constraint | Rust Implication |
|---|---|---|
| No heap | Stack allocation | heapless, no Box/Vec |
| No std | Core only | #![no_std] |
| Real-time | Predictable timing | No dynamic alloc |
| Resource limited | Minimal memory | Static buffers |
| Hardware safety | Safe peripheral access | HAL + ownership |
| Interrupt safe | No blocking in ISR | Atomic, critical sections |
Critical Rules
- Cannot use heap (no allocator) — use
heapless::Vec<T, N>and arrays for deterministic memory. - Shared state must be interrupt-safe — ISR can preempt at any time. Use
Mutex<RefCell<T>>+ critical section. - Peripherals must have clear ownership — HAL takes ownership via singletons to prevent conflicting access.