Frequently asked questions
Timing, transport, DTCs, flashing, porting and licensing. Answers point at the docs in the repository. If something is missing, email us.
What are P2, P2* and NRC 0x78?
P2 is how long the ECU may take to start answering a request. P2* is the longer deadline that applies after the ECU has sent NRC 0x78 (responsePending). In UDSLib, if a service takes longer than p2_ms (default 50 ms), the stack sends 0x78 itself and repeats it every p2_star_ms (default 5000 ms) until your handler finishes. A 0x78 is not an error. Both values can be changed at runtime with service 0x83. Details: docs/TIMING_AND_TIMEOUTS.md.
How does the S3 timeout work, and what does TesterPresent do?
If the tester stays silent for s3_ms (default 5000 ms), the ECU falls back to the default session and locks security again. TesterPresent (0x3E) restarts that timer. A suppressed TesterPresent (3E 80) keeps S3 alive without a response on the bus. See docs/TIMING_AND_TIMEOUTS.md.
Which ISO-TP timeouts, STmin and block size does it use?
The built-in ISO-TP honours the BlockSize and STmin that the peer sends in its flow control frames. STmin values 0x00 to 0x7F (ms) and 0xF1 to 0xF9 (sub-millisecond) are decoded. N_Cr (wait for the next consecutive frame) and N_Bs (wait for flow control after a first frame) both default to 1000 ms and can be set per channel. A stalled transfer is aborted rather than left hanging. See docs/TRANSPORT.md and docs/TIMING_AND_TIMEOUTS.md.
Does it support CAN-FD?
Yes. Call uds_tp_isotp_set_fd(&iso, true) and the ISO-TP layer uses CAN-FD single-frame format for payloads over 7 bytes and fills frames up to 64 bytes. Classic CAN is the default. See section 8 of docs/TRANSPORT.md.
SecurityAccess (0x27) or Authentication (0x29)?
0x27 is the older seed and key exchange. 0x29 is the ISO 14229-1:2020 service for certificate or challenge based authentication. UDSLib implements both as plumbing: it validates requests, tracks state and frames responses, and calls your hooks for the cryptography (fn_security_seed / fn_security_key for 0x27, fn_auth for 0x29). No cipher is bundled, so keys can stay in an HSM. See the examples security_access_mbedtls and auth_challenge_mbedtls.
Where do DTCs get stored? Does it write flash?
UDSLib does not write flash. An optional reference store keeps DTC records in an array you provide and answers 0x19 and 0x14. To keep DTCs across a reset, serialize the store into a buffer and write that buffer with your own flash or EEPROM driver. Do not erase flash inside the 0x19 handler, because it is slow and the tester will time out. See dtc_persist and dtc_store.
Are all 0x19 sub-functions supported?
The sub-function mask accepts all standard sub-functions (0x01 to 0x19, 0x42 and 0x55). The library formats the responses for several of them from the records your application supplies. The memory-region, by-record-number, emissions-OBD and user-defined-memory variants go to a raw fn_dtc_read hook, where your application formats the answer. Which is which is listed in docs/SERVICE_COMPLIANCE.md, and dtc_full_coverage shows both paths.
How do I do an OTA update or flash an ECU over UDS?
pro_flash_tool walks a 17-step sequence (sessions, DTC off, communication off, security, fingerprint, erase, download, check, reset, restore) with the exact bytes. h563_uds_bootloader is a dual-bank STM32H563 bootloader with rollback, and f103_cubemx_uds_ecu programs real flash on an STM32F103. Your OEM’s required sequence may differ. Adapting it is integration work.
How do I port it to a new MCU or CAN driver?
Provide a millisecond time source, TX and RX buffers, and a transport send function in uds_config_t. Feed each complete message to uds_input_sdu() and call uds_process() periodically. If you have no OS ISO-TP stack, use the built-in one: feed raw CAN frames to uds_isotp_rx_callback() and drive timing with uds_tp_isotp_process(). See docs/INTEGRATION_GUIDE.md and docs/TRANSPORT.md. The bare_metal and f103_cubemx_uds_ecu examples show it end to end.
How much RAM and ROM does it need?
We do not publish size figures here. RAM is whatever buffers you give it: the TX and RX buffers, and one context per ISO-TP channel. The numbers depend on your compiler, options and the services you enable, so build the example closest to your target and read the map file.
Does it use malloc?
No. The stack uses no heap. The application provides every buffer and context, including the DTC store array and the ISO-TP channel contexts.
Is it MISRA compliant? Is it ISO 26262 certified?
MISRA-C:2012 is checked in CI with cppcheck’s MISRA addon. There are no mandatory-rule violations, and the Required and Advisory deviations are documented with reasons in docs/MISRA.md. That is not a certification. We make no ISO 26262 claim and ship no safety case or tool qualification.
Does it support DoIP?
Not today. The transport is ISO 15765-2 over CAN and CAN-FD. You can add a transport by providing your own send function and feeding complete messages to uds_input_sdu(), but we do not ship DoIP. See docs/TRANSPORT.md.
Does it work with ODX, CDD or CANoe?
There is a script, odx_to_c.py, that generates a DID table in C from an ODX file. The docs cover ODX only. CANoe and other tools talk to the ECU over the bus like any UDS tester, so an ECU running UDSLib behaves as a normal UDS server. We have not published a CANoe guide. See docs/ODX_TOOLING.md.
Is my thesis or student project free?
Yes. Personal, research and educational use is covered by the PolyForm Noncommercial 1.0.0 license at no cost. If you are a student and get stuck, email us. Help for verified student and thesis projects is at the maintainer’s discretion.
Is internal tooling at a company commercial use?
Yes. Any use inside a for-profit company beyond evaluation needs the commercial license. Evaluating UDSLib at a company before you buy is allowed: noncommercial development, testing and prototyping, with no production deployment. See pricing.
What does support cover?
The commercial license includes up to 40 hours of integration help, one year of updates, and email support with a 2-business-day response target. Renewal is 1,500 EUR per year and only covers updates and support, because the license itself is perpetual. Spec-conformance bug fixes are free for everyone: open an issue on GitHub. Details on the pricing page.