Portable ISO 14229 UDS stack for embedded ECUs
UDSLib is a C99 implementation of ISO 14229-1 (UDS) with ISO-TP over CAN and CAN-FD. It allocates no heap, runs on Zephyr, FreeRTOS, bare metal and Linux, and implements all 27 application services. Source is available; commercial use needs a license.
Free for noncommercial use · 5,000 EUR commercial license
What you get
Zero malloc, C99
All memory is owned by the application. No heap use anywhere in the stack.
ISO-TP built in
ISO 15765-2 over classic CAN and CAN-FD, with flow control, STmin, block size and N_Cr / N_Bs timeouts. On Zephyr or Linux you can use the OS ISO-TP stack instead. See the FAQ.
Runs where you need it
Zephyr, FreeRTOS, bare metal super-loop, POSIX host simulator. STM32F103 and STM32H5 examples.
MISRA-aligned
MISRA-C:2012 is checked in CI with no mandatory-rule violations. Required and advisory deviations are listed in docs/MISRA.md.
Client and server
An ECU-side server stack, plus a small client (tester) API for host tools and test rigs.
Tooling
Wireshark dissector, Python bindings (pyudslib), a host simulator, and an HTML session report for captured traces.
All 27 application services
Every service listed below is dispatched by the core. Depth varies for a few of them; docs/SERVICE_COMPLIANCE.md lists the notes for each.
- 0x10DiagnosticSessionControl
- 0x11ECUReset
- 0x14ClearDiagnosticInformation
- 0x19ReadDTCInformation
- 0x22ReadDataByIdentifier
- 0x23ReadMemoryByAddress
- 0x24ReadScalingDataByIdentifier
- 0x27SecurityAccess
- 0x28CommunicationControl
- 0x29Authentication
- 0x2AReadDataByPeriodicIdentifier
- 0x2CDynamicallyDefineDataIdentifier
- 0x2EWriteDataByIdentifier
- 0x2FInputOutputControlByIdentifier
- 0x31RoutineControl
- 0x34RequestDownload
- 0x35RequestUpload
- 0x36TransferData
- 0x37RequestTransferExit
- 0x38RequestFileTransfer
- 0x3DWriteMemoryByAddress
- 0x3ETesterPresent
- 0x83AccessTimingParameter
- 0x84SecuredDataTransmission
- 0x85ControlDTCSetting
- 0x86ResponseOnEvent
- 0x87LinkControl
Most requested
These come from issues on GitHub. Each links to a runnable example.
Every 0x19 sub-function
How to cover all ReadDTCInformation sub-functions, split by what the library frames and what your application serves.
Keeping DTCs across a reset
The stack does not write flash. This example serializes the DTC store to a buffer that your NVM driver owns, then restores it.
STM32 bxCAN port
CubeMX / HAL project for the STM32F103C8: ISO-TP over bxCAN, real flash programming, hardware CRC.
UDS OTA bootloader
Dual-bank bootloader for the STM32H563 with a host download tool and rollback.
OEM-specific flash sequences are integration work, not something the example claims to cover.
SecurityAccess with real crypto
Seed to key with AES-128-CMAC behind the 0x27 hooks, built against mbedTLS or wolfSSL.
UDSLib and iso14229
driftregion/iso14229 is the other open-source C UDS library people ask about. It is a good project. Here is where each one is stronger.
| Topic | iso14229 | UDSLib |
|---|---|---|
| License | MIT | PolyForm Noncommercial 1.0.0, commercial license 5,000 EUR |
| Distribution | Two files (header and source) | Source tree with CMake, several modules |
| Memory | Static allocation | Static allocation, no heap |
| Roles | Client and server | Server, plus a client API |
| Community | About 370 GitHub stars, per its GitHub page | Small and young |
| Reference DTC store | No; 0x19 is passed to the application as an event | Yes, opt-in, application-provided array |
| Reprogramming examples | Yes: MCUboot + Zephyr firmware update on NUCLEO-G474RE | 17-step flash tool, STM32F103 ECU, STM32H563 OTA bootloader |
| mbedTLS / wolfSSL security examples | Yes: Linux SecurityAccess example with mbedTLS | 0x27 and 0x29 with AES-128-CMAC |
| Wireshark dissector, Python bindings | No own dissector or bindings; its examples use tshark and Python tools | Both in extras/ |
| Paid support | None offered in its README | 1 year of email support with a 2-business-day target |
The iso14229 column is based on its repository as of October 2026. If you need MIT licensing or the smallest possible footprint, start with iso14229.
UDS tools for your AI assistant
We run a free MCP server that decodes UDS messages, reassembles ISO-TP traces from CAN frames, builds requests, and explains DTCs and NRCs. It works with any UDS stack and needs no account. See the MCP page.
Ready to evaluate?
Evaluation and prototyping are free. For production use, the commercial license is a single price with no royalties.