2020-08-07 01:03 AM
From what i've seen the Rust programming language is becoming more and more popular and since it does not rely on a virtual machine, like java or python, it could be a good option for embedded development and other low-level programs.
I know that there are ways to get Rust on STM32 MCUs running, but without official support its really hard to start a series project using those tools. At this point i see it as something fun to try out and benchmark and compare with a traditional C program + FreeRTOS.
Does anyone know if there are any official plans from ST to have a Rust wrapper on the existing C HAL or a complete ground-up Rust HAL? Maybe support in CubeIDE for both C and Rust?
2021-02-15 03:40 AM
Push
2021-11-16 06:51 AM
I am also interested in Rust support from ST.
2021-11-16 09:05 AM
IMO Rust doesn't need official ST support. The HALs and PACs (Peripheral Access Crates) are already quite good for some chips. If your chip doesn't have a good HAL yet, try to use a similar family as basis and start writing one. You can get support from the rust-embedded and stm32-rs Matrix rooms. What would be nice though, is to see ST contribute to the open source efforts already there.
2021-11-16 09:28 AM
Hi @Community member @Knut_Knusper Could you share your impression from Rust on STM32 or other Cortex-M where you used it?
Is it much better/easier/reliable than C++?
2021-11-16 11:13 AM
I've found Rust to work well on Stm32, due to outstanding PAC and Cortex-M libs. I've released a commercial product using it with Stm32 L4, plan to release another using Rust+Nordic, and a third with Stm32H7 in a few months. Overall, Rust is a very nice language to work with, due to it's ergonomics and builtin tools/docs.
Here's the HAL lib I wrote for the job: STM32-HAL
2021-11-16 11:30 AM
I wasn't aware of this HAL! I'll see if I can get some time to compare it with the stm32xxx-hal crates some time.
2021-11-16 11:50 AM
I have used Rust and C++, both professionally and as a hobbyist.
Rust has many small advantages that are exciting to me as a hobbyist, but as a professional that is concerned with shipping products on time the biggest advantage is the cost of debug. Rust has significantly fewer ways to create buggy code, and when bugs do occur they are often easier to locate due to the syntax of the language forcing developers to mark potentially dangerous code as "unsafe".
My experience is that rust takes longer to write, mostly due to fledgling ecosystem and developer inexperience, but the time savings in debug reduces the overall development cost.
2024-05-27 10:35 AM
Old guy, newbie with Rust, even stm32, but trying to learn... old cat, new tricks !
BTW, if you run across lp5523, i think there's support in Rust, it's a project that i co-developed with NSC while I was the LED r&d global lead in Salo, Finland (along with lp5521/22 /23 /24/ STLED25...and about 8 more)
Thanks for putting this work into our 'space'!
2024-06-09 05:49 AM
I've been really enjoy using Embassy. It's a nice async runtime and offers great HAL for STM32 chips. However, it's still a community-driven project, sometimes incomplete and can be a challenge for beginners to set up. I wish ST would actually invest in the project, or otherwise start to support rust officially.