Contents

UDS and diagnostic trouble codes

The universal diagnostic language of ECUs — sessions, fault memory, routines and reprogramming — and how DTCs help workshops find faults.

Why it exists

Workshops need a common way to ask any ECU what is wrong, read data and update software. UDS (Unified Diagnostic Services) is that common language.

What it is

A request/response protocol with numbered services, e.g.:

  • 0x10 Diagnostic Session Control (default, extended, programming)
  • 0x22 / 0x2E Read / Write Data By Identifier
  • 0x19 / 0x14 Read / Clear DTC Information
  • 0x31 Routine Control
  • 0x27 / 0x29 Security Access / Authentication
  • 0x34 / 0x36 / 0x37 Download (reprogramming)

DTCs are fault codes with status bits (e.g. test failed, confirmed) plus snapshot and extended data.

ReadDTCInformation request and positive response
Tester request0x19 | 0x02 | DTCStatusMask
ECU positive response0x59 | 0x02 | DTCStatusAvailabilityMask | DTCAndStatusRecords

Example for sub-function 0x02 (reportDTCByStatusMask): each item is one byte except the final records, which contain zero or more three-byte DTCs each followed by one status byte; transport headers are omitted.

ReadDTCInformation negative response
Negative SID1 byte0x7F0
Request SID1 byte0x19 — original service1
NRC1 byteNegative response code2

A UDS negative response contains these three bytes, without a sub-function echo; transport headers are omitted.

How it works in an ECU

Monitors detect faults → Dem debounces them and stores DTCs → a tester reads them via Dcm → workshop repairs → DTCs are cleared.

Best practices

  • Define DTCs from the workshop’s perspective: actionable and specific.
  • Debounce carefully to avoid false entries.
  • Protect write, routine and download services.

Common pitfalls

  • DTC floods during low-voltage events or network sleep transitions.

What it means for your discipline

  • Diagnostics & lifecycle Core

    Specifies diagnostic services, DTCs and their detection conditions, and the data workshops need.

  • Base software Core

    Dcm handles services and sessions, Dem manages fault memory and debouncing.

  • Cybersecurity Partial

    Sensitive services (writing data, reprogramming, routines) must be protected by authentication.

  • Networks & communication Partial

    UDS runs over CAN (ISO-TP) or Ethernet (DoIP); gateways route requests.

  • Functional safety Partial

    Diagnostic actuations must not create hazards; some must be blocked while driving.

  • Software update & OTA Partial

    Uses programming sessions, authentication, download services and routines to flash ECUs; handles response codes, timing and resets and checks diagnostic state after installation.

No direct stake: E/E architecture · HPC & application software · Hardware & silicon

Where it sits in the software stack

Generic layered software of a central HPC (application processor with hypervisor, plus a safety island) and of a classic MCU-based ECU (AUTOSAR Classic). Highlighted modules matter for this topic. Click any module to open its page.

HPC · application processor (MPU) and safety island (MCU)
  • Diagnostics — Provides UDS diagnostic access where supported and translates diagnostic requests to UDS for connected classic ECUs.
MCU-based ECU · AUTOSAR Classic
  • Diagnostics — Dcm handles UDS services and sessions; Dem debounces fault reports and manages DTC status and associated records.
  • Application layer — Detects application faults, reports diagnostic events and implements diagnostic data access and routines.
  • Flash bootloader · secure boot — Executes programming sessions, firmware downloads and verification routines through UDS services.