OpenBSW: A Code-first Software Platform for Automotive Microcontrollers
Software has become the main differentiator in modern vehicles, and its importance in the automotive industry is continually growing. However, the development of automotive software presents distinct challenges that differentiate it from conventional software development.
We present OpenBSW, a new open-source project within the Eclipse community, that addresses these challenges and provides an alternative approach to building software for automotive microcontrollers.
The Unique Landscape of Automotive Software Development
First, automotive software development stands apart from other domains due to the intrinsic properties and requirements of the automotive domain itself.
At its core, automotive software on microcontrollers operates in a deeply embedded environment with direct hardware interactions and strict resource limitations. These systems demand exceptional safety and reliability and need to meet real-time requirements. Typical implementations make use of distinct design patterns such as cyclic execution models to achieve this.
Communication in automotive systems relies on specialized bus interfaces with predefined sets of messages and specific sending patterns, such as cyclic sending. Moreover, some aspects of automotive software require code generation, including generating bus messages from predefined catalogs and diagnostic error codes from diagnostic databases. Power management is another demanding and critical aspect, with low energy consumption and fast wake-up times being essential for many automotive applications.
To address these unique challenges, the automotive industry has developed specialized tools and stacks that, on top of the fundamental differences, set it apart from other domains. Most of today’s tools rely heavily on GUI-based modeling and code generation. While these tools serve their purpose, they also create obstacles to implementing modern software development practices like continuous integration. Current software stacks are rather rigid as they follow a strict architecture, which makes them hard to adapt or extend.
The Need for Change
While functional, the current approach to automotive software development has limitations that hinder innovation and efficiency. OpenBSW aims to address these limitations by enabling well-known software development workflows and tools in the automotive sector.
By doing so, we hope to attract a broader talent pool, and tap into the larger ecosystem of programming languages, libraries, and tools available in the wider software development community. And to create a more pleasant and efficient developer experience.
OpenBSW is designed to enable developers to explore new ideas and innovate more freely, for example supporting new hardware or network protocols with greater ease. This modernized approach aims to boost development efficiency and move away from the rigid “one size fits all” solution of existing software stacks. Instead, OpenBSW offers a customizable stack that can scale from very small to very large microcontroller projects.
Embracing Modern Software Practices
At the heart of OpenBSW lies a code-centric, text-based approach that marks a significant departure from traditional automotive software stacks. In many cases, we’ve found that plain code is sufficient to achieve typical tasks. For instance, OpenBSW provides a simple interface to send and receive CAN frames using standard programming constructs.
The same goes for registering for received CAN frames, listeners can be attached and detached from the transceiver in a straightforward code-only fashion.
When code generation is necessary, we opt for textual languages rather than GUI-based tools, and we ensure that all needed tools are locally available to every developer. This approach allows for the use of well-established programming tools like VS Code, Git, and typical continuous integration pipelines, bringing automotive software development more in line with modern software engineering practices.
OpenBSW is implemented in C++, offering a modern and flexible environment that’s superior to C while still being widely supported for automotive microcontrollers. The core team behind OpenBSW has nearly two decades of experience using C++ in automotive series projects, so we know very well how to apply that language to this domain. With a few restrictions, such as avoiding dynamic memory allocation and exceptions, C++ can be safely and effectively used in automotive contexts. In turn, our code quality benefits from language features such as scopes, strong typing, and data encapsulation.
At the same time, we see Rust emerging as a highly promising candidate for implementing automotive microcontroller software. We are actively evaluating Rust in this domain, and we expect to include support for it in OpenBSW in the future.
OpenBSW’s architecture is designed with openness and modularity in mind. Built on versatile libraries and properly layered, OpenBSW contrasts sharply with existing automotive software stacks. This open architecture allows for an easy addition of new modules and enables the stack to scale from very small to very large ECUs. For example, through built-in mechanisms like the “async” OS abstraction, OpenBSW can easily be ported to other operating systems such as Zephyr.
Automotive Safety
Increasingly complex electrical/electronic systems in vehicles also increase the risk of malfunctions. Functional safety (FuSa) in accordance with ISO26262 is essential to minimize these risks for safety-relevant functions in the vehicle. OpenBSW addresses the requirements raised by FuSa through a “safety shell” approach. By separating ASIL (Automotive Safety Integrity Level) and QM (Quality Management) software using a safety shell wrapped around the ASIL software, we can implement this approach on top of a non-safety-qualified OS. This strategy keeps safety-related code as localized as possible and simplifies the development of the rest of the codebase.
The safety shell consists of three major building blocks: A MPU-based memory protection mechanism, a program flow monitor, and a watchdog. We intend to provide these modules for supported HW platforms along with documentation and example projects using them.
Going Open Source
OpenBSW is built with an open-source mindset, reflecting our belief that the automotive industry should collaborate on non-differentiating software platforms. By building up a vibrant community of developers and companies, we aim to enable innovation and collaboration that will drive the entire industry forward.
Therefore, our future prioritization depends on community feedback. Don’t hesitate to get involved, we are happy to receive your comments and pull requests on GitHub.
Current Status and Roadmap
OpenBSW has recently joined the Eclipse community, with version 0.1 already published. This initial version supports the NXP S32K1 microcontroller and the POSIX platform, allowing compilation for Linux/WSL development PCs. It comes equipped with core concepts and interfaces for lifecycle management, logging, and an embedded standard library (“estd”), as well as support for CAN and UDS (Unified Diagnostic Services).
So right out of the box, you can start playing with it, just build and run the software on any Linux machine. You can even launch a demo application that makes use of our embedded console feature. On POSIX, this will be a shell running in your terminal. On embedded devices, it usually is implemented as a serial console over UART. This helpful feature provides an easy way to run a set of predefined or custom commands, displaying values and results in a shell-like environment.
The next steps on our roadmap include Ethernet support and DoIP (Diagnostics over Internet Protocol), flashing via UDS, a simple COM (Signal-based Communication) module, and a preview of our safety modules.
At the same time, we are working on integrating OpenBSW on Zephyr, with a preview release planned for the near future.
To integrate with the large set of existing automotive applications, OpenBSW can be extended with our lightweight ICC1 AUTOSAR Layer, further enhancing its versatility.
Shaping the Future of Automotive Software
OpenBSW represents a significant leap forward in automotive software development, offering a modern, flexible, and open approach to building software for automotive microcontrollers. By embracing a code-centric methodology, leveraging the power of C++, and adopting an open-source mindset, OpenBSW aims to attract talent, boost efficiency, and foster innovation in the automotive software industry.
As we continue to evolve and grow within the Eclipse community, we invite developers, automotive companies, and enthusiasts to join us in shaping the future of automotive software development. Together, we can create a more robust, efficient, and innovative ecosystem for the vehicles of tomorrow.