Skip to content

honor EOM bit, drain multi-packet bulk-IN responses#12

Open
wardviaene wants to merge 1 commit into
gotmc:masterfrom
embeddedci-com:fix/eom-multi-packet-bulk-in
Open

honor EOM bit, drain multi-packet bulk-IN responses#12
wardviaene wants to merge 1 commit into
gotmc:masterfrom
embeddedci-com:fix/eom-multi-packet-bulk-in

Conversation

@wardviaene
Copy link
Copy Markdown

@wardviaene wardviaene commented May 9, 2026

doRead sent a single REQUEST_DEV_DEP_MSG_IN per call and trusted the USBTMC header's transfer_size, so devices that split a response across multiple messages with EOM=0 returned only the first chunk.

The Rigol DS1102Z-E hits this on :WAV:DATA?: it caps each response at one bulk-IN packet, misreports transfer_size, and never sets EOM=1, terminating with a ZLP instead. Previously returned 500 bytes where 1200 were expected.

The fix loops on REQUEST_DEV_DEP_MSG_IN until EOM=1 or the buffer is full, and drains any extra bulk-IN packets queued past the declared transfer_size on the first iteration, stopping on ZLP. The timeout is a safety net for devices that go silent rather than sending a ZLP.

The stale bTag tolerance (isContinuationHeaderMismatch) was required to get correct reads on the DS1102Z-E — the device echoes the previous bTag in continuation responses.

Tested on Rigol DS1102Z-E, firmware 00.06.04 (current latest).

Drafted with Claude Opus 4.7 (xhigh effort); reviewed, tested, and verified on hardware by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant