
Ferris the Rustacean
So what the bl**k have I learnt from implementing the Hello World app of the embedded world using Rust/Embassy on various MCU platforms? Here's list of what I can remember 😉:
- The Instruction Set Architecture (ISA) doesn't come into it at all. Rust is a high level language and as long as the target processor is decent, it can be available. In practice this means at least 32-bit wide, and sufficient registers, then LLVM can handle it, though some exceptions like AVR exist.
- Maturity of the implementation depends on available information and/or processor maker sponsorship. The RPi Pico, STM32 series, and Espressif MCUs are well supported. Support for the WCH32 series depends on hacker contributions.
- The implementations differ in their support for peripherals. Basic peripherals like GPIO, I2C, etc. are not an issue. But if you want to use say BLE, WiFi, etc. check that Embassy crates exist for them.
- Development status is fluid and documents on the Net can go out of date quickly so be prepared to question what you read. However you can pin your project to particular versions of the toolchain and crates.
- Rustup and Cargo are the fundamental tools for managing toolchains and projects from the CLI. GUIs exist, but I haven't explored those.
- The Embassy framework implements efficient embedded multitasking.
- You will need more code memory because the language is rich, but remember that implementing those features in another language will also cost code memory. In any case even entry level MCUs with adequate specs are cheap now.
- Probe-rs is a great tool for flashing and debugging and can be used for non-Rust projects too so if you can only take away one thing, let this be it.
Ken Yap
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.