Skip to main content
NMan.11
Associate II
August 7, 2020
Question

Rust support.

  • August 7, 2020
  • 9 replies
  • 31613 views

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?

9 replies

Knut_Knusper
Associate II
February 15, 2021

Push

JamesF
Visitor II
November 16, 2021

I am also interested in Rust support from ST.

Louis Cloete
Associate II
November 16, 2021

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.

Pavel A.
Super User
November 16, 2021

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++?

Alex M.
Associate II
November 16, 2021

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.

DOCon.1
Senior
November 16, 2021

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

Louis Cloete
Associate II
November 16, 2021

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.

Visitor II
June 9, 2024

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. 

THoep.924
Associate
June 25, 2024

Would be very excited to see ST contribute to the amazing open-source efforts from the Rust community. Just as a side note, approximately a year ago, Infineon announced official rust support for some of their microcontrollers. 

Adailton Júnior
Associate
January 30, 2026

2026 already. Is there any news on this?

Associate II
February 12, 2026

Our software stack is running on Rust, and there is starting to be internal pressure to use the language for firmware too.

If ST won't provide support for it, we may end up being dragged away to a competitor despite how much we like your products.

Andrew Neil
Super User
February 12, 2026

@Scopi wrote:

we may end up being dragged away to a competitor 


Out of interest, what other chipmakers are supporting Rust on their microcontrollers ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate II
February 13, 2026

As THoep.924 mentioned, Infineon has some Rust support. I have no direct experience with that so cannot comment.