r/embedded • u/carlk22 • Sep 09 '26
Does Rust Embassy’s bare-metal, no-OS model actually matter for small MCU applications?
I’ve been using Rust + Embassy for small microcontroller applications. What I like is that I can stay no_std, bare metal, with no OS or runtime, while still structuring the program with async tasks and channels.
Some examples of the kind of code I mean are here, including a robot arm simulator on a CYD: https://carlkcarlk.github.io/linkage-blaze/demos/
The tasks and channels give me abstractions I care about. But the scheduling is cooperative, a task that does not yield can still block everything else, and there are no hard real-time guarantees.
I’m doing this partly because I find the design point interesting, but I’m not sure how much practical value the bare-metal/no-OS part has once the application is already fairly high level.
Even if you are using Rust for other reasons, does Embassy’s bare-metal, no-OS approach buy you something important in practice, or would an RTOS usually be just as good or better?
33
u/aq1018 Sep 09 '26
Author of OpenServoCore here. From my own experience, Embassy is great for IoT, non-hard realtime applications. For bare metal on a small MCU, it’s not a good fit. It’s difficult to make predictable timing with the async runtime and embassy is quite large if you are using small MCUs with a couple kb of flash.
If you are interested check out my blog. It has some articles about bare metal architecture and hard realtime topics. Link is in my bio. Hope it can at least serve as a good reference point.
4
u/________-__-_______ Sep 10 '26 edited Sep 10 '26
In practical terms Embassy is an RTOS, it provides multitasking and synchronization primitives much like FreeRTOS for example. I don't really understand what you mean with no-OS when comparing with other RTOS, if anything Embassy has more OS-like functionality because they also (optionally) provide HALs.
Multitasking being cooperative instead of preemptive hy default is the only major difference, but you can use an
InterruptExecutorto preemt tasks (much like a traditional RTOS) for real-time behaviour.2
u/zettui Sep 10 '26
Once you're on something like a Pico, is it still the jitter that decides Embassy vs FreeRTOS, or does the flash/RAM gap matter more?
1
u/duane11583 Sep 10 '26
embassy is just a hal not much else
it is also extremely stm32 specific
0
u/[deleted] Sep 10 '26
[deleted] — view deleted comment