Embedded Rust – Wrap Up 2023
2023 was an exciting year for the two of us.
Having worked with Rust and embedded systems for quite a while, we figured that trying Rust on embedded would be really cool. Guess what: it just works (well, perhaps 90 % of the time, but that's pretty much always in embedded-percentages!).
Our Journey
We have been planning to start our own company for a couple of years now and this year the time has come to fulfill this dream. We believe that there is a strong need for a fundamental change in how we develop embedded systems. The development needs to be faster, safer and more accessible. Our connected world can no longer afford to require embedded developers to have 10+ years of experience in C and yet pray that they don't introduce any of the common vulnerabilities present in C. Not to mention the hours new developers spend setting up their toolchain.
Best Of
We don't want to get too deep into the details of the language and how it's a perfect fit for embedded systems. That will be the topic of a future article. Today, we would like to present a non-exhaustive peek into what made developing embedded systems with Rust so enjoyable this year.
Tools
Our top three (actually four) tools that made life so much easier for us in the past couple of months:
- Embassy:
An embedded Rust framework that makes using
async
on microcontrollers so simple. Batteries and a great community included. - Postcard:
A data serializer for
no_std
environments compatible with Serde. Together with Embassy we are using this to send data via Ethernet from an STM32 controller to a server without ever having to worry about how to extract the information from the received bytes. An amazing experience. - probe-rs (together with defmt): Probably the tool anyone who has ever set up a toolchain for embedded programming in C/C++ will fall in love with immediately. Some brilliant minds managed to build a tool that saves you hours of time, lots of nerves and headaches – and it just works. Really.
Conciseness
Reading, e.g., STM32 HAL code is usually not much easier than reading code doing raw register manipulation.
With Embassy, the code necessary to have an easy to understand abstraction over toggling a pin with a delay is such a pleasure to read. There is a gpio::Output
that is, well, a GPIO pin configured as an output. After setting the reset
pin HIGH with set_high
(surprise!), we can await
a Timer
that will finish after
a specified Duration
. Only to then set_low
the pin.
Thank You!
Getting started so easily and having people around to ask when you get stuck does not go without saying. We would like to thank the awesome embedded Rust community for helping us wherever they can and for being a bunch of very friendly and smart people. It has been a pleasure and we are very much looking forward to the next year with you.
An especially big "thank you" from us goes to Dario Nieuwenhuis, Adam Greig and James Munns for their efforts inside the working group, Embassy and for the entire embedded Rust ecosystem. If you happen to be in Munich in the future, please give us a call. We'd be glad to invite you for a beer (or two).