mirror of
https://github.com/hathach/tinyusb.git
synced 2026-08-18 11:02:16 +00:00
dcd/musb: clear rxrdy_consumed when stalling EP0
The actual-STALL path (no deferred SETUP) forced EP0 to IDLE but left rxrdy_consumed set if the aborted transfer had parked RXRDY via NAK flow control (e.g. a rejected OUT-data request in DATA_OUT). A subsequent SETUP IRQ would then hit the parked-gate early return and be ignored, relying on SentStall/SetupEnd to clear the flag first. Clear it here so recovery never depends on that ordering. Addresses Copilot review on #3699. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@ -944,6 +944,9 @@ void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr) {
|
||||
// would land on that innocent request. Skip the stall and replay the deferred SETUP instead.
|
||||
pipe0_process_deferred_setup(rhport, ep_csr, false);
|
||||
} else {
|
||||
// Forcing EP0 to IDLE: any RXRDY parked by the aborted transfer's flow control is stale,
|
||||
// clear it so the next SETUP IRQ is not gated off.
|
||||
_dcd.pipe0.rxrdy_consumed = false;
|
||||
ep_csr->csr0l = MUSB_CSRL0_STALL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user