Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

Complete UDS Reprogramming Sequence

14-Step Reprogramming Sequence (ISO 14229-1)
  Tester                                    ECU (PBL/SBL)
    │                                          │
    │── 0x10 0x03 (Extended Session) ─────────►│ Enter Extended Diagnostic Session
    │◄── 0x50 0x03 ──────────────────────────│ Positive response
    │                                          │
    │── 0x28 0x03 0x01 (CommControl OFF) ─────►│ Disable non-diagnostic comms
    │◄── 0x68 ────────────────────────────────│ Positive response
    │                                          │
    │── 0x27 0x01 (SecurityAccess req) ────────►│ Request seed (Level 1)
    │◄── 0x67 0x01  ────────────────────│ 4-byte seed
    │── 0x27 0x02  ──────────────►│ Send computed key
    │◄── 0x67 0x02 ───────────────────────────│ Security granted
    │                                          │
    │── 0x10 0x02 (Programming Session) ───────►│ Enter Programming Session
    │◄── 0x50 0x02 ──────────────────────────│ P2*=5000ms now active
    │                                          │
    │── 0x27 0x03 (SecurityAccess req L2) ─────►│ Request seed (Level 2)
    │◄── 0x67 0x03  ────────────────────│ 4-byte seed
    │── 0x27 0x04  ──────────────────────►│ Send Level 2 key
    │◄── 0x67 0x04 ───────────────────────────│ Level 2 granted
    │                                          │
    │── 0x31 0xFF00 (EraseMemory) ─────────────►│ Erase application region
    │◄── 0x78 (Response Pending) ─────────────│ (repeated every 2.5s while erasing)
    │◄── 0x71 0xFF00 ─────────────────────────│ Erase complete
    │                                          │
    │── 0x34 (RequestDownload) ────────────────►│ Setup download parameters
    │◄── 0x74  ──────────────────│ ECU reports max block size
    │                                          │
    │── 0x36 0x01  ───────────────►│ TransferData block 1
    │◄── 0x76 0x01 ───────────────────────────│ Block 1 accepted
    │   ... (repeat for all blocks) ...        │
    │── 0x37 (RequestTransferExit) ────────────►│ Transfer complete
    │◄── 0x77 ────────────────────────────────│ Transfer finalised
    │                                          │
    │── 0x31 0xFF01 (CheckProgramming) ────────►│ Verify CRC + dependencies
    │◄── 0x71 0xFF01 0x00 ────────────────────│ Check passed (0x00=OK)
    │                                          │
    │── 0x11 0x03 (ECUReset softReset) ────────►│ Reset ECU
    │◄── 0x51 0x03 ───────────────────────────│ Reset initiated

Pre-Condition Checks Before Erasing

Pre-ConditionCheckNRC if FailsRationale
Vehicle stationaryVehicle speed = 00x22 conditionsNotCorrectCannot reprogram moving vehicle safely
Engine off / idleEngineSpeed < idle threshold0x22 conditionsNotCorrectHigh CPU load during drive interferes with flash timing
Battery voltage11.5 V ≤ Vbat ≤ 14.5 V0x22 conditionsNotCorrectUnder-voltage causes incomplete write; over-voltage damages flash
No active DTCsSafety DTC count = 00x22 conditionsNotCorrect (OEM-specific)Do not flash ECU with active fault; diagnose first
Programming voltageVPP supplied if required0x22 conditionsNotCorrectSome MCUs need separate 12V programming supply

Session Timing Parameters

TimerValueFunctionConsequence if Expired
P2_Server50 ms defaultTime between request and first responseNRC 0x78 if processing takes longer (must send pending)
P2*_Server5000 ms in programming sessionExtended response time for long operationsSession reset if exceeded without response
S3_Server5000 msInactivity timeout; reset to Default SessionMust send TesterPresent 0x3E 0x80 every 2s to maintain session
TesterPresentEvery 2000 msKeep-alive in programming sessionECU resets to Default Session; erase/program aborted

Summary

The 14-step UDS reprogramming sequence is well-defined by ISO 14229-1 and AUTOSAR. The critical discipline is timing: the S3 server timer (5000 ms) must be reset by a TesterPresent request every 2 seconds during long erase operations — if the erase takes 10 seconds and TesterPresent is forgotten, the ECU resets to Default Session at t=5s, interrupting the erase mid-operation and leaving the flash in a partially erased (invalid) state. The ECU responds to ongoing erase with NRC 0x78 (responsePending) to prevent the tester's P2* timeout from firing.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousBoot Sequence & Application JumpNext →Flash Driver Architecture