// Zephyr RTOS · ISO 14229 UDS

ISO 14229 UDS diagnostics
on Zephyr RTOS.

A complete, YAML-configured UDS stack that generates production C source for Zephyr. Covers all 17 UDS services, CAN ISO-TP and DoIP transports, ASIL-B safety wrappers, and a full pytest suite — all from a single config file. GPL v2 runtime is free on GitHub.

UDS on Zephyr — done right.

Writing a UDS stack from scratch on Zephyr typically takes 4–8 weeks and leaves you maintaining a hand-written C stack that drifts from the spec. EDS generates the entire stack from a 30-line YAML description of your ECU.

diagnostics_config.yaml

ecu:
  name: BCM
  addressing:
    can_id_request:  0x7DF
    can_id_response: 0x7E8

sessions:
  - default
  - extended
  - programming

services:
  - id: 0x22   # ReadDataByIdentifier
  - id: 0x2E   # WriteDataByIdentifier
  - id: 0x27   # SecurityAccess
  - id: 0x31   # RoutineControl
  - id: 0x34   # RequestDownload
  - id: 0x36   # TransferData
  - id: 0x37   # RequestTransferExit
  - id: 0x19   # ReadDTCInformation
  - id: 0x14   # ClearDiagnosticInformation

dids:
  - id: 0xF190
    name: VIN
    length: 17
    read_sessions: [default, extended]
  - id: 0xF187
    name: PartNumber
    length: 10
    read_sessions: [default, extended]
    write_sessions: [extended]
    write_security: [1]

Generated output

python3 tools/codegen.py \
  --config diagnostics_config.yaml \
  --out build/ \
  --safety-wrappers \
  --asil-level B \
  --test-gen

build/
  uds_server.c/.h      # UDS dispatcher + Zephyr thread
  uds_dids.c/.h        # DID read/write handlers
  uds_dtcs.c/.h        # DTC storage (NVM-backed)
  uds_sessions.c/.h    # session state machine
  uds_security.c/.h    # AES-128-CMAC SecurityAccess
  uds_safety.c/.h      # ASIL-B 5-step validation
  test_uds.py          # pytest suite (CI-ready)

Zephyr west integration

# west.yml — add EDS as a Zephyr module
manifest:
  projects:
    - name: eds
      url: https://github.com/Xaloqi/EDS
      revision: v1.9.0
      path: modules/eds

# prj.conf
CONFIG_EDS=y
CONFIG_EDS_ISOTP=y
CONFIG_EDS_DOIP=y

All 17 UDS services. Generated, not hand-written.

Every service is codegen-backed: the YAML config drives session gating, security level, DID access lists, and NRC response logic. No manual dispatch table.

  • 0x10 DiagnosticSessionControl — default, extended, programming
  • 0x11 ECUReset — hard reset, key-off, soft reset
  • 0x14 ClearDiagnosticInformation — group mask, NVM flush
  • 0x19 ReadDTCInformation — 11 sub-functions including fault counter (0x0B) and permanent DTC (0x19)
  • 0x22 ReadDataByIdentifier — multi-DID batching, session gating
  • 0x27 SecurityAccess — AES-128-CMAC, brute-force lockout
  • 0x28 CommunicationControl — RXONLY, TXONLY, RXANDTX
  • 0x2A ReadDataByPeriodicIdentifier — scheduler-driven, CAN/DoIP
  • 0x2E WriteDataByIdentifier — NVM write, range validation
  • 0x2F InputOutputControlByIdentifier — returnControl, shortTermAdjust
  • 0x31 RoutineControl — start, stop, requestResults
  • 0x34 RequestDownload — encryption flags, memory range
  • 0x35 RequestUpload — symmetric to RequestDownload
  • 0x36 TransferData — block sequence counter, CRC check
  • 0x37 RequestTransferExit — checksum validation
  • 0x3E TesterPresent — session keepalive, suppressResponse
  • 0x85 ControlDTCSetting — on/off, group mask

All services gated by session, security level, and access permission. The ASIL-B 5-step validation chain runs on every request before the handler is called.

Built for Zephyr — not bolted on.

EDS uses Zephyr's native kernel primitives: a dedicated UDS thread on the system workqueue, k_msgq for ISO-TP frames, zephyr/settings.h for NVM-backed DTC storage, and zephyr/canbus/isotp.h for CAN framing. No POSIX shim. No HAL bypass.


ASIL-B certification artifacts included in Professional.

Every generated UDS handler includes a 5-step safety validation chain that runs before the handler body. The chain is produced by codegen — not hand-written — so it cannot drift from the spec.

Generated ASIL-B validation chain (uds_safety.c)

/* Step 1 — DID registered in config */
if (!eds_did_exists(did_id))
    return UDS_NRC_REQUEST_OUT_OF_RANGE;

/* Step 2 — service allowed in this session */
if (!eds_session_allows(service_id))
    return UDS_NRC_SERVICE_NOT_SUPPORTED_IN_SESSION;

/* Step 3 — security level met */
if (!eds_security_ok(required_level))
    return UDS_NRC_SECURITY_ACCESS_DENIED;

/* Step 4 — write access permission */
if (!eds_access_permitted(did_id, ACCESS_WRITE))
    return UDS_NRC_CONDITIONS_NOT_CORRECT;

/* Step 5 — data length within bounds */
if (data_len != eds_did_length(did_id))
    return UDS_NRC_INCORRECT_MESSAGE_LENGTH;
  • ISO 26262 Safety Manual (EDS-SM-001 Rev 1.1) — intended use, assumptions of use, safety measures
  • HARA — Hazard Analysis and Risk Assessment for UDS diagnostic functions
  • Requirements Traceability Matrix — 30 ASIL-B requirements, every one covered
  • Tool Qualification Argument — TQA document per ISO 26262-8
  • MISRA C:2012 deviation log — 38 deviations, 0 open violations
  • 68-test C integration harness — full UDS stack on host GCC, CI-ready

View Safety & Security page →

Three tiers. Annual license. Offline after activation.

Community

Free

GPL v2 · always free · GitHub

  • Full runtime source — core/, transport/, config/, platform/
  • CAN ISO-TP + DoIP transports
  • Zephyr + FreeRTOS platform layer
  • 4 basic example ECUs
  • Full CI test suite
  • Codegen templates
  • ARXML importer
  • AI assistant
  • Safety documentation

Professional

€1,990/yr · per developer

Everything in Developer, plus:

  • 68-test C integration harness
  • ISO 26262 Safety Manual (EDS-SM-001 Rev 1.1)
  • HARA · Tool Qualification Argument
  • Requirements Traceability Matrix (30 ASIL-B requirements)
  • MISRA C:2012 deviation log
  • OEM key provisioning guide
  • Priority support (5 business days)
  • Commercial license (1 seat)
Blog: ASIL-B UDS on Zephyr → Blog: UDS on FreeRTOS → Blog: CAN to DoIP migration → FreeRTOS UDS landing page → TestLab — campaign runner →