3 ms·
<rant> I tried using Rust for a Nordic microcontroller project recently but ended up giving up. It was just too difficult to figure out how to do things in Rust
by olalonde 4y ago
<rant> I tried using Rust for a Nordic microcontroller project recently but ended up giving up. It was just too difficult to figure out how to do things in Rust as a beginner. For example, I couldn't find a (maintained) Bluetooth stack for the nRF52. I finally figured how to link to Nordic's proprietary Bluetooth stack but then I realized I wanted to use the Thread protocol. I couldn't figure out how to do that. Meanwhile there are entire sample apps and guides in C for what I'm trying to achieve[0]. It sucks because I love Rust and would much rather use it than C/C++. I guess this is less of an obstacle for people who have embedded programming experience, but I don't.
[0] https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/protocols/thread/index.html https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/...
- packetlost 4y agoThat's ecosystem maturity problems. Regardless, your first mistake was not immediately reaching for linking to the C libs from Rust, which is something the language is designed to do rather easily.
- kjetijor 4y agoFor matter/thread you'll likely even have to go the other way around - link to your thing written in rust from your matter/thread project. And yes - this is partially a maturity thing, although more in the sense in that the embedded ecosystem is very vendor specific, and you're traveling outside the path the vendor forged for you, so you'll be an early trailblazer - you get to deal with all the integration shit, rather than finding some other random person on the internet that's dealt with something similar. (And it's not necessarily that the vendors path is all that great, but at least there's a whole collection of other people that's struggled with it and posted about it online). Our professor in college was livid when we suggested not using the vendors toolchain (back in the early 2000's), "yes $vendor's toolchain is broken and shit, but it's marginally less broken and shit than $non-vendor toolchain".
- jakewins 4y agoSame experience - started and gave up so many times.. I am having luck currently with embassy-rs, on rp2040, including Wi-Fi, not BLE tho. I think overall the space is improving rapidly year-over-year. It’s hard with suppliers focusing on the C stacks and the Rust stuff being all volunteer.. but IMO things are getting better.
- digikata 4y agoIt's been a while, but tbf not using the Nordic proprietary BT stack on their microcontrollers was a pain in C too.