Topics / Embedded C / Q35
What is AUTOSAR and what are its main layers?
AUTOSAR (AUTomotive Open System ARchitecture) is a standard software architecture for automotive ECUs, so software components can be reused across suppliers and hardware. Classic Platform targets deeply embedded ECUs on microcontrollers with static configuration; Adaptive Platform targets high-performance ECUs running POSIX operating systems with service-oriented communication.
The Classic Platform layers, from top to bottom:
- Application layer: software components (SWCs) containing the vehicle functions, with ports for data and services.
- RTE (Runtime Environment): generated middleware that connects SWCs to each other and to the basic software, so components never call hardware directly.
- BSW (Basic Software): - Services layer: OS (OSEK-based AUTOSAR OS), communication stack (COM, PduR, CanIf), diagnostics (DCM, DEM), memory services (NvM), watchdog manager. - ECU abstraction layer: makes on-board devices accessible regardless of how they connect to the MCU. - MCAL (Microcontroller Abstraction Layer): drivers for on-chip peripherals: CAN, ADC, DIO, PWM, SPI, flash, GPT. - Complex device drivers: an escape path for timing-critical hardware access that doesn't fit the layers.
Everything is configured with tools (ARXML files) and code is largely generated. Interview follow-ups usually cover how a CAN signal travels from the bus to an application SWC (CAN driver → CanIf → PduR → COM → RTE → SWC) and how diagnostics (UDS over DCM) work.