// Zephyr RTOS · ISO 14229 UDS
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.
// why EDS for Zephyr
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
// service coverage
Every service is codegen-backed: the YAML config drives session gating, security level, DID access lists, and NRC response logic. No manual dispatch table.
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.
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.
CONFIG_EDS_ISOTP), DoIP over Ethernet (CONFIG_EDS_DOIP), SOME/IP, SOVD RESTCONFIG_EDS=y, call eds_init()// safety
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;
// pricing
Community
Free
GPL v2 · always free · GitHub
Developer
€690/yr · per developer
Everything in Community, plus:
Professional
€1,990/yr · per developer
Everything in Developer, plus: