Unified Diagnostic Services

Last updated

Unified Diagnostic Services (UDS) is a diagnostic communication protocol used by electronic control units (ECUs) in automotive electronics. [1] UDS is defined by ISO 14229 and evolved from ISO 14230 (KWP2000), which is now largely obsolete. UDS specifies functionality at the session, presentation, and application layers (layers 5–7) of the OSI model. Because of this, it can operate on different physical and data link layers such as CAN (ISO 11898), LIN (ISO 17987), Ethernet (ISO 13400), FlexRay (ISO 17458), and K-Line (ISO 14230). In practice, UDS is most commonly used over CAN via Diagnostic over CAN (DoCAN), defined in ISO 15765.

Contents

The term “Unified” refers to the fact that UDS is an international standard rather than a manufacturer-specific protocol. Today, nearly all Tier 1 suppliers implement UDS in ECUs developed for automotive original equipment manufacturers (OEMs). UDS is also integrated into larger software architectures, including AUTOSAR.

Modern vehicles have a diagnostic interface for on-board diagnostics, which makes it possible to connect a computer (client) or diagnostics tool, which is referred to as tester, to the communication system of the vehicle. Thus, UDS requests can be sent to the controllers which provide responses (this may be positive or negative). This makes it possible to interrogate the fault memory of the individual control units, to update them with new firmware, have low-level interaction with their hardware (e.g. to turn a specific output on or off), or to make use of special functions (referred to as routines) to attempt to understand the environment and operating conditions of an ECU to be able to diagnose faulty or otherwise undesirable behavior.

Services

SID (Service Identifier) [2]

Request Service Identifier (SID)Response Service Identifier (RSID)Service nameDescription
0x100x50DiagnosticSessionControl [3] DiagnosticSessionControl service is used to change diagnostic sessions in the server(s). In each diagnostic session a different set of diagnostic services (and/or functionalities) is enabled in the server.

Server shall always be in exactly one diagnostic session.

0x110x51ECUReset [4] ECUReset service is used by the client to request that the server perform a reset. The server, after receiving this request, performs the specified type of reset (either before or after transmitting the positive response).
0x140x54ClearDiagnosticInformation [5] ClearDiagnosticInformation service is used by the client to clear Diagnostic Trouble Codes (DTCs) and related data stored in one or more server memories.
0x190x59ReadDTCInformation [6] ReadDTCInformation service allows the client to request current Diagnostic Trouble Code (DTC) information from one or more servers within the vehicle.
0x220x62ReadDataByIdentifier [7] ReadDataByIdentifier service allows the client to request data record values from the server identifier by one or more DataIdentifiers (DIDs).
0x230x63ReadMemoryByAddress [8] ReadMemoryByAddress service allows the client to request server’s memory data stored under provided memory address.
0x240x64ReadScalingDataByIdentifier [9] ReadScalingDataByIdentifier service allows the client to request the scaling information associated with a Data Identifier (DID). Scaling data provides information required to correctly interpret the actual data value, such as:
  • data encoding type (e.g. integer, floating-point, ASCII)
  • units and formats
  • conversion formulas and coefficients
  • bit mappings, and other interpretation details
0x270x67SecurityAccess [10] SecurityAccess service allows the client to unlock functions/services with restricted access.

Unlocking sequence:

  1. The client requests a seed from the server.
  2. The server responds with a positive response that includes a randomly generated seed value.
  3. Both the client and server compute a key value based on the seed (using a secret algorithm).
  4. The client sends the computed key to the server.
  5. The server validates the client by comparing the received key with its own calculated key. If they match, the client is granted access to the protected functionality for the corresponding security level.
0x280x68CommunicationControl [11] CommunicationControl service allows the client to switch on/off the transmission and/or the reception of certain messages on the server(s).
0x290x69Authentication [12] Authentication service provides a mechanism for the client to prove its identity, allowing access to data and/or diagnostic services that have restricted access due to security, emissions, or safety requirements.

It is an alternative for SecurityAccess service.

