diff options
| author | ice458 <[email protected]> | 2026-08-14 16:00:06 +0900 |
|---|---|---|
| committer | ice458 <[email protected]> | 2026-08-14 16:00:06 +0900 |
| commit | 282d46e68d9100af0dfdcc01e7689bb63bbf8419 (patch) | |
| tree | d81e3b5b1a332e16de5375f3a18269ce2f920d74 /lib | |
| parent | 53fef28335181fd6b4c8fb2ac65fdacf44659492 (diff) | |
usbtmc: re-arm (or stall) the bulk-OUT endpoint after a USB488 TRIGGER
A single USB488 TRIGGER message left the bulk-OUT endpoint un-armed, so the
host's next bulk-OUT transfer timed out. The trigger itself succeeded
silently, so the failure surfaced on a later, unrelated command; only a
USBTMC device clear recovered it. The bundled examples/device/usbtmc
reproduced this as shipped.
Every other branch of the STATE_IDLE dispatch in usbtmcd_xfer_cb() leaves
the endpoint in a defined state: it either transitions out of STATE_IDLE so
a later tud_usbtmc_start_bus_read() can re-arm it, or it stalls and lets the
CLEAR_FEATURE(ENDPOINT_HALT) handler recover it. USBTMC_MSGID_USB488_TRIGGER
did neither, and because the state stayed STATE_IDLE, even an application
following the contract documented in usbtmc_device.h got a silent no-op from
tud_usbtmc_start_bus_read().
Transition to STATE_NAK so the re-arm can take effect, and stall the
endpoint when trigger is unsupported or the application callback rejects it,
matching the existing handling for messages the driver cannot process. The
callback result is deliberately not wrapped in TU_VERIFY(), which would
return before the stall/re-arm and reintroduce the same hang.
Since the driver now re-arms after a trigger, drop tud_usbtmc_msg_trigger_cb
from the list of callbacks after which the application must do so.
Fixes #3821
Co-Authored-By: Claude Opus 5 <[email protected]>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions
