f103-uds-ecu: full typical-session UDS coverage#343
Merged
Conversation
Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
…ter shapes Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
Add uds-session.yaml (system: scripted 12-step tester) and uds-session-smoke.yaml (scenario: uart_contains + uds_tester done) for the full everyday UDS session: RDBI VIN, session-gated DID write, TesterPresent, DTC read/clear, routine, IO control, comm control, and ECUReset. Smoke passes (exit 0, two ECU_READY banners). Also fix service_can_uds_testers: the AwaitMultiResp state was missing from the to_send match, so the FlowControl computed by observe_ecu_frame_script was silently dropped when the ECU responded with a multi-frame ISO-TP FirstFrame. Adding the AwaitMultiResp arm forwards pending_inject (the FC) so the ECU can continue with its CFs. Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
…response Guards the AwaitMultiResp arm fix in service_can_uds_testers: verifies that a FlowControl frame (0x30 nibble) is actually delivered onto the bxCAN bus after the ECU sends a FirstFrame, so the ECU can proceed with its ConsecutiveFrames. Without the fix the FC was silently swallowed by the _ => None arm and the bxCAN rx trace shows no new frames. Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
…verage Signed-off-by: w1ne <14119286+w1ne@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the
f103-uds-ecuexample answer the full everyday UDS diagnostic session and proves it end-to-end. A coverage audit found that most typical services were compiled into the firmware but had no registered handler and no runnable scenario — only SecurityAccess (0x27), ECUReset (0x11), and a single h563 DID read actually ran on the bus. This closes that gap for f103.Scope (f103-uds-ecu)
0xF190(read-only), scratch0x0123(read/write, extended-session gated), IO point0xA001.uds_dtc_store(DTC0x123456).0x0203(extended-session gated).How it's proven
uds-session.yaml+uds-session-smoke.yaml): a 12-step scripted tester walks the session — RDBI VIN → write rejected in default session (7F 2E 31) →10 03→ TesterPresent → write accepted → read-back → DTC count → clear → routine → IO control → comm control → ECUReset. Smoke verified: exit 0,uds_testerdone,ECU_READYbanner twice (real AIRCR reboot). Negative control (corrupted expect) fails on step 0. Like the existing reset smoke, this drives a locally-built ELF and is not a clean-checkout CI gate.crates/core/src/bus/mod.rs): sixCanUdsTesterFSM tests covering SF DID-write, routine-with-output, IO-control, multi-frame DTC reassembly,expect_nrc, and FlowControl delivery on a multi-frame ECU response. These run incore-integrity.Production fix surfaced during integration
The 17-byte VIN response is multi-frame, which exposed a real bug:
service_can_uds_testershad noAwaitMultiResparm in itsto_sendmatch, so the FlowControl computed for a multi-frame ECU response was silently dropped and the exchange deadlocked. Fixed with a one-arm addition, guarded by a regression test that asserts the FC frame actually reaches the bxCAN (confirmed RED without the fix).Follows up the scriptable-tester + real-reset work in #338.