0x2A0x6AReadDataByPeriodicIdentifier [13] ReadDataByPeriodicIdentifier service allows the client to request periodic transmission of data record values from the server. Each periodic data record is identified by Periodic DID (the second byte of a DID with a fixed first byte 0xF2).
0x2C0x6CDynamicallyDefineDataIdentifier [14] DynamicallyDefineDataIdentifier service allows the client to define Data Identifiers.
0x2E0x6EWriteDataByIdentifier [15] WriteDataByIdentifier service allows the client to set data values stored under given Data Identifier.
0x2F0x6FInputOutputControlByIdentifier [16] InputOutputControlByIdentifier service allows the client to take temporary control over Data Identifier values.
0x310x71RoutineControl [17] RoutineControl service allows the client to execute any sequence of actions that are defined as routines. Each routine has Routine Identifier assigned.
0x340x74RequestDownload [18] RequestDownload service allows the client to initiate data transfer from the client to the server.
0x350x75RequestUpload [19] RequestUpload service allows the client to initiate data transfer from the server to the client.
0x360x76TransferData [20] TransferData service transfers the actual data that were earlier requested by either RequestDownload, RequestUpload or RequestFileTransfer service.
0x370x77RequestTransferExit [21] RequestTransferExit services ends the data transmission using TransferData service.
0x380x78RequestFileTransfer [22] RequestFileTransfer service allows the client to initiate a file transfer (either download or upload).

It is an alternative for RequestDownload and RequestUpload services.

0x3D0x7DWriteMemoryByAddress [23] WriteMemoryByAddress service allows the client to set values directly in the server's memory.
0x3E0x7ETesterPresent [24] TesterPresent service informs server(s) that the diagnostic tester device (client) is connected and server(s) shall not exit their current diagnostic session.
0x830xC3AccessTimingParameter [25] AccessTimingParameter was withdrawn in ISO 14229-1:2020.
0x840xC4SecuredDataTransmission [26] SecuredDataTransmission service allows the client to secure UDS communication using either encryption or signature.
0x850xC5ControlDTCSettings [27] ControlDTCSettings service allows the client to manage DTCs' statuses updating.
0x860xC6ResponseOnEvent [28] ResponseOnEvent service allows the client to define events and request messages that the server is supposed to respond to when the event occurs.

This can be used to diagnose complicated issues. For example the client can request from the server to respond to ReadMemoryByAddress request (to provide detailed information about the reason for DTC reporting) when testFailed bit of a certain DTC is set.

0x870xC7LinkControl [29] LinkControl service allows the client to change physical connection parameters.

As an example, for CAN bus, the client could change baudrate and version of CAN protocol (e.g. from CAN-FD to Classical CAN).

Diagnostic Message

There are two types of diagnostic messages transmitted using UDS protocol:

Request Message

Request messages are transmitted by a Client towards one or more Servers. [30]

Service Identifier (SID) is the first byte in each request message. [31]

Response Message

Response messages are transmitted by Servers to a Client. [32]

The first byte in the response message is usually Response Service Identifier (RSID) value (with the exception of following responses to ReadDataByPeriodicIdentifier service). [33] [13]

Positive Response Message

If a server responds with a positive response message, it means that the server received the corresponding request message and executed actions requested by a client. [34]

Format of each positive response message is specific for the diagnostic service it relates to.

Negative Response Message

If a server responds with a negative response message, it means that (for some reason) the server could not execute actions requested by a client. [35]

Negative Response Message format
ByteValueDescription
#10x7FNegative Response SID
#2SIDSID value from request message
#3NRCreason for the rejection
Negative Response Codes

Negative Response Codes (NRC in short) carry the information for request message rejection. [36]

Negative Response Codes [36]
ValueName
0x10generalReject
0x11serviceNotSupported
0x12SubFunctionNotSupported
0x13incorrectMessageLengthOrInvalidFormat
0x14responseTooLong
0x21busyRepeatRequest
0x22conditionsNotCorrect
0x24requestSequenceError
0x25noResponseFromSubnetComponent
0x26FailurePreventsExecutionOfRequestedAction
0x31requestOutOfRange
0x33securityAccessDenied
0x34authenticationRequired
0x35invalidKey
0x36exceedNumberOfAttempts
0x37requiredTimeDelayNotExpired
0x38secureDataTransmissionRequired
0x39secureDataTransmissionNotAllowed
0x3AsecureDataVerificationFailed
0x50Certificate verification failed, Invalid Time Period
0x51Certificate verification failed, Invalid Signature
0x52Certificate verification failed, Invalid Chain of Trust
0x53Certificate verification failed, Invalid Type
0x54Certificate verification failed, Invalid Format
0x55Certificate verification failed, Invalid Content
0x56Certificate verification failed, Invalid Scope
0x57Certificate verification failed, Invalid Certificate (revoked)
0x58Ownership verification failed
0x59Challenge calculation failed
0x5ASetting Access Rights failed
0x5BSession key creation/derivation failed
0x5CConfiguration data usage failed
0x5DDeAuthentication failed
0x70uploadDownloadNotAccepted
0x71transferDataSuspended
0x72generalProgrammingFailure
0x73wrongBlockSequenceCounter
0x78requestCorrectlyReceived-ResponsePending
0x7ESubFunctionNotSupportedInActiveSession
0x7FserviceNotSupportedInActiveSession
0x81rpmTooHigh
0x82rpmTooLow
0x83engineIsRunning
0x84engineIsNotRunning
0x85engineRunTimeTooLow
0x86temperatureTooHigh
0x87temperatureTooLow
0x88vehicleSpeedTooHigh
0x89vehicleSpeedTooLow
0x8Athrottle/PedalTooHigh
0x8Bthrottle/PedalTooLow
0x8CtransmissionRangeNotInNeutral
0x8DtransmissionRangeNotInGear
0x8FbrakeSwitch(es)NotClosed (Brake Pedal not pressed or not applied)
0x90shifterLeverNotInPark
0x91torqueConverterClutchLocked
0x92voltageTooHigh
0x93voltageTooLow
0x94ResourceTemporarilyNotAvailable

