7.7 Rust and TinyML
Two technologies showing up in embedded job descriptions: memory-safe firmware in Rust, and running quantised machine-learning models on microcontrollers.
Lessons
- Rust for embedded · Ownership and borrowing, no_std, embedded-hal, RTIC and Embassy.
- Rust patterns for C programmers · Result and ?, Option, enums as state machines, type-state and calling C.
- TinyML: machine learning on MCUs · Quantised models, TensorFlow Lite Micro and fitting the budget.
- Features for TinyML · Windows, RMS and band energy, Goertzel, normalisation and a nearest-centroid classifier.
Project: Gesture remote
A TV remote you flick and wave instead of pressing: a quantised neural network run in integer arithmetic on a microcontroller without an FPU, fed features computed exactly as in training.