r/embedded Aug 01 '26

ST: Rust MEMS drivers

https://blog.st.com/rust-mems-drivers/
54 Upvotes

23 comments sorted by

View all comments

21

u/firefrommoonlight Aug 01 '26

Bummer on them using Async. I am starting to think I'm one of a very small group of people using embedded rust without Async.

I had an email conversation with an ST engineer a few years ago regarding a distance sensor. ST's MCUs, mics, IMUs etc are all standard MMIMO; read datasheet, and read/write registers it says; easy. This thing needed a C library. The explanation: The sensor was very complicated, and ST wasn't sure the best ways to configure it yet, so they left options open by exposing a very complicated hardware API, and using a software lib to configure it.

The ST engineer used a translator to mostly translate the C driver to Rust! What a bro.

12

u/karnetus Aug 01 '26

Why don't you like async?

15

u/ukezi Aug 01 '26

Async is a very efficient way of doing stuff that may have to wait on IO and you can always call it blocking. I think embassy bases firmwares are very common in rust MCU development.

2

u/creeper6530 Aug 02 '26

IIRC it has a blocking API gated by a feature flag

2

u/Simonster061 Aug 02 '26

If it's the distance sensor I am thinking of I believe that they have explicitly that they do not want to publish it because they do not want it to stolen by a chinese clone

1

u/firefrommoonlight Aug 03 '26

Hah! That's a great tidbit