In recent years, the software content of automobiles has grown exponentially. Estimates are that a modern luxury car may contain as many as 100 million lines of code. This code runs a host of interacting subsystems from the infotainment systems, window controls, and air conditioning to the most critical engine control and safety systems. While many of these subsystems are developed by the auto manufacturer, a good number of them come from third-party contractors as well as from independent aftermarket suppliers.
A number of standards are emerging in the auto industry such as the well established CAN bus, the AUTomotive Open System Architecture (AUTOSAR), the Media Oriented Systems Transport (MOST), and the ISO 26262 standard. While the first three standards address the external interaction and networking issues within automobiles, ISO 26262 is a set of requirements for safety and reliability. It is important for applications from different suppliers and groups within a manufacturer to conform to these standards, though only ISO 26262 calls for the use of well-defined coding rules to prevent bugs that can lurk within code and cause sometimes life-threatening malfunctions (Figures 1 and 2).
An embedded C coding standard is therefore needed that can be followed and understood by all teams and members of teams developing these interactive, networked systems. This is especially important because different teams and different suppliers will be using different development tools, compilers, and analysis tools. Therefore it is imperative to establish a common ground at the coding level.
What’s to Gain from a Coding Standard?
The adoption of a coding standard by a team or a company has many benefits. For example, a coding standard increases