The Diagnostic Event Manager (DEM) module is responsible for the diagnostics and fault management of AUTOSAR based ECUs. It is a critical component within the AUTOSAR framework.

What is DEM module in AUTOSAR?

The DEM module is a part of the AUTOSAR Basic Software (BSW) and is responsible for handling diagnostic events. It reads event data from memory and stores diagnostic event related data to memory. DEM provide this information to the DCM (Diagnostic Communication Manager) module of the AUTOSAR. It acts as a central point for the management of diagnostic events, providing services for storing, retrieving, and processing diagnostic event data. Service $19 in the UDS protocol is related to the DEM module. BSW modules and Software Components (SWCs) uses DEM APIs to report an event status i.e. PASS or FAIL). The DEM module offers interfaces to the Application layer and to other BSW modules in AUTOSAR.

Dependencies of the DEM module to other software modules in AUTOSAR

Image Courtesy

Software Components (SWCs) interact with the DEM via the Runtime Environment (RTE), utilizing either Client-Server or Sender-Receiver ports. SWCs report event status to the DEM, and in turn, the DEM retrieves snapshot data from SWCs. DCM and DEM exchange diagnostic information through the AUTOSAR interface, which includes UDS operations like Service No. $19 to read DTC status or snapshot data. The DEM communicates with the Non-Volatile Memory (NVM) module using the AUTOSAR interface for reading and writing diagnostic information into memory. Additionally, other BSW) modules report event statuses to the DEM, indicating whether an event has passed or failed.

Dependencies of DEM to other software modules

The DEM has dependencies to the following Software Components in AUTOSAR:

Function Inhibition Manager (FiM)

FiM is responsible for evaluating and linking events to the necessary actions within Software Components, such as inhibiting specific monitors. When the DEM detects a change in monitor status, it informs and updates the FiM. This allows the FiM to either halt or activate functions based on the predefined dependencies.

Diagnostic Communication Manager (DCM)

DCM manages the communication for UDS and SAE J1979 protocols, handling diagnostic service execution. It processes diagnostic requests from external testers or onboard systems and forwards these requests from an external diagnostic scan tool. Additionally, the DCM is responsible for assembling response messages, such as DTCs and status information, which are then sent back to the external diagnostic scan tool.

Diagnostic Communication Manager for J1939 (J1939DCM)

The J1939 Diagnostic Communication Manager (J1939DCM) is responsible for handling the diagnostics communication protocol as specified in SAE J1939-73.

SWC and BSW

Software Components (SW-Cs) and Basic Software (BSW) modules can interact with the DEM to update or access the current monitor and UDS status information. These modules can retrieve data from the DEM to perform tasks such as turning indicator lamps on or off. The monitor is considered a sub-component of a SW-C or BSW module.

NVRAM Manager (NvM)

The NVRAM Manager (NvM) offers mechanisms for storing data blocks in non-volatile RAM (NVRAM). These blocks, whose maximum size depends on configuration, are linked to the DEM and utilized to maintain the permanent storage of UDS status information and related data, even after events like a power-on reset.

ECU State Manager (EcuM)

The ECU State Manager handles the core initialization and de-initialization processes for basic software components, including the DEM.

Runtime Environment (RTE)

The Runtime Environment manages scheduling for BSW within an ECU. It assigns priorities and ensures memory protection for each BSW module in use.

Data Provider

Software Components (SW-Cs) and/or Basic Software (BSW) modules act as data providers, supplying the DEM with necessary data, such as event-related information. This data is crucial for the DEM to create and manage event memory entries effectively.

What is Event Debouncing?

Event Debouncing is a technique used to prevent the logging of transient or spurious events caused by brief fluctuations or noise in the system. By applying a de-bounce mechanism, the DEM module ensures that only stable and persistent faults are recorded, filtering out brief, non-critical changes. This process improves the accuracy of fault reporting and reduces the risk of unnecessary diagnostic messages or false positives.

Types of Event Debouncing in DEM module

There are two types of event debouncing strategies used in the DEM module:

Time-Based Debouncing

Time-Based Debouncing involves setting a time threshold that an event must persist before it is considered valid and logged. If an event occurs and then disappears within this time period, it is ignored to prevent transient or short-lived events from being recorded. This helps ensure that only stable events are registered.

Counter-Based Debouncing

Counter-Based Debouncing approach uses a counter to track the number of occurrences of an event within a specified time window. An event is only considered valid if it occurs a certain number of times consecutively or within the defined period. This method helps to filter out brief or sporadic events and reduces false positives.

Functionality of DEM Module

  1. Event Management: The DEM module handles the recording of diagnostic events, such as fault occurrences or the status of diagnostic functions. It enables the tracking of diagnostic information, including fault codes and their status, which can be used for troubleshooting and maintenance.
  2. Storage and Retrieval: It manages the storage and retrieval of event-related data, ensuring that this information is available for diagnostic tools. It ensures that diagnostic events and fault information are saved to non-volatile memory for persistent storage. This functionality helps maintain a comprehensive record of system health and facilitates effective troubleshooting.
  3. Status Monitoring: The DEM module monitors the status of diagnostic events and provides updates on the event status. It continuously updates the status of each event, such as whether a fault is active, confirmed, or cleared.
  4. Fault Handling: DEM module’s Fault Handling functionality involves detecting, classifying, and managing diagnostic faults within the vehicle system. It records details about each fault, such as severity and occurrence, and provides mechanisms for fault confirmation, clearing, and reporting.
  5. Communication: The DEM module interfaces with other modules and tools, facilitating the communication of diagnostic information across the vehicle network.

Key Components of the DEM Module

The DEM module consists of several key components, each playing a specific role in the management of diagnostic events:

Event Memory

The Event Memory is responsible for storing diagnostic events. It maintains a record of each event, including information such as the event ID, status, and timestamp. This data is crucial for fault analysis and troubleshooting.

Event Status

The Event Status component monitors and updates the status of each diagnostic event. It tracks the event lifecycle, from detection to confirmation and healing. The status information is essential for determining the current state of an event and making decisions based on that state.

Freeze Frame Data

Freeze Frame Data captures a snapshot of the system state at the time of a fault occurrence. This data includes parameters such as sensor readings, actuator statuses, and other relevant information. Freeze Frame Data is invaluable for diagnosing the root cause of a fault.

Extended Data

Extended Data provides additional information about diagnostic events, complementing the Freeze Frame Data. It includes details such as the number of occurrences, event severity, and environmental conditions at the time of the fault.

Final Thoughts

The Diagnostic Event Manager (DEM) module is a cornerstone of the AUTOSAR framework, providing essential services for the management of diagnostic events. Its ability to handle event recording, status monitoring, and fault handling makes it indispensable for modern automotive systems. As vehicles become more complex and connected, the DEM module will continue to play a crucial role in ensuring vehicle safety, reliability, and compliance with regulatory standards.