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:

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.

pub struct Adc<'a> {
    /// ADC Reset
    pub reset: Output<'a, PD7>,
}

impl<'a> Adc<'a> {
    pub fn new(mut r: AdcResources) -> Self {
        Self {
            reset: Output::new(r.reset, Level::High, Speed::Low),
        };
    }

    /// Send a Reset to the ADC
    pub async fn reset(&mut self) {
        self.reset.set_high();
        Timer::after(Duration::from_millis(1)).await;
        self.reset.set_low();
    }
}

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).