summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-06-15 22:50:01 +0700
committerhathach <[email protected]>2026-06-15 22:50:01 +0700
commitf1080e158aeec31faee0f3371d2d5c6f624dd4f4 (patch)
tree0d683d2e879023be03dd707cc34a0a6ad1680ed9 /examples/device
parent3d9468152c44148c6881fb3f30ff3dae91a09b68 (diff)
dcd/musb: harden EP0 DATA_OUT against short packet and host overrun
Mirror the IN-side short-packet fix on the OUT drain: end the data stage (-> STATUS_IN) when wLength is received OR a short OUT packet (count0 < CFG_TUD_ENDPOINT0_SIZE) signals the host's end-of-data, not only when remain_wlength hits exactly 0. Also clamp the remain_wlength subtraction so a host that overruns wLength can't underflow it and strand the transfer. Without this, a control-OUT whose host sends fewer bytes than wLength left pipe0 in DATA_OUT; usbd then armed STATUS IN and tripped the split's TU_ASSERT(!dir_in). Found by /code-review; conformant hosts send exactly wLength so HIL was already green. Verified: HIL pass on ek_tm4c123gxl and max32666fthr (13/13 each). Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'examples/device')
0 files changed, 0 insertions, 0 deletions