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.
- ISO-TP: frames and segmentation · Single, first, consecutive and flow control frames, addressing, padding, and CAN FD.
- ISO-TP: flow control and timing · Block size, STmin, the N_ timers, wait and overflow, and a receiver that survives a bad sender.
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.
- UDS: requests, sessions and timing · Service identifiers, negative response codes and their order, sessions, P2, P2*, S3 and response pending.
- UDS: data identifiers and the fault memory · Reading and writing DIDs, and the services that report and clear trouble codes.
- UDS: security access, routines and reset · Seed and key, attempt counters and delays, RoutineControl, ECUReset, and what real security needs.
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.
- AUTOSAR Classic for diagnostics engineers · The layered architecture, the path of a diagnostic request through CanIf, CanTp, PduR, Dcm and Dem, and NvM.
- The life of a trouble code · Monitors, debouncing, the status byte, operation cycles, confirmation, ageing, snapshots and storage.
- MISRA C on a real project · Guidelines and their categories, the rules that change how you write, deviations, and compliance claims.
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.