AjapaReporter

Home life · Updated

UDS Error Codes: What the Negative Response Codes Mean

Time it takes8 min
Steps10in the list below
LevelMediumsome care needed
Official sourceISO 14229 (Unified Diagnostic Services)check it for changes

Quick answer UDS error codes are Negative Response Codes (NRCs) defined in ISO 14229: when an ECU rejects a request, it sends a negative response with a service ID of 0x7F plus a one-byte code saying why. Reading that byte tells you whether the problem is your request, the ECU's state, or security access.

Decode the 0x7F response first, then chase the cause. A UDS negative response is three bytes after the 0x7F marker: the service ID you requested, and the NRC. For example 7F 22 31 means “Read Data By Identifier (0x22) rejected, code 0x31 – request out of range.” The code, not the service, tells you what to fix.

The Ten UDS Negative Response Codes You Will Actually See

  1. 0x11 – Service not supported: the ECU does not implement that service at all. Confirm by trying a different service; fix by removing the request from your diagnostic script for this ECU.
  2. 0x12 – Sub-function not supported: the service exists but that sub-function byte does not. Confirm by reading the ECU’s supported functions; fix the sub-function value you send.
  3. 0x13 – Incorrect message length or format: your request is the wrong number of bytes. Count your payload against the service definition and resend.
  4. 0x22 – Conditions not correct: the ECU is in a state where the service is blocked, such as the engine running during a flash. Confirm by checking vehicle conditions; fix by meeting the precondition (ignition on, engine off, no active communication).
  5. 0x24 – Request sequence error: you sent steps out of order. Fix by following the required order, such as Routine Control before Request Download.
  6. 0x31 – Request out of range: the DID, routine ID or address you asked for does not exist on this ECU. Fix by requesting a valid identifier from the ECU’s documentation or auto-discovery.
  7. 0x33 – Security access denied: you requested a service that needs authentication without unlocking. Fix by sending Request Security Access (0x27), solving the seed, then retrying.
  8. 0x35 – Invalid key: your key response to 0x27 was wrong. Fix by re-checking the seed-to-key algorithm and retrying; three failed attempts usually triggers an exponential delay.
  9. 0x36 / 0x37 – Exceeded number of attempts / time: too many failed security tries or the session timed out. Wait out the delay (often 10 seconds, sometimes much longer after repeated failures) and start again.
  10. 0x78 – Response pending: not a failure – the ECU is still working and will answer later. Keep the tool waiting instead of timing out immediately.

Why UDS Returns 0x22 and 0x31 Most Often

These two codes cover the majority of real-world rejections, and both usually point at your side, not a broken ECU. 0x31 “request out of range” almost always means a wrong DID: identifiers are ECU-specific, so a DID that works on the engine controller returns 0x31 on the gateway. Confirm by requesting a DID you know is valid (the ECU’s own identification data is a safe test) – if that succeeds, the ECU is fine and your DID is wrong.

0x22 “conditions not correct” is the ECU protecting itself. Flashing and some routines only run in a specific session (often the extended or programming session you enter with Diagnostic Session Control, 0x10), with the ignition in a set state and no other diagnostic traffic. Confirm by reading the active session with 0x22 on the session DID; fix by entering the required session before the blocked request. A common trap: the ECU drops back to the default session after roughly 5 seconds of inactivity, so a pause in your script can cause a sudden 0x22.

Security Access: Fixing 0x33, 0x35 and 0x36

Any service that writes, erases or flashes normally sits behind Security Access (0x27). The flow is fixed: request a seed, compute the key with the ECU’s algorithm, send the key, then retry the protected service in the same session. If you get 0x33, you skipped the unlock or the session reset it; if you get 0x35, the key was wrong, which usually means the wrong algorithm or a byte-order mismatch in your computation. After repeated bad keys, 0x36 tells you the ECU has locked you out for a delay – do not keep hammering requests during it, because some controllers extend the delay each time.

What if the ECU never answers at all?

No response is not a UDS error code – it is a transport problem. Check the physical connection and the addressing first: a request sent with a functional address to an ECU that only listens on its physical address gets silence, and a wrong CAN ID does the same. Also check whether the ECU requires a Tester Present (0x3E) keep-alive, typically every 2-3 seconds, to stay in a non-default session.

Quick Checks Before You Blame the ECU

  • Decode the full response: 7F + service ID + NRC. Write down all three bytes.
  • Confirm the session: many rejections disappear after Diagnostic Session Control (0x10) to the extended session.
  • Retry a known-good DID to prove the communication path works.
  • Count your request bytes – 0x13 is a formatting error on your side.
  • Check for a pending 0x78 before assuming a timeout.
  • Verify Tester Present is being sent if you use a non-default session.

UDS Symptom to Cause to Fix Table

Symptom Likely NRC / cause Fix
Every service rejected 0x11 – wrong ECU or unsupported service set Verify the target address; use the ECU’s supported-service list
One DID always fails 0x31 – invalid identifier Use a DID documented for that ECU
Works, then fails after a pause 0x22 – session timed out to default Send Tester Present (0x3E) every 2-3 seconds
Write or flash rejected 0x33 – not security-unlocked Complete the 0x27 seed/key exchange first
Key rejected after unlock attempt 0x35 – wrong seed-to-key computation Fix the algorithm or byte order; wait out any delay
Long silence then a late answer 0x78 – response pending Extend your tool’s timeout; keep waiting
Request rejected after ordering steps 0x24 – sequence error Follow the ECU’s required service order

One habit worth building: log every 0x7F response with its three bytes and the session state at the time. Patterns show up fast – a 0x22 that only appears after 5 quiet seconds is a session timeout, and a 0x31 that only appears on one ECU is a DID problem, and neither means hardware fault.

Sources: ISO 14229 (Unified Diagnostic Services). Menus and buttons can differ slightly by version. Spotted something out of date? Tell us.