Embed IO Private Limited is an automotive software company in Mogappair East, Chennai, Tamil Nadu, and UDS stack work is a regular part of our ECU projects. If you write ECU software, you will meet Unified Diagnostic Services sooner or later, whether for end-of-line testing, service tools or software updates. This post covers UDS the way a developer needs it: how it works, the services you will use, and the mistakes that cost the most time.

What Is UDS?
UDS (Unified Diagnostic Services) is defined in ISO 14229. It is the standard way for an external tester to talk to an ECU. You use it to read data, read faults, run routines, change settings and even reprogram software.

UDS follows a client-server model. The tester is the client and sends requests. The ECU is the server and sends responses.

Transport: CAN and Ethernet
UDS needs a way to carry its messages.
• On CAN: messages travel over ISO-TP (ISO 15765-2), which splits long messages into CAN frames.
• On Ethernet: messages travel over DoIP (Diagnostics over IP, ISO 13400).
The UDS services themselves stay the same. Only the carrier changes. That is why a well-designed stack separates the diagnostic layer from the transport layer.

Sessions
An ECU works in different diagnostic sessions, and each session allows different services.
• Default session: the normal state after power-up
• Programming session: used for software download
• Extended session: allows more services, used for tuning and tests
The tester switches sessions with the Diagnostic Session Control service. If the tester goes quiet, the ECU returns to the default session after a timeout, so a Tester Present message keeps it alive.

Services You Will Use Most
Each service has a Service Identifier (SID):
• 0x10 Diagnostic Session Control
• 0x11 ECU Reset
• 0x14 Clear Diagnostic Information
• 0x19 Read DTC Information
• 0x22 Read Data By Identifier
• 0x27 Security Access
• 0x2E Write Data By Identifier
• 0x31 Routine Control
• 0x34 / 0x36 / 0x37 Request Download, Transfer Data, Request Transfer Exit
• 0x3E Tester Present
A positive response uses the request SID plus 0x40. So a response to 0x22 starts with 0x62.

A Simple Example
Switch to the extended session:
Request: 10 03
Response: 50 03 00 32 01 F4
The response confirms the session and gives timing values: P2 of 50 ms and P2* of 5000 ms (0x01F4 in units of 10 ms).
Read a vehicle identification number, using the data identifier 0xF190:
Request: 22 F1 90
Response: 62 F1 90 <17 bytes of VIN>
A request the ECU cannot serve returns a negative response:
Response: 7F 22 31
Here 0x7F marks a negative response, 0x22 is the service and 0x31 is the code "request out of range".

Security Access
Some services must be protected. Security Access (0x27) uses a seed and key method:

  1. The tester asks for a seed with 27 01.
  2. The ECU replies with a seed: 67 01 .
  3. The tester calculates a key and sends 27 02 .
  4. If the key is right, the ECU unlocks the protected services. Keep the key algorithm out of the ECU's easy reach, limit wrong attempts and add a delay after failures. A weak implementation here is a real security risk.

Common Mistakes
• Ignoring the pending response. Code 0x78 means "response pending". The tester must wait, and the ECU must send it when a service takes longer than P2.
• Wrong timing. Not following P2 and P2* leads to random timeouts that only appear on some testers.
• Session handling gaps. Forgetting to return to the default session after a timeout leaves the ECU in the wrong state.
• Missing negative responses. Returning silence instead of a correct code makes debugging painful.
• Mixed-up identifiers. Wrong DID or routine numbers waste hours during integration.
• Weak security access. Fixed seeds or unlimited attempts defeat the purpose.

Testing Tips
• Test each service for positive and negative cases
• Test in every session
• Test timeouts, pending responses and loss of tester
• Test over both CAN and DoIP if your ECU supports both
• Keep a log of full byte-level traffic for every failing case

UDS, Bootloaders and Software Updates
UDS is the base of the usual ECU update flow. The tester enters the programming session, unlocks security access, sends the new software with the download services, and then resets the ECU. A modern over-the-air update system builds on this idea. See our page on automotive FOTA software development for how updates are managed on the vehicle.

Where UDS Fits in the AUTOSAR World
On Classic AUTOSAR ECUs, UDS is handled by the Dcm and Dem modules. Teams must configure them correctly and connect them to application software. Our Classic AUTOSAR development services cover this integration. Gateways and connected units also need to route diagnostic traffic across networks, which is covered in our gateway ECU and TCU software work.

About Embed IO
Embed IO is a Chennai-based engineering centre working with customers across India and globally. We build UDS and DoIP stacks as part of ECU software development, with turnkey embedded hardware and software under one team. Read more on our automotive UDS protocol stack development page. Reach us at CDS WORKPRO 333, Thiruvalluvar Salai, Paneer Nagar, Mogappair East, Chennai 600037, on +91 9566 176 171 or info@embedio.in.

FAQs
What is UDS in automotive?
UDS, or Unified Diagnostic Services, is defined in ISO 14229. It is the standard protocol a tester uses to read data, read faults, run routines and update software on an ECU.

What is the difference between UDS and DoIP?
UDS defines the diagnostic services. DoIP (ISO 13400) is a transport that carries UDS messages over Ethernet instead of CAN.

What does negative response code 0x78 mean?
It means "response pending". The ECU needs more time and will send the final response later.

What is Security Access in UDS?
It is service 0x27. It uses a seed and key exchange to unlock protected services such as software download.

Which module handles UDS in Classic AUTOSAR?
The Dcm module handles diagnostic communication, and the Dem module handles diagnostic event and fault memory.