Skip to main content
NMan.11
Associate II
Aug 7, 2020 8:03 AM UTC
Question

Rust support.

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?

18 replies

Knut_Knusper
Associate II
Feb 15, 2021 11:40 AM UTC

Push

JamesF
Visitor II
Nov 16, 2021 2:51 PM UTC

I am also interested in Rust support from ST.

Louis Cloete
Associate II
Nov 16, 2021 5:05 PM UTC

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.
Nov 16, 2021 5:28 PM UTC

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
Nov 16, 2021 7:50 PM UTC

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
Nov 16, 2021 7:13 PM UTC

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
Nov 16, 2021 7:30 PM UTC

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
Jun 9, 2024 12:49 PM UTC

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
Jun 25, 2024 3:47 PM UTC

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
Jan 30, 2026 6:07 PM UTC

2026 already. Is there any news on this?

Associate II
Feb 12, 2026 12:24 PM UTC

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
Feb 12, 2026 12:33 PM UTC

@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
Oct 26, 2026 10:39 AM UTC

Espressif seems to actively provide Rust support for their devices.

Associate II
Feb 13, 2026 1:52 AM UTC

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

Associate
Oct 26, 2026 10:43 AM UTC

Hi ST team,

I would like to chime in to the discussion.

As someone who has been using STM32 devices and increasingly adopting Rust for embedded development, I would like to express my interest in seeing some level of official support for the Rust-based Embassy ecosystem.

I'm not suggesting that ST should replace STM32Cube, CubeMX, or the HAL. However, I think official support for Rust and Embassy would make sense for a few reasons:

  • Rust is seeing growing adoption in embedded systems, particularly in industries where reliability, safety, and security are important.
  • Embassy already provides mature STM32 support through the community-maintained embassy-stm32 project, demonstrating strong interest from STM32 developers.
  • Rust's strong compile-time guarantees can help prevent entire classes of bugs before software ever reaches hardware.
  • Modern async/await development with Embassy offers an attractive alternative to traditional RTOS-based designs for some applications.
  • Official support would increase confidence for teams considering STM32 for commercial and long-lived products.

By "official support," I don't necessarily mean that ST would have to maintain Embassy directly. Even things like official examples, documentation, collaboration with Embassy maintainers, or validation of STM32 devices with Embassy would be very valuable.

Pavel A.
Oct 29, 2026 12:47 AM UTC

Just a few <coins> to this… The Embassy style async runtime is possible also with coroutines in modern C++.  So conversion to Rust is not necessary.