UDS (Unified Diagnostic Services) is a standardized automotive diagnostic communication protocol
that is widely used in modern automotive electronic control units (ECUs) and diagnostic test
equipment. The UDS protocol helps engineers monitor, diagnose and maintain the health of the
vehicle. And through its defined services, engineers can read and change ECU memory, trigger tests,
control input and output signals and perform other diagnostic tasks.
The ISO 14229 standard defines the UDS protocol. It widely used in diagnostic bus types including
CAN, LIN, FlexRay and Ethernet.
Services in Diagnostic:
1. Diagnostic and communication management functional unit
2. Data transmission functional unit
3. Storage data transmission functional unit
4. Input and output control functional unit
5. Routine control functional unit
6. Upload and download functional unit
1.
a. 0x10 (DiagnosticSessionControl)
Description : Change the diagnostic session mode of the ECU. Generally, an ECU has several session
modes: Default session, Programming session, extended Diagnostic session etc. Session modes with
different behaviours and permissions are suitable for different diagnostic tasks.
b. 0x11 (ECUReset)
Description : Trigger the ECU to perform a soft reset. Used to restart the ECU or make the
configuration effective after programming.
c. 0x27 (SecurityAccess)
Description: Perform security authentication on the ECU to prevent unauthorized access through a
challenge-response mechanism.
d. 0x28 (CommunicationControl)
Description: Controls the communication behaviour of the ECU. For example, specific types of
communication can be enabled or disabled.
e. 0x29 (Authentication)
f. 0x3E (TesterPresent)
g. 0x84 (SecureDataTransmission)
h. 0x85 (controlDTCSetting)
i. 0x86 (ResponseOnEvent)
j. 0x87 (LinkControl)
2. Data transmission functional unit
a. 0x22 (ReadDataByIdetifier)
Description : Read the value of specific data in the ECU. Usually used to obtain the DID (Data
Identifier) data of the ECU.
b. 0x23 (ReadMemoryByIdentifier)
c. 0x24 (ReadScalingDatabyIdentifier)
d. 0x2A (ReadDataByPeriodicIdentifier)
e. 0x2C (DynamicallyDefineDataIdentifier)
f. 0x2E (WriteDataByIdentifier)
Description : Write data to a specific data identifier (DID) in the ECU.
g. 0x3D (WriteMemoryByAddress)
3.
0x14 (ClearDiagnosticInformation)
0x19 (ReadDTCInformation)
Description: Read the diagnostic trouble code information currently stored in the ECU, including the
trouble code, frequency etc.
4.
0x2F (InputOutputControlByIdentifier)
Description : Controls the input and output signals of the ECU. For Example, if can control the
ignition signal of the engine.
5. Routine control functional unit
0x31 (Routinecontrol)
6.
0x34 (RequestDownload)
Description : Request to download data to ECU memory. This is usually used for ECU firmware
upgrade.
0x35 (RequestUpload)
0x36 (TransferData)
Description : Transfer the actual data to the target memory. Used in conjunction with the request
download service.
0x37 (RequestTransferExit)
Description : Tell the ECU when data transmission is finished, ensuring that all data has been
transferred.
0x38 (RequestFileTransfer)
UDS Communication process :
the communication process of UDS is mainly divided into two parts : request and Response. The
typical communication process is as follows :
1. Establishing a diagnostic session : The client sends a diagnostic session control request
(0x10) to switch the ECU to an extended session or programming session.
2. Authentication: The Client is authenticated through the secure access service (0x27) to
obtain permission to access ECU functions or data.
3. Diagnostic operations : the client performs various diagnostic operations, such as reading
data (0x22), writing data (0x2E) and controlling input and output (0x2F).
4. End the diagnostic session : After completing the diagnostic task, end the diagnostic session
by sending an ECU reset (0x11) or a diagnostic session control request (0z10).
Error Response
UDS defines a series of error responses to help diagnostic programs handle various error situations.
The following are some common error response codes :
0x10 : Generic Denial of Service
0x11 : service not supported
0x12 : Sub-function not supported
0x13 : Format Error
0x22 : Incorrect condition
0x31 : the request is not supported or cannot be implemented
0x33 : Security access violation
0x35 : Key not qualified
Summarize
UDS (Unified Diagnostic Services) is a standardized communication protocol between automotive
electronic control units (ECUs) and diagnostic tools. It is widely used in the diagnosis, maintenance
and firmware updates of modern vehicles. By understanding and applying UDS services, engineers
can effectively perform vehicle diagnostics and repairs to ensure the reliability and safety of the
vehicle.