// FreeRTOS · ISO 14229 UDS

ISO 14229 UDS diagnostics
on FreeRTOS.

A complete, YAML-configured UDS stack that generates production C source for FreeRTOS. Same codegen engine as the Zephyr variant — switch platforms by changing one config flag. Covers all 19 UDS services, CAN ISO-TP and DoIP transports, and ASIL-B safety wrappers. GPL v2 runtime is free on GitHub.

One YAML, two RTOS targets.

FreeRTOS is the opposite problem to Zephyr. There is no devicetree and no CAN driver model, so nothing binds the stack to your controller for you — you own the driver, and the diagnostics stack has to meet you at a seam narrow enough to be worth owning.

EDS makes that seam two functions. You give it a send function, and you push received frames in from your own ISR or task:

/* you provide this */
void freertos_can_init(eds_can_send_fn_t can_send);

/* you call this from your CAN RX path */
void freertos_can_input(const eds_can_frame_t *frame);

Everything above that seam — ISO-TP reassembly, session and security state, DID dispatch, NRC generation — is the same generated code a Zephyr build gets, from the same diagnostics_config.yaml. The contrast is worth stating plainly: on Zephyr you hand EDS a const struct device * and the RTOS supplies the driver; on FreeRTOS you supply it.

diagnostics_config.yaml (same for both RTOS targets)

ecu:
  name: Sensor_MCU
  platform: freertos        # or: zephyr
  addressing:
    can_id_request:  0x640
    can_id_response: 0x641

sessions:
  - default
  - extended

services:
  - id: 0x22   # ReadDataByIdentifier
  - id: 0x2E   # WriteDataByIdentifier
  - id: 0x27   # SecurityAccess
  - id: 0x19   # ReadDTCInformation
  - id: 0x14   # ClearDiagnosticInformation
  - id: 0x3E   # TesterPresent

dids:
  - id: 0xF190
    name: VIN
    length: 17
    read_sessions: [default, extended]
  - id: 0xD001
    name: Temperature_Raw
    length: 4
    read_sessions: [default, extended]

Generated FreeRTOS output

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

build/
  uds_server.c/.h      # UDS dispatcher + FreeRTOS task
  uds_dids.c/.h        # DID handlers (no RTOS API)
  uds_dtcs.c/.h        # DTC storage (flash-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 chain
  uds_platform_freertos.c  # FreeRTOS task + queue glue
  test_uds.py          # pytest suite

FreeRTOS task init

/* In your application startup */
#include "uds_server.h"

/* EDS creates its own task internally */
eds_init(&eds_config);

/* CAN receive hook — call from your ISR or CAN task */
void can_rx_callback(uint8_t *frame, size_t len) {
    eds_isotp_rx(frame, len);
}

FreeRTOS platform layer — what it does.

The FreeRTOS platform layer maps EDS threading primitives to FreeRTOS equivalents. No global state. No polling loop. A single UDS task owns the ISO-TP reassembly buffer and calls into the generated handlers.


FreeRTOS example ECUs included.

The Developer and Professional tiers include specialist examples. Three ship specifically for FreeRTOS targets.

  • basic_freertos — minimal FreeRTOS UDS ECU: session, TesterPresent, one DID. Starting point for new projects
  • sensor_freertos — sensor ECU with temperature/pressure DIDs, DTC storage on internal flash, FreeRTOS + CAN ISO-TP
  • safeboot_freertos — MCUboot + FreeRTOS UDS DFU: RequestDownload → TransferData → RequestTransferExit → ECUReset flow

sensor_freertos example layout

examples/sensor_freertos/
  diagnostics_config.yaml  # ECU description
  src/
    main.c                 # FreeRTOS init + eds_init()
    can_driver.c           # board-specific CAN RX/TX
    flash_backend.c        # NVM adapter for DTC storage
  build/
    uds_server.c/.h        # generated — do not edit
    uds_dids.c/.h
    uds_dtcs.c/.h
    uds_safety.c/.h
    uds_platform_freertos.c

Free runtime. Two paid tiers.

The GPL v2 runtime is always free on GitHub. Developer adds the code generator, test generation, ARXML import and the AI CLI; Professional adds the ASIL-B safety artifacts and the harness. Annual licence, offline after activation.

Blog: CAN to DoIP migration → Blog: UDS on FreeRTOS walkthrough → Blog: ASIL-B UDS on Zephyr → Zephyr UDS landing page → TestLab — campaign runner →