Try Embedded

Automotive ECU diagnostics

Every ECU in a car answers a workshop tester. Learn the two protocols that carry that conversation, ISO-TP and UDS, and the fault memory, security and coding…

Role: Automotive diagnostics and ECU software engineer

The job day to day

You implement and debug diagnostic services against a tester's trace, argue with the manufacturer's conformance report about one negative response code, add a trouble code with its debounce and snapshot, and take a MISRA finding through review.

What you will be able to do

  • Segment and reassemble ISO-TP messages, with flow control, block size and STmin
  • Design a UDS server: sessions, the P2 and S3 timers, negative response codes in the standard's order
  • Implement SecurityAccess with an attempt counter and delay, and say what it does not protect
  • Debounce faults into trouble codes with a status byte, snapshots and ageing
  • Place diagnostics in the AUTOSAR Classic stack: CanIf, CanTp, PduR, Dcm, Dem, NvM
  • Write and defend MISRA C code: essential types, single exit, documented deviations
  • Bring up a CAN controller from its registers and read a bus trace

Standards

  • ISO 14229-1 (UDS)
  • ISO 15765-2 (ISO-TP)
  • ISO 11898 (CAN)
  • AUTOSAR Classic
  • MISRA C:2012
  • ISO 26262

Before you start

A1 ISO-TP: messages longer than a frame

How 4095 bytes cross a bus whose frames hold 8: the four frame types, flow control, block size, STmin, and the timeouts that end a transfer.

A2 UDS: the diagnostic services

The request and response format every ECU shares, sessions and their timers, reading and writing data, the fault memory's services, security access and routines.

A3 The production ECU

What surrounds the protocol in a real project: the AUTOSAR stack that hosts it, how a fault becomes a stored trouble code, and the coding standard every line is reviewed against.

Capstone: Body control module diagnostics

Six graded stages in bare-metal C on a Nucleo-F446RE. A simulated workshop tester on the CAN bus sends the requests; hidden tests check every response, its timing and the cases a conformance test looks for.