What Is Unified Diagnostic Service (UDS) Protocol?
What Is Unified Diagnostic Service (UDS) Protocol?
1
One of the major functions of UDS software stack is to store fault code in
the ECU memory for every issue that occurs in the vehicle and transfer it
(to the client side) as and when required.
The diagnostic tester tool has a GUI that connects to the ECU, retrieves
the fault code and displays it.
2
Following is the list of 4 important categories of services offered by an UDS protocol
stack
Upload/Download Capabilities
3
the vehicle, some system tests may be required to run over a
period of time.
For all such tasks, remote routine activation service of UDS
protocol is used.
In order to perform a test, a routine is triggered by the client, or
to put it in another words, a routine is started by the client in the
server’s memory.
There are two methods in this remote request, one is w here the
client interrupts the routine to stop it; and the other is when the
server/ECU finishes the routine after a specified time frame.
Using this service, the client can start a routine, stop a routine and
also check the result that the routine produced after a successful
execution.
For instance, the service personnel in the garage may use this
service to run the engine fan for a certain period of time and
record the results. This would help him understand a particular
issue well and rectify it without using any hit and trial method.
4
Usually, the permission to write some sensitive data to the ECU
can be controlled by restricting the access using ‘Security Access
Service’. Such permissions are reserved by the OEMs as it can
interfere with the security and overall functioning of the vehicl e.
Fault Diagnostics
5
1Introduction
An automobile as we know it was not invented in a single day by a single inventor.
It is more than an engine and a body; it is a complex machine that has undergone
over a century of evolution. Over the years we have seen a constant stream of
innovations and improvements in engine design. We have seen the advent of 4
wheel brakes, fuel injection and the automatic transmission.
Detecting a failure in this complex machine would be a tedious task. However, most
of the vehicles today include computers (Electronic Control Unit (ECU)), which
monitors several sensors, located throughout the engine, fuel and exhaust systems.
When the computer system of the car detects a fault, two things are supposed to
happen/monitored. First, a warning light on the dashboard is set, to inform the
driver that a problem exists. Second the code is recorded in the computer’s
memory (Electrically Erasable Programmable Read-Only Memory) so that it can
later be retrieved by a technician for diagnosis and repair.
The key to good auto repair lies in troubleshooting the problem. Problem in cars
could be caused due to number of reasons. Proper troubleshooting will eliminate
the potential issues that aren’t the real problem and point you in the right direction.
This can be achieved through ‘Diagnostics’.
Did you notice when a problem happens in a car or a vehicle? Ok!! Let me say one
situation.
There is a Check Engine Light (warning Lamp) present in our car’s dashboard, which
alerts us when a problem occurs in the engine control system. Depending on the
nature of the problem, the Check Engine Light may come on and go off, remain on
continuously or flash. Some intermittent problems will make the Check Engine Light
come on only when the fault is occurring. When the problem goes away, the Check
Engine Light goes off. So, When the Check Engine Light comes on, a diagnostic
trouble code (DTC) is recorded in the on-board computer memory that corresponds
to the fault. Some problems can generate more than one trouble code, and some
vehicles may have multiple problems that set multiple trouble codes.
6
2Overview of Diagnostics
2.1Diagnostics
Diagnostics, as the word suggests, is to identify the cause of a problem or a
situation. Whenever the ECU finds a problem, it stores that problem as a
Diagnostics Trouble Code (DTC) in the Electrically Erasable Programmable Read-
Only Memory (EEPROM) for later retrieval. Diagnostic Tools are used to read data
(DTC’s) from the EEPROM to analyze the cause of failure.
2.2Diagnostics Protocol
Protocol refers to a set of rules for communication. Here the communication
happens between two ECUs which follow the same rule and able to exchange the
information. The protocols which are used for Diagnostics purposes are known as
Diagnostics Protocol.
The automotive industry has come up with Diagnostics protocols which are used
for diagnostics purposes like, CAN (Control Area Network), K-Line, UDS (Unified
Diagnostics Services), and KWP (Keyword Protocol) and so on. Here (in this
document) we will study/know about UDS.
2.3Diagnostics Session
Diagnostic session is the basis for/of communication between the ECU and the
diagnostic tool. During ‘Diagnostics’ the ECU being analyzed is in a particular
session. Basically there are different types of diagnostics sessions like Default
Session, Extended Diagnostic Session and ECU Programming Session.
After Ignition on, ECU will be switched to a Default Diagnostic Session and after
receiving the request from Diagnostic Tool, the ECU will be switched to the
Extended Diagnostic Session. Further, after receiving the ECU Programming Session
start request from Diagnostic tool, it will switch to the ECU Programming Session.
7
Diagnostic Service uses the read command for retrieving the information/data from
ECU and the write command to write/program the data to the ECU.
Some of the services are given below as,
Ø Diagnostic Session Control
Ø ECU Reset
Ø Clear Diagnostic Information
Ø Read DTC Information
Ø Read Data By Identifier
Ø Read Memory By Address
Ø Security Access
Ø Communication Control
Ø Write Data By Identifier
Ø Input Output Control By Identifier
Ø Write Memory By Address
Ø Tester Present
Ø Control DTC Setting
For communicating with the ECU, the diagnostic tool uses either Physical
addressing or Functional addressing method. Physical addressing is the kind of
addressing where the Diagnostics tool communicates with a single ECU. Functional
addressing is where the Diagnostics tool communicates with multiple ECUs.
ISO 14229
Services
8
0x11 ECU Reset
9
0x37 Transfer Exit
10
in this document meet the needs of
the implementation. At no means shall
this response code be a general
replacement for other response codes
defined.
11
prescribed format for the specified
service.
0x22 Conditions Not Correct This response code indicates that the
requested action will not be taken
12
because the server prerequisite
conditions are not met.
13
This range of values is reserved for
0x32 ISO SAE Reserved
future definition.
14
more times than the server's security
strategy will allow.
15
This range of values is reserved for
0x74 - 0x77 ISO SAE Reserved
future definition.
16
server shall send a negative response
message with this response code.
This response code is in general
supported by each diagnostic service,
as not otherwise stated in the data link
specific implementation document,
therefore it is not listed in the list of
applicable response codes of the
diagnostic services.
17
another session, otherwise response
code 0x11 (service Not Supported)
shall be used. This response code is
in general supported by each
diagnostic service, as not otherwise
stated in the data link specific
implementation document, therefore it
is not listed in the list of applicable
response codes of the diagnostic
services.
18
met (current engine run time is below
a preprogrammed limit).
19
This response code indicates that the
requested action will not be taken
Transmission Range Not In because the server prerequisite
0x8C
Neutral condition for being in neutral is not met
(current transmission range is not in
neutral).
20
condition for voltage at the primary pin
of the server (ECU) is not met (current
voltage is below a pre-programmed
maximum threshold).
1 0x02 Test Failed This Operation Cycle DTC failed on the current operation cycle
Test Not Completed Since Last DTC test not completed since the last
4 0x10
Clear code clear
Test Not Completed This DTC test not completed this operation
6 0x40
Operation Cycle cycle
21
Server is requesting warning Indicator to
7 0x80 Warning Indicator Requested
be active
3DetailedDiagnostic Services
The services supported by the UDS protocol are described in the table below:
Service Name Description
Diagnostic Session Control Used to enable different diagnostic sessions in one
ECU or a group of ECUs.
ECU Reset Used by the external diagnostic tool to request an
ECU reset based on content of the reset type
parameter included in the ECU Reset request
message.
Clear Diagnostic Used by the external diagnostic tool to clear
Information diagnostic information in one or multiple ECU’s
memory.
Read DTC Information Allows a diagnostic tool to read the status of ECU
resident Diagnostic Trouble Code (DTC) information
from any ECU, or group of ECU’s within a vehicle.
Read Data By Identifier Allows the diagnostic tool to request data record
values from the ECU identified by Record data
identifier.
Read Memory By Address Allows the diagnostic tool to request memory data
from the ECU via provided starting address and size
of memory to be read.
Security Access Provides a means to access data and/or diagnostic
services, which have restricted access for security,
emissions, or safety reasons.
Communication Control Switches on and off the transmission of certain ECU
messages
Write Data By Identifier Allows the diagnostic tool to write information into
the ECU at an internal location specified by the
provided data identifier.
22
Input Output Control By Used by the diagnostic tool to substitute a value for
Identifier an input signal, internal ECU function and/or control
an output (actuator) of an electronic system.
Write Memory By Address Allows the external diagnostic tool to write
information into the ECU at one or more contiguous
memory locations.
Tester Present Used to indicate to an ECU or a group of ECU’s that
a diagnostic tool is still connected to the vehicle.
Control DTC Setting Used by diagnostics tool to stop or resume the
setting of DTCs in ECU.
23
Data Byte No. Parameter Name Data Value
1 Diagnostics Session Control 50
Response Service Id
2 sub Function 00-FF
3 Session Parameter Record 00-FF
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
Data Byte No. Parameter Name Data Value
1 Negative Response 7F
2 Diagnostics Session Control 10
3 sub function 00-FF
Sub function Not supported 12
Incorrect Message Length 13
or Invalid Format
Conditions are not correct 22
Negative Response
3.2ECU Reset
The ECU Reset service is used by the external diagnostic tool to request an ECU
reset based on content of the reset type parameter included in the ECU Reset
request message.
Basically there are two different types of ECU resets.
Hard Reset Soft Reset
Hard Reset:
This type identifies a “hard reset” condition which simulates the power-on/start-
up sequences typically performed after an ECU has been previously disconnected
from its power supply (i.e Battery). This implies the memory (Volatile or Non-
volatile) as well as electronic sub-components directly connected to the ECU are
initialized upon request of this reset type which are also initialized during the
power-up sequence.
Soft Reset:
This type identifies a “soft reset” condition, which causes the ECU to immediately
restart the application program if applicable. Before restarting the application the
24
ECU saves any data in non-volatile memory that might be lost during the startup
sequence.
The ECU Reset request message shall meet the format defined in the Table below,
Data Byte No. Parameter Name Data Value
1 ECU Reset Request Service Id 11
2 sub Function
Hard Reset – Positive 01
response required
Key On-Off Reset – Positive 02
Response Required
Soft Reset – Positive 03
Response Required
Request Message Definition – ECU Reset
ECU Reset Responses
If the response message is positive, then response should meet the format, given
in below table.
25
3.3Clear Diagnostic Information
The “Clear Diagnostic Information” service is used by the external diagnostic tool
to clear diagnostic information in one or multiple ECUs’ memory.
A “Clear DTC information” request shall reset/erase all DTC information including
the following:
a) DTC
b) DTC status byte
c) Other DTC related data such as first/most recent DTC, flags, counters, timers, etc.
specific to DTC
26
2 Clear Diagnostic 14
Information Request
Service Id
3 sub-function 00-FF
Incorrect Message Length – 13
Invalid Format
Conditions Not Correct 22
Request Out Of Range 31
Negative Response
27
Report Number Of Mirror 11
Memory DTC By Status
Mask
Report Number Of DTC By 07
Severity Mask Record
3 DTC Status Availability Mask 00-FF
4 DTC Format Identifier 00-FF
5 DTC Count [ 2] = [DTC Count 00-FF
High Byte DTC Count Low
Byte ]
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
28
If the response message is positive, then response should meet the format, given
in below table.
Data Byte No. Parameter Name Data Value
1 Read Data By Identifier 62
Response Service Id
2 Data Identifier[2] 00-FF
4 Data Record [2] 00-FF
Positive Response
If an ECU responds positively to a “Read Data By Identifier” request, the response
message Data Identifier parameter value shall be an echo of the value provided in
the request message by the diagnostics tool
And if the response message is negative, then response should meet the format,
given in below table.
29
Address And This parameter is a one byte value with each nibble encoded
Length Format separately :bit 3 – 0: Length(number of bytes) of the Memory
Identifier Address parameter bit 7 – 4: Length(number of bytes) of the
Memory Size parameter
Memory Address The parameter Memory Address is the starting address of
ECU’s memory where the data is to be written or from which
the data is to be read.
Memory Size The parameter Memory Size in the Read / Write Memory By
Address request message specifies the number of bytes to be
read or written starting at the address specified by Memory
Address in the ECU’s memory. The number of bytes used for
this size is defined by the high nibble (bit 7 – 4) of the Address
And Length Format Identifier.
Data Record This parameter is used by the Read Memory By Address
positive response message to provide the requested data
record values to the diagnostic tool. The content of the Data
Record is not defined in this document and is vehicle
manufacturer specific.
Read / Write Memory By Address Request Parameters
The “Read Memory By Address” request message shall meet the format defined in
table below.
Data Byte No. Parameter Name Data Value
1 Read Memory by Address Request Service ID 23
2 Address And Length Format Identifier 00-FF
3 Memory Address[2] 00-FF
4 Memory Size[2] 00-FF
Request Message Definition – Read Memory By Address
Read Memory By Address Responses
If the response message is positive, then response should meet the format, given
in below table.
Data Byte No. Parameter Name Data Value
1 Read Memory By Address Response Service Id 63
2 Data Record [2] = [data number 1,data number 2] 00-FF
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
30
Data Byte No. Parameter Name Data Value
1 Negative Response 7F
2 Read Data By Identifier 23
3 sub-function 00-FF
Incorrect Message Length- Invalid Format 13
Conditions Not Correct 22
Request Out of Range 31
Security Access Denied 33
Negative Response
3.7Security Access
The purpose of this service is to provide a means to access data and/or diagnostic
services, which have restricted access for security, emissions, or safety reasons. The
security concept uses a seed and key relationship.
Security Access Request Type Description
Security Description
Access type
Request This type specifies that the ECU shall transmit to the test device the
Seed so called seed value with a defined security level for calculating an
appropriate key value to unlock the ECU.
Send Key This type signalizes to the ECU that the diagnostic tool transmits
now the appropriate key value associated with the seed requested
before.
The Security Access request message shall meet the format defined in table below.
Data Byte No. Parameter Name Data
Value
1 Security Access Request Service 27
ID
2 sub Function = [Security Access 00-FF
type]
Request Seed – Positive Response 01
Required
Send Key – Positive Response 02
Required
3 Security key[1] 00-FF
Request Message Definition – Security Access
31
Security Access Responses
If the response message is positive, then response should meet the format, given
in below table.
Data Byte No. Parameter Name Data Value
1 Security Access Response Service Id 67
2 Security Access Type 00-FF
3 Security Seed [2] 00-FF
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
Data Byte No. Parameter Name Data Value
1 Negative 7F
Response
2 Security Access 27
3 sub-function 00-FF
Sub-Function Not Supported 12
Incorrect Message Length 13
Conditions Not Correct 22
Request Sequence Error 24
Invalid Key 35
Exceeded Number Of Attempts 36
Required Time Delay Not Expired 37
Negative Response
3.8Communication Control
The purpose of this service is to switch on and off the transmission of certain ECU
messages.
Control Type description
Some possible Communication Control types are,
Control Type Description
Enable Rx And This type indicates that the ECU shall enable reception and
Tx transmission of messages.
Enable Rx And This type indicates that the ECU shall enable reception of
Disable Tx messages and disable transmission of messages.
Communication Type description
32
Some possible Communication types are,
Control Type Description
Normal Communication This type references all application-related
Messages communication
Network Management This type references all network
Communication Messages management related communication.
The ECU shall perform the requested communication type control after sending the
Communication Control positive response message to the diagnostic tool if a
positive response is requested (Suppress Position Response Message Indication Bit
= FALSE).
In case no response is requested from the diagnostic tool (Suppress Position
Response Message Indication Bit = TRUE) then the ECU shall perform the requested
communication type control immediately after the successful evaluation of the
request message.
The Communication Control request message shall meet the format defined in the
Table below.
34
3 Data Record [2] 00-FF
Request Message Definition – Write Data By Identifier
Write Data By Identifier Responses
If the response message is positive, then response should meet the format, given
in below table.
Data Byte No. Parameter Name Data Value
1 Write Data By Identifier Response Service Id 6E
2 Data Identifier[2] 00-FF
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
Data Byte No. Parameter Name Data Value
1 Negative Response 7F
2 Write Data By Identifier 2E
3 sub-function 00-FF
Security Access Denied 33
Incorrect Message Length 13
Conditions Not Correct 22
Request Out Of Range 31
Negative Response
35
Reset To Default 01
Freeze Current State 02
Short Term 03
Adjustment
Request Message Definition – Input Output Control By Identifier
Input Output Control By Identifier Responses
The ECU shall send a positive response message if the requested control operation
was successfully executed. After an ECU returns a positive response to this service,
the diagnostic tool shall assume control over the inputs/outputs specified by the
Input Output Data Identifier.
If the response message is positive, then the expected response is as given in the
table below.
36
Security Access denied 33
Negative response
3.12Tester Present
This service is used to indicate to an ECU or a group of ECU’s that a diagnostic tool
is still connected to the vehicle and that certain diagnostic services and/or
communication that have been previously activated are to remain active.
The “Tester Present” request message shall meet the format defined in the Table
below.
Data Byte No. Parameter Name Data Value
1 Tester Present Request Service Id 3E
2 sub Function XX
Positive Response Required 00
No Positive Response Required 80
Request Message Definition – Tester Present
Tester Present Responses
If the response message is positive, then response should meet the format, given
in below table.
Data Byte No. Parameter Name Data Value
1 Tester Present Response Service Id 7E
2 sub Function 00
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
Data Byte No. Parameter Name Data Value
1 Negative Response 7F
2 Tester Present 3E
3 sub-function 00-FF
Sub Function Not Supported 12
Incorrect Message Length – Invalid Format 13
Negative Response
38
3.13Control DTC Setting
The “Control DTC setting” service is used by a diagnostic tool to stop or resume the
setting of DTCs in the ECU.
DTC setting type description
The below table defines the possible DTC Setting types,
DTC Setting Type Description
On This type requires the ECU to enable setting of DTCs.
Off This type requires the ECU to disable setting of DTCs.
The “Control DTC Setting” request message shall meet the format defined in the
Table below.
Data Byte No. Parameter Name Data
Value
1 Control DTC Setting Request Service 85
Id
2 Sub Function 00-FF
On – Positive Response 01
Required
Off – Positive Response 02
Required
Request Message Definition – Control DTC Setting
Control DTC Setting Responses
If an ECU responds positively to a “Control DTC Setting” request, the DTC Setting
type in the response shall match the DTC Setting sent in the request
If the response message is positive, then response should meet the format, given
in below table.
Data Byte No. Parameter Name Data Value
1 Control DTC Setting Positive Response Service Id C5
2 sub Function XX
Positive Response
And if the response message is negative, then response should meet the format,
given in below table.
39
Data Byte No. Parameter Name Data Value
1 Negative Response 7F
2 Control DTC Setting 85
3 sub-function 00-FF
Sub Function Not Supported 12
Incorrect Message Length – Invalid Format 13
Conditions Not Correct 22
Request Out Of Range 31
Negative Response
4Conclusion
Due to much technological advancement, today’s cars are more complex than ever
before and so the troubleshooting of car’s problem has even become more
complex and tedious job. Thanks to advanced diagnostic facilities within the car
which assist in pin-pointing the exact cause of trouble in a car.
40