Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
1–10 of 172 posts
Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#2> Two teams concurrently developing the same functionality (one in C, one in Rust) are analyzed over a period of several months. A comparative analysis of their approaches, results, and iterative efforts is provided. The analysis and measurements on hardware indicate no strong reason to prefer C over Rust for microcontroller firmware on the basis of memory footprint or execution speed. Furthermore, Ariel OS is shown to provide an efficient and portable system runtime in Rust whose footprint is smaller than that of the state-of-the-art bare-metal C stack traditionally used in this context. It is concluded that Rust is a sound choice today for firmware development in this domain.
Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#3Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#4I would say however that there's still toolchain issues here. There all kinds of MCUs that simply don't/won't have a viable compiler toolchain that would support Rust.
e.g. I recently came from a job where they built their own camera board around an older platform because it offered a compelling bundle of features (USB peripheral support and MIPI interface mainly). We were stuck with C/C++ as the toolchain there, as there was no reasonable way to make this work with Rust as it was a much older ARM ISA
Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#5One of the author's here, if there are any questions!
Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#6Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#7One of the author's here, if there are any questions!
Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#8Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#9One of the author's here, if there are any questions!
Isn't there a nasty selection/volunteer bias at play with the developers?
Yeah of course. Then again - they were one person teams, where the C "team" had years of experience in stm32 / embedded C / stm32 cube development and churned out that handwritten state machine in just days. The Rust "team" was a pre-masters intern with only minimal embedded Rust experience. They ran into all the pitfalls with (async) embedded Rust, but corrected towards the end.
Re: Embedded Rust or C firmware? Lessons from an industrial microcontroller use case
#10One of the author's here, if there are any questions!