See also

References

  1. "Iso 14229-1:2020 Unified diagnostic services (UDS) Part 1: Application layer".
  2. Dąbrowski, Maciej. "Diagnostic Service — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-09.
  3. Dąbrowski, Maciej. "Diagnostic Service (DiagnosticSessionControl) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-09.
  4. Dąbrowski, Maciej. "Diagnostic Service (ECUReset) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  5. Dąbrowski, Maciej. "Diagnostic Service (ClearDiagnosticInformation) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  6. Dąbrowski, Maciej. "Diagnostic Service (ReadDTCInformation) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  7. Dąbrowski, Maciej. "Diagnostic Service (ReadDataByIdentifier) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  8. Dąbrowski, Maciej. "Diagnostic Service (ReadMemoryByAddress) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  9. Dąbrowski, Maciej. "Diagnostic Service (ReadScalingDataByIdentifier) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  10. Dąbrowski, Maciej. "Diagnostic Service (SecurityAccess) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  11. Dąbrowski, Maciej. "Diagnostic Service (CommunicationControl) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  12. Dąbrowski, Maciej. "Diagnostic Service (Authentication) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  13. 1 2 Dąbrowski, Maciej. "Diagnostic Service (ReadDataByPeriodicIdentifier) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  14. Dąbrowski, Maciej. "Diagnostic Service (DynamicallyDefineDataIdentifier) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  15. Dąbrowski, Maciej. "Diagnostic Service (WriteDataByIdentifier) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  16. Dąbrowski, Maciej. "Diagnostic Service (InputOutputControlByIdentifier) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  17. Dąbrowski, Maciej. "Diagnostic Service (RoutineControl) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  18. Dąbrowski, Maciej. "Diagnostic Service (RequestDownload) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  19. Dąbrowski, Maciej. "Diagnostic Service (RequestUpload) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  20. Dąbrowski, Maciej. "Diagnostic Service (TransferData) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  21. Dąbrowski, Maciej. "Diagnostic Service (RequestTransferExit) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  22. Dąbrowski, Maciej. "Diagnostic Service (RequestFileTransfer) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  23. Dąbrowski, Maciej. "Diagnostic Service (WriteMemoryByAddress) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  24. Dąbrowski, Maciej. "Diagnostic Service (TesterPresent) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  25. Dąbrowski, Maciej. "Diagnostic Services (AccessTimingParameter) — py-uds documentation". uds.readthedocs.io. Retrieved 2026-01-08.
  26. Dąbrowski, Maciej. "Diagnostic Service (SecuredDataTransmission) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  27. Dąbrowski, Maciej. "Diagnostic Service (ControlDTCSetting) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  28. Dąbrowski, Maciej. "Diagnostic Service (ResponseOnEvent) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  29. Dąbrowski, Maciej. "Diagnostic Service (LinkControl) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  30. Dąbrowski, Maciej. "Diagnostic Message (Diagnostic Request) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  31. Dąbrowski, Maciej. "Diagnostic Service (SID) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  32. Dąbrowski, Maciej. "Diagnostic Message (Diagnostic Response) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  33. Dąbrowski, Maciej. "Diagnostic Service (RSID) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  34. Dąbrowski, Maciej. "Diagnostic Message (Positive Response Message) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  35. Dąbrowski, Maciej. "Diagnostic Message (Negative Response Message) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-11.
  36. 1 2 Dąbrowski, Maciej. "Diagnostic Message (Negative Response Codes) — py-uds documentation". uds.readthedocs.io. Retrieved 2025-11-09.