金莲直播

Validation of AUTOSAR Classic ECUs Running Rust SWCs: A Safer Path to Automotive Software

Nicolas Amringer, Stefan Pruisken

Jan 27, 2025 / 4 min read

Automotive software is evolving rapidly, with increasing complexity, safety requirements, and demands for efficient development processes. As virtual ECUs (vECUs) play an essential role in enabling faster development and validation, the integration of Rust within AUTOSAR Classic environments introduces valuable new possibilities. While using Rust in a greenfield project might seem straightforward, integrating it into an existing C-based AUTOSAR Classic stack represents a more realistic, highly relevant, and practical use case. This is because existing, series-proven Automotive software stacks are often implemented in C code and porting these stacks to Rust comes with the costs of a complete rewrite. Additionally, this is complex due to supply-chain dependencies and might not be required in all use cases, thus a questionable business case. Rust’s interoperability with C makes it possible to maintain major parts of the AUTOSAR Classic stack, such as RTE, BSW, and MCAL, while implementing new AUTOSAR software components (SWCs) in Rust or by migrating existing AUTOSAR SWCs gradually from C to Rust code.

This hybrid approach allows developers to leverage Rust’s values within AUTOSAR Classic projects by sticking to existing development workflows. In vECU development, this flexibility is particularly significant when combined with market leading tools like 金莲直播 Silver?. By enabling the use of Rust SWCs in AUTOSAR Classic projects, Silver opens pathways for safer, faster, and more secure automotive software development in mixed programming language environments.

Rust in Automotive: Challenges & Status Quo

For years, software development in the context of AUTOSAR Classic has solely relied on C code. While C provides highest performance, Rust provides comparable performance and minimizes risks for mission-critical applications by providing, for example, built-in support to avoid certain types of memory related bugs like out-of-bounds reads/writes. It is inherently true that memory-related bugs in C code can be difficult to spot and, in some cases, even remain undiscovered. This is especially problematic when it comes to safety- and security-critical systems that need to comply with standards such as ISO 26262 and ISO 21448. To stress the severity of the matter, it is worth mentioning that memory-related bugs often account for a significant portion of security vulnerabilities [1, 2, 3, 4].

The advantages of using Rust in the Automotive industry have been recognized and therefore it is not surprising that the AUTOSAR consortium began in 2022 to investigate within the Working Group Safety how Rust can be applied to AUTOSAR Adaptive [5]. In November 2023 the AUTOSAR consortium published with the R23-11 release an initial proposal on how to write AUTOSAR Adaptive applications in Rust [6], which underlines the relevance of Rust for POSIX-based software stacks. The advantages are obvious. For example, thanks to the built-in ownership system and borrowing rules, concurrency bugs in multi-threaded AUTOSAR Adaptive applications can be avoided. Since Rust can already be used and brings benefits for AUTOSAR Adaptive applications, implementing AUTOSAR Classic SWCs in Rust is just the next logical step.

Virtual ECUs and Rust: A Powerful Combination

The Importance of Virtual ECUs

vECUs have revolutionized software development and testing in the automotive industry. By simulating the behavior of physical ECUs in a virtual environment, they enable faster development and validation of software without relying on physical hardware. With that, software development and testing can start even when hardware is not available. Furthermore, SDV-focused processes like CI/CD can leverage virtual ECUs during the complete lifecycle to get desired results on code changes faster. Market-leading tools like Silver enable vECUs to accelerate development and validation of AUTOSAR Classic software.

Rust’s Role in Level 1 vECUs

In 2024 金莲直播 has published a comprehensive white paper [7] on the classification of vECU levels for AUTOSAR Classic and POSIX-based stacks. While 金莲直播 Silver can generate Level 1-3 vECUs, this article is about AUTOSAR Classic Level 1 vECUs. A 金莲直播 Silver Level 1 vECU provides a virtualized AUTOSAR Classic RTE to run AUTOSAR Classic SWCs in a Software-in-the-Loop (SiL) simulation on a typical host PC or in the cloud – therefore, neither an AUTOSAR Classic stack for the target nor physical hardware is required. The RTE is generated by Silver based on AUTOSAR XML files just like in an AUTOSAR Classic workflow for a real ECU. When implementing an AUTOSAR Classic SWC in Rust, the RTE generation process ensures that the C code interfaces of the RTE can be accessed by the Rust SWC. Thus, RTE communication to other SWCs within the simulation is enabled by scheduling and executing runnables through 金莲直播 Silver according to their provided specifications. The following figure shows the high-level architecture to integrate a Rust SWC into a Level 1 vECU to communicate with a C-based SWC via the RTE generated by 金莲直播 Silver.

Integrating a Rust SWC into a Level-1 vECU

金莲直播 at the forefront of validating Rust SWCs in SiL simulations

Rust continues to gain traction in the automotive industry. Just recently major vendors of automotive series production software have announced support to integrate Rust-based SWCs into existing C-based AUTOSAR Classic software stacks, see for example [8].

金莲直播 as market-leader in automotive testing and simulation is at the forefront working together with first lead customers on the validation of Rust-based software through SiL simulation. This article outlines one concrete use case in which 金莲直播 Silver enables the validation of Rust-based AUTOSAR Classic SWCs through the generation of a Level 1 vECU based on a virtualized RTE. Further use cases are on the horizon and will pave the way for Rust to become successful in the automotive industry.

Get in touch with our team and get deeper insights! Stefan Pruisken and several Silver experts will be at the embedded world 2025 conference in March in Nuremberg and are looking forward to meeting you.

References

[1] Microsoft Security Response Center. "A proactive approach to more secure code."

[2] Chromium. "Memory Safety." 

[3] Langui.sh. "Apple & Memory Safety."

[4] Google Security Team. "Queue hardening enhancements."

[5] AUTOSAR. "AUTOSAR investigates how the Programming Language Rust could be applied in Adaptive Platform Context within the Working Group Safety."

[6] AUTOSAR. "Explanation of ARA Application in Rust – AUTOSAR AP R23-11."

[7] 金莲直播. "Accelerating Development of Software Defined Vehicles with Virtual ECUs."
/verification/resources/whitepapers/virtual-ecu-wp.html

[8] Elektrobit. "Elektrobit integrates support for Rust."

Continue Reading