Diagnostic Stack in AUTOSAR

Vehicle diagnostics refers to the methods and protocols used to monitor health of the vehicle and identify faults in ECUs. These diagnostics operate both on‑board, such as OBD and off‑board, such as UDS (ISO 14229). Engineers and technicians use diagnostic tools to read DTCs, retrieve freeze frame data and extended data records, request status of sensors or actuators, clear fault memories and execute routines for testing or updating firmware. Diagnostic Stack in AUTOSAR ensures vehicle reliability, supports regulatory compliance, aids service and maintenance and enhances customer satisfaction through proactive fault detection.

Overview of the Diagnostics Stack in AUTOSAR

Diagnostic Stack in AUTOSAR defines a structured diagnostics stack within its Basic Software (BSW) and system service layers. Diagnostics Stack in AUTOSAR includes four primary modules i.e. DEM (Diagnostic Event Manager), DCM (Diagnostic Communication Manager), DET (Development Error Tracer) and FIM (Function Inhibition Manager).

Additional modules like Diagnostic Log & Trace (DLT) and the NVRAM Manager (NvM) support logging and persistence. The stack is layered: the DCM resides in the Communication Services layer, DEM in the System Services layer, while DET and FIM also belong to the diagnostics group within BSW. NvM from the memory stack is used to store persistent event related data in blocks such as freeze frames or extended data records upon fault detection.

Diagnostic Event Manager (DEM)

The DEM module processes and stores diagnostic events reported by software components (SW-Cs) or BSW modules. Each event can be mapped to a DTC, which contains a unique identifier and status per ISO‑14229 (e.g. passed, failed, pending, confirmed). DEM supports configurable debouncing (time‑based or counter‑based) and aging of events to prevent false positives and manage event memory efficiently. DEM also provides diagnostics data to DCM, for example, DTC status or snapshot data.

It interfaces with NvM to store fault and snapshot data and provides DTC status and freeze frame data to the DCM upon request. DEM may suppress certain DTCs (making them invisible to external tools) or mark them unavailable in runtime configurations.

It also supports event prioritization in diagnostic stack in AUTOSAR, enabling critical faults to trigger immediate actions or warnings while less severe issues are handled with lower urgency. Additionally, DEM integrates with the FIM to link specific events with application-level responses such as disabling functions or limiting system behavior based on diagnostic status.

Diagnostic Communication Manager (DCM)

DCM handles diagnostic messages exchanged between external testing tools and the ECU, based on UDS services under ISO‑14229 and OBD protocols. DCM is present in the Communication Service Layer of the AUTOSAR architecture. It validates incoming requests against session and security states, supports services such as session control, read/write data identifiers, routine control and responds with positive or negative response codes (NRCs) based on validation.

Internally, DCM is structured into sub‑modules: Diagnostic Session Layer (DSL) for session and timing management, Diagnostic Service Dispatcher (DSD) for routing requests and Diagnostic Service Processing (DSP) for executing services and composing responses. It communicates with DEM to retrieve fault information or control DTC settings and uses PDUR for network‑independent routing.

DCM also manages service timing parameters such as P2 and P2* to ensure that response delays comply with protocol timing constraints, thereby maintaining reliable communication with external testers. Furthermore, it supports both periodic and asynchronous communication modes, enabling continuous data monitoring or on-demand diagnostics depending on the use case and configuration.

Development Error Tracer (DET)

DET is active during development and testing phases to report and trace API usage errors such as invalid arguments or null pointers. Each error is tagged with a module and error ID, making development diagnostics more transparent. In production releases, DET is disabled to avoid performance overhead. It serves as a quality assurance tool during module development rather than a runtime diagnostic module.

DET also enables integration with external debugging or logging tools through standardized interfaces, helping developers quickly isolate and resolve software faults during early integration phases. Although it does not participate in vehicle diagnostics communication, its role is critical in ensuring that AUTOSAR Basic Software modules behave according to specified contracts.

Function Inhibition Manager (FIM)

FIM enables runtime inhibition of specific functionalities (identified by Function Identifiers, FIDs) based on the status of diagnostic events managed by DEM. When an event assigned to an FID fails, FIM prevents associated software component functions from executing until conditions are restored, enhancing functional safety and fault containment. FIM works closely with DEM to monitor event statuses and its configuration defines inhibition rules mapped to functional modules.

FIM also supports both permanent and transient inhibition logic, allowing developers to fine tune behavior depending on whether a fault is persistent or recoverable. Additionally, it can interact with application layer software components to inform them about inhibited states, enabling adaptive behavior or fallback strategies during fault conditions in Diagnostic Stack in AUTOSAR.

Final Thoughts

In modern ECU implementations, monitors in SW‑Cs detect anomalies (e.g. sensor implausibility or communication timeout) and report event status via RTE to DEM. DEM may apply debouncing before setting the event to failed, update the occurrence counter and request NvM to store freeze frame data such as vehicle mileage or sensor values.

When an external diagnostic tester sends a UDS Read DTC Information request, DCM validates the session and security level, forwards the request to DEM and responds with formatted DTC list and statuses. This enables service technicians to retrieve fault history efficiently.

Functionality that depends on specific events, such as enabling cruise control, can be inhibited when DEM reports a critical phase fault; FIM enforces that the function remains inactive until the fault is cleared. DET ensures that during development wrong API usage is logged early, reducing bugs in deployment. DLT supports collecting trace logs from DET and DEM and sending them to external tools via PDU routing for debugging or test validation.

Diagnostic Stack in AUTOSAR enables standardized, scalable and reliable fault management and communication in automotive ECUs. The four core modules i.e. DEM, DCM, DET and FIM play a distinct role. Supporting modules like DLT and NvM ensure logging and persistence. Together they enable robust diagnostic support covering field servicing, safety and development use cases, while complying with standards such as UDS and ISO 14229.