AUTOSAR Module DEM — Diagnostic Event Manager

Malik Vindhani
3 min readApr 16, 2024

--

DEM is present at system service layer in AUTOSAR architecture module.

  • DEM is responsible for processing and storing diagnostic events (errors) and storing event and event related data to NvM.
  • The Dem provides fault information to the DCM (e.g. read all stored DTCs from the event memory). The Dem offers interfaces to the application layer and to other BSW modules. UDS service no. $19 is completely related to DEM module.
  • Software Components (SWCs) and BSW modules use DEM APIs to report an event status i.e. event is passed or failed.
  • The AUTOSAR Diagnostic Event Manager (Dem) has interfaces and dependencies to the following Basic software modules and Software Components:
Dependencies of DEM module

DEM communicates with the following modules:

  1. Function Inhibition Manager (FiM): The Dem informs and updates the Function Inhibition Manager (FiM) upon changes of the monitor status in order to stop or release function entities according to assigned dependencies. The FiM is closely related to the DEM since diagnostic events and their status information are supported as inhibit conditions. If the failure is detected and the event is reported to the DEM, the FiM then inhibits the FID and therefore the corresponding functionality is disabled.
  2. Diagnostic Communication Manager (DCM): It forwards requests coming from an external diagnostic scan tool and is further responsible for assembly of response messages (DTC, status information, etc.) which will be transferred to the external diagnostic scan tool afterwards.
  3. Software-Components (SW-C) and Basic Software (BSW): Modules can access the DEM to update and/or retrieve current monitor status and UDS status information. SW-Cs and BSW modules can retrieve data from the DEM e.g. to turn the indicator lamps on or off.
  4. NVRAM Manager (NvM): It provides mechanisms to store data blocks in NVRAM. NVRAM blocks (maximum size is a matter of configuration) are assigned to the DEM and used by the DEM to achieve permanent storage of UDS status information and associated data.
  5. ECU State Manager (EcuM): It is responsible for the basic initialization and de-initialization of basic software components including DEM.
  6. RTE: It implements scheduling mechanisms for BSW, e.g. assigns priority and memory protection to each BSW module used in an ECU.

In General, SWCs communicate with DEM module through RTE, using Client Server port or Sender receiver port. SWC communicates to report status of event to DEM and DEM reads data from SWCs to collect snapshot data. DCM module communicates with DEM to read Diagnostic information (i.e. Service No 19 Read DTC status or Read Snapshot data). DEM communicates with NVM to read and write diagnostic information into memory. Other BSW modules communicates to DEM module to report BSW event status whether event is passed or failed.

Common Diagnostic terms related to DEM:

  • Diagnostic Event: A ‘Diagnostic Event’ defines the atomic unit that can be handled by the Dem module. The status of a ‘Diagnostic Event’ represents the result of a diagnostic monitor . The event id is unique per event. SWCs or BSW modules reports event status to DEM using event id. Event ids are assigned by DEM module.
  • DTC: Diagnostic trouble code (DTC) is associated with an event. When event is reported as passed or failed, status of DTC changes. DCM uses DTC number to read information about diagnostic event and DTC.
  • DTC Status Byte: DTC status is stored in a byte called DTC status byte. For each diagnostic event, DEM module maintains a UDS DTC status byte information. Bit 0 to Bit 7 represents DTC status.

Bit 0 : Test Failed
Bit 1 : This Failed This Operation Cycle
Bit 2 : Pending DTC
Bit 3 : Confirmed DTC
Bit 4 : Test Not Completed Since Last Clear
Bit 5 : Test Failed Since Last Clear
Bit 6 : Test Not Completed This Operation Cycle
Bit 7 : Warning Indicator Requested

--

--