|
|
|
|
|
by Arch-TK
531 days ago
|
|
I'm writing firmware for my espresso machine in Rust right now and I was also pretty blown away at how easy it is. I am writing code across two micro-controllers (I'm re-using existing hardware) and I am using no-std RTIC2+Embassy on an STM32 inside machine and std Embassy on a ESP32-S3 on the outside of the machine. I don't know C++ (although C++ for embedded would probably have been fine, except I don't like C++ anyway) and it would have been a lot more work to get this working in C. Using Rust I get so many static guarantees that it makes it trivial to get things working. And things have matured a lot since the last time I checked about a year ago. Things are still a bit rough, for example I am maintaining my own version of embassy-stm32 so I can make a few things work the way I want to, but it's not really a problem for an embedded project. Developing rust for xtensa is also a bit painful at times, but it still beats writing C or C++. Moreover, RTIC2 allows me to write high performance real time code the way I would have written it in C with a mountain of boilerplate removed from sight just down to the way async works in rust as well as the things RTIC handles. |
|
From my understanding Embassy and RTIC are two different models of concurrency so I’m not sure of any benefit of using both at the same time.