Introduction To Autosar Architecture
AUTOSAR stands for AUTomotive Open System ARchitecture and represents a global development partnership of automotive manufacturers, suppliers and tool developers. The primary goal of AUTOSAR is to establish a standardized software architect…
AUTOSAR stands for AUTomotive Open System ARchitecture and represents a global development partnership of automotive manufacturers, suppliers and tool developers. The primary goal of AUTOSAR is to establish a standardized software architecture that enables the reuse of software components across different vehicle platforms and across multiple generations of electronic control units (ECUs). By defining clear interfaces, layered software modules and a common methodology, AUTOSAR reduces integration effort, improves scalability and supports the increasing complexity of modern vehicle functions such as advanced driver assistance, infotainment and power‑train control.
ECU (Electronic Control Unit) is the fundamental hardware node in a vehicle that hosts one or more AUTOSAR software stacks. An ECU may range from a simple microcontroller controlling a single actuator to a powerful processor handling multiple high‑performance applications. In the AUTOSAR context, each ECU is described by an ECU Configuration that specifies the hardware resources (CPU, memory, peripheral devices) and the software components that will be deployed on that ECU. The configuration is stored in an ARXML file (AUTOSAR XML) and is used by the build tools to generate the necessary run‑time environment and to map software components to physical resources.
Software Component (SWC) is a self‑contained, reusable unit of functionality defined by its interfaces, internal behavior and configuration parameters. A SWC is described using AUTOSAR’s Component Description language, which includes ports (provided and required), runnables (executable code fragments) and data elements (variables exchanged between components). For example, a “BrakeControl” SWC may provide a port named BrakeCommand that outputs a torque value, while requiring a port named VehicleSpeed to receive the current speed. The clear separation of concerns allows the same SWC to be reused on different ECUs simply by changing its configuration.
Runtime Environment (RTE) is the middleware layer that implements the communication between SWCs and between SWCs and the underlying Basic Software (BSW). The RTE abstracts the physical network topology, ensuring that a SWC can send or receive data without knowing the exact bus or memory location involved. The RTE is generated automatically from the system description (ECU configuration, component descriptions, and communication matrix) and includes code for data marshalling, scheduling, and error handling. In practice, a developer writes only the functional code inside the SWC’s runnables; the RTE guarantees that the data flow complies with the defined communication patterns.
Basic Software (BSW) forms the lower layers of the AUTOSAR architecture and provides services that are independent of the application logic. The BSW is organized into several sub‑layers:
• Microcontroller Abstraction Layer (MCAL) – isolates the upper software layers from the specifics of the microcontroller. It offers drivers for digital I/O, analog‑to‑digital conversion, communication peripherals (CAN, LIN, Ethernet), and timer services. The MCAL ensures that the same application code can run on different microcontrollers simply by swapping the MCAL implementation.
• ECU Abstraction Layer (ECU‑AL) – abstracts the board‑level hardware such as sensors, actuators and power‑management circuits. It provides a uniform interface to higher layers, for example a generic DigitalOutput service that can be mapped to any physical pin.
• Services Layer – contains modules that implement generic system services, for instance the Operating System (OS), the Diagnostic Communication Manager (DCM), the Memory Services (NVRAM), the Crypto Services and the System Time. These services are shared by all SWCs and can be configured for different performance or safety requirements.
• Communication Stack – implements the AUTOSAR standardized protocols for inter‑ECU communication, such as CAN, LIN, FlexRay, Ethernet and SOME/IP. The stack is divided into a Transport Layer, a Network Layer and a Application Layer. Each layer follows the AUTOSAR specification, allowing seamless integration of third‑party network protocols.
• Diagnostic Stack – provides the mechanisms required for vehicle diagnostics, including the handling of diagnostic requests (UDS), session management, security access and fault code storage. The DCM works together with the BSW services to read and write memory, trigger resets, and report diagnostic trouble codes (DTCs).
Operating System (OS) in AUTOSAR is a deterministic, pre‑emptive real‑time kernel that follows the OSEK/VDX standards. The OS manages tasks, interrupts, resources and scheduling policies. Tasks are the basic execution units that can be either basic (non‑preemptive) or extended (preemptive). The OS provides services for task activation, event handling and resource locking, which are essential for meeting the timing constraints of safety‑critical functions. For example, a “BrakeTask” may be configured with a period of 10 ms and a priority that guarantees it runs before less critical tasks such as “InfotainmentUpdate”.
Virtual Functional Bus (VFB) is a conceptual model that represents the logical communication pathways between SWCs, independent of the physical network. The VFB abstracts the data exchange as if all components were connected to a single bus, simplifying the design of communication matrices. The RTE implements the VFB by generating the appropriate data copies, buffers and synchronization mechanisms. When a SWC writes to a VFB signal, the RTE ensures that all receivers subscribed to that signal receive the updated value according to the defined communication pattern (e.G., Periodic, event‑triggered, buffered).
ARXML (AUTOSAR XML) files are the primary artifact used to exchange architecture information among tools. They contain the system description, component definitions, ECU configuration, and the communication matrix. ARXML follows a strict schema that allows automated validation and code generation. A typical development flow includes the following steps:
1. Define the SWC interfaces and behavior in a Component Description ARXML. 2. Assemble the system by linking SWCs to ECUs in a System Description ARXML. 3. Generate the BSW and RTE code using the AUTOSAR Builder or similar toolchain. 4. Integrate the generated code with the application logic and compile for the target hardware.
Methodology in AUTOSAR is a structured process that guides developers from requirements capture to deployment. The methodology consists of four major phases:
• Requirements Engineering – capture functional and non‑functional requirements, map them to AUTOSAR concepts (SWCs, communication, timing) and document traceability.
• Design – create component diagrams, define ports, select BSW modules, and decide on scheduling policies. The design is expressed in ARXML files.
• Implementation – develop the runnable code for each SWC, configure BSW parameters, and integrate generated RTE code.
• Testing and Validation – perform unit tests on SWCs, integration tests on the RTE, and system tests on the ECU. Compliance testing verifies that the implementation adheres to the AUTOSAR specifications.
The methodology ensures that all stakeholders (system engineers, software developers, testers) share a common view of the architecture, which is crucial for large, distributed development projects.
Adaptive AUTOSAR is the newer platform designed for high‑performance computing platforms such as those required for autonomous driving and over‑the‑air updates. Unlike the Classic Platform, which is static and deterministic, Adaptive AUTOSAR supports dynamic service discovery, POSIX‑based operating systems and flexible deployment of applications. Key concepts in Adaptive AUTOSAR include:
• Execution Management (EM) – manages the lifecycle of applications, handling start, stop, and restart operations.
• Service Discovery – enables applications to locate and bind to services at run‑time using a standardized description language.
• Persistency Service – provides a unified interface for storing configuration and state data across reboots.
• Time Synchronization – ensures that distributed applications share a common notion of time, which is essential for sensor fusion and cooperative driving.
Even though the Adaptive Platform targets a different set of use cases, many of its concepts (e.G., Service‑oriented architecture, standardized interfaces) complement the Classic Platform and can coexist on the same vehicle network.
Communication Matrix is a central artifact that defines how signals are exchanged between SWCs across the VFB. It specifies the source and destination ports, the data type, the transmission mode (periodic, sporadic, event‑triggered) and any timing constraints (minimum/maximum delay). The matrix is used by the RTE generation tool to allocate buffers, schedule transmissions, and insert necessary data conversion (e.G., Endianess handling). For instance, a signal named EngineRPM may be defined as a 16‑bit unsigned integer, transmitted every 20 ms from the “EngineControl” SWC to the “Dashboard” SWC, with a maximum allowed latency of 5 ms.
Timing Constraints in AUTOSAR are expressed using the Time Event model. A time event defines a periodic activation of a runnable or a task. The RTE must guarantee that the activation occurs within the specified jitter limits. Timing analysis tools such as ARXML Timing Analyzer or third‑party solutions can be used to verify that the schedule satisfies all constraints, taking into account the OS tick rate, interrupt latencies and BSW execution times.
Memory Services are part of the BSW and include NVRAM Manager and Flash Manager. NVRAM provides a non‑volatile storage abstraction for data that must survive power cycles, such as calibration constants or diagnostic logs. The NVRAM Manager offers APIs for reading, writing and validating data blocks, while handling wear‑leveling and error correction. The Flash Manager abstracts the underlying flash memory devices, offering services like block erasing, programming and verification. Both services are essential for meeting functional safety requirements (ISO 26262) that demand reliable storage of configuration data.
Diagnostic Communication Manager (DCM) implements the diagnostic protocols defined by the automotive industry, most notably UDS (Unified Diagnostic Services). The DCM processes incoming diagnostic requests, forwards them to the appropriate application services, and assembles the response. It also manages diagnostic sessions, security levels, and timing parameters such as response timeouts. A typical use case is a service technician connecting a scan tool to the vehicle’s OBD port, sending a request to read the current fuel level, and receiving the data from the “FuelManagement” SWC via the DCM.
Security in AUTOSAR is addressed through several mechanisms. The Crypto Service provides cryptographic primitives (encryption, hashing, digital signatures) that can be used by applications to protect data integrity and confidentiality. The Secure Onboard Communication (SecOC) module implements message authentication codes (MAC) for CAN frames, ensuring that only authorized ECUs can inject messages onto the bus. Additionally, the Adaptive Platform includes a Secure Firmware Update service that verifies the authenticity of software packages before flashing them onto the ECU.
Configuration Parameters are key‑value pairs that customize the behavior of BSW modules and SWCs. They are defined in the ECU Configuration ARXML and can be modified without changing the source code. For example, the CAN driver may have a parameter “BaudRate” set to 500 kbps, while the same driver on another ECU could be configured for 250 kbps. The ability to adjust parameters at configuration time simplifies the reuse of software components across different vehicle models.
Traceability is a fundamental aspect of AUTOSAR development. Each requirement, design element, code artifact and test case is linked through unique identifiers, enabling impact analysis when changes occur. Traceability matrices are often generated automatically from the ARXML files, ensuring that every requirement is covered by at least one test case and that any uncovered requirement is flagged for review.
Integration Challenges arise due to the layered nature of AUTOSAR and the need to coordinate multiple development teams. Common challenges include:
• Version Compatibility – different teams may use different releases of the AUTOSAR standard, leading to mismatched interface definitions. Proper version control and the use of standard-compliant tools mitigate this risk.
• Tool Chain Interoperability – ARXML files generated by one tool may not be fully compatible with another tool’s parser. Conformance testing and the adoption of a common tool chain are essential to avoid integration bottlenecks.
• Performance Overheads – the abstraction layers introduce additional execution time and memory consumption. Careful profiling and optimization of the RTE, BSW, and OS configuration are required to meet real‑time constraints.
• Safety Certification – meeting ISO 26262 requirements demands rigorous verification of the generated code, including static analysis, code coverage measurement and fault injection testing. AUTOSAR provides guidelines for safe code generation, but the project must still demonstrate compliance through documentation and evidence.
Practical Example – Adaptive Cruise Control (ACC)
Consider an Adaptive Cruise Control system that maintains a safe distance from the vehicle ahead. The functional decomposition in AUTOSAR might involve the following SWCs:
1. SpeedSensor – reads vehicle speed from the wheel speed sensor and provides a VehicleSpeed signal. 2. RadarSensor – processes radar data and provides a TargetDistance signal. 3. ACCController – receives VehicleSpeed and TargetDistance, computes the desired acceleration, and outputs a BrakeCommand and ThrottleCommand. 4. BrakeActuator – receives BrakeCommand and drives the hydraulic brake system. 5. ThrottleActuator – receives ThrottleCommand and controls the engine throttle valve.
Each SWC defines its ports and data elements in a Component Description ARXML. The Communication Matrix maps the signals between the components, specifying that VehicleSpeed is transmitted every 10 ms, TargetDistance every 20 ms, and the control commands are event‑triggered when a new decision is made. The RTE generated from this description creates the necessary buffers and schedules the runnables. The OS configures the ACCControllerTask with a priority that ensures it can pre‑empt less critical tasks such as InfotainmentUpdate. The MCAL provides the CAN driver that transmits the BrakeCommand on the vehicle’s CAN bus using the SecOC module for authentication.
During integration testing, the team validates that the ACCController runnables are executed within the 5 ms deadline, that the BrakeCommand is correctly received by the BrakeActuator, and that the diagnostic DCM can report any fault (e.G., Sensor failure) according to the OBD specifications. The NVRAM Manager stores the last known calibration values for the radar sensor, ensuring that a power‑cycle does not lose critical data.
Practical Example – Over‑the‑Air (OTA) Update
In an Adaptive AUTOSAR environment, an OTA update process involves several services:
1. UpdateManager – checks for new software packages on a remote server, verifies signatures using the Crypto Service, and initiates the download. 2. Persistency Service – writes the received package to a secure storage area. 3. Execution Management – stops the affected applications, replaces the binaries, and restarts them. 4. Diagnostic Communication Manager – reports the update status and any errors to a service technician.
The OTA workflow is described using AUTOSAR’s Service Interface Description (SID) files, which are represented in ARXML. The RTE for Adaptive AUTOSAR dynamically discovers the required services at run‑time, allowing the UpdateManager to bind to the Crypto Service without hard‑coding its location. This flexibility enables the same OTA client to operate on different vehicle models that may host different versions of the Crypto Service.
Testing and Validation Strategies
AUTOSAR compliance testing is divided into several layers:
• Unit Testing – each SWC’s runnables are tested in isolation using mock objects for the RTE APIs. Tools such as CMock or AUTOSAR‑specific test generators can create stubs for the RTE calls.
• Integration Testing – the generated RTE code is exercised together with the BSW modules. Test cases verify that data is correctly transferred across the VFB, that timing constraints are respected, and that error handling mechanisms (e.G., Buffer overrun) behave as specified.
• System Testing – the complete ECU is tested on hardware, often using a Hardware‑In‑The‑Loop (HIL) simulator that emulates the vehicle’s network and sensors. The HIL environment can inject fault conditions to assess the system’s resilience.
• Compliance Testing – a set of predefined test suites provided by the AUTOSAR consortium checks conformance to the standard. These tests include checks for correct ARXML syntax, proper generation of the RTE, and adherence to the OS API contracts.
In addition to functional testing, safety validation activities such as fault injection, static code analysis (e.G., MISRA C compliance) and coverage measurement (e.G., MC/DC) are required for ISO 26262 certification. The generated code from AUTOSAR tools often includes instrumentation that facilitates coverage collection without manual instrumentation.
Common Vocabulary Summary
The following terms are essential for anyone working with AUTOSAR Architecture:
- AUTOSAR – the overall standard and ecosystem. - Classic Platform – deterministic, static architecture for low‑to‑medium performance ECUs. - Adaptive Platform – dynamic, service‑oriented architecture for high‑performance ECUs. - ECU – hardware node that runs the AUTOSAR stack. - SWC – reusable functional block with defined ports and runnables. - RTE – middleware that connects SWCs and BSW. - BSW – layered basic software providing hardware abstraction and services. - MCAL – driver layer for microcontroller peripherals. - ECU‑AL – abstraction of board‑level hardware. - OS – real‑time kernel managing tasks and interrupts. - VFB – logical communication model. - ARXML – XML representation of AUTOSAR artifacts. - Communication Matrix – definition of signal flow between components. - Timing Constraints – deadlines and jitter requirements for runnables. - NVRAM Manager – non‑volatile storage service. - DCM – diagnostic communication manager. - SecOC – secure onboard communication for message authentication. - EM – execution management in Adaptive AUTOSAR. - Service Discovery – dynamic binding of services at run‑time. - Traceability – linking requirements, design, code and tests. - OTA – over‑the‑air software update process.
These concepts form the backbone of the AUTOSAR architecture and are the building blocks for designing, implementing and validating automotive software that meets the demanding requirements of modern vehicles. Mastery of the terminology and its practical application enables engineers to create robust, reusable and standards‑compliant solutions that can evolve alongside the rapidly changing automotive landscape.
Key takeaways
- The primary goal of AUTOSAR is to establish a standardized software architecture that enables the reuse of software components across different vehicle platforms and across multiple generations of electronic control units (ECUs).
- In the AUTOSAR context, each ECU is described by an ECU Configuration that specifies the hardware resources (CPU, memory, peripheral devices) and the software components that will be deployed on that ECU.
- A SWC is described using AUTOSAR’s Component Description language, which includes ports (provided and required), runnables (executable code fragments) and data elements (variables exchanged between components).
- The RTE is generated automatically from the system description (ECU configuration, component descriptions, and communication matrix) and includes code for data marshalling, scheduling, and error handling.
- Basic Software (BSW) forms the lower layers of the AUTOSAR architecture and provides services that are independent of the application logic.
- It offers drivers for digital I/O, analog‑to‑digital conversion, communication peripherals (CAN, LIN, Ethernet), and timer services.
- It provides a uniform interface to higher layers, for example a generic DigitalOutput service that can be mapped to any physical pin.