Skip to content

Commit 0f0106c

Browse files
tmon-nordicgithub-actions[bot]
authored andcommitted
[nrf fromtree] drivers: udc_dwc2: Recover after STALLed OUT Data Stage
Prepare buffer to receive SETUP data on OUT endpoint 0 after endpoint halt. This solves the issue where the device would no longer process any control transfers after the first failed transfer with too large OUT Data Stage (when processing failed due to data stage buffer allocation failure). Signed-off-by: Tomasz Moń <[email protected]> (cherry picked from commit 883b77f) (cherry picked from commit 82c286d)
1 parent fed00f7 commit 0f0106c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/usb/udc/udc_dwc2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,9 @@ static int udc_dwc2_ep_set_halt(const struct device *dev,
15911591
LOG_DBG("Set halt ep 0x%02x", cfg->addr);
15921592
if (ep_idx != 0) {
15931593
cfg->stat.halted = true;
1594+
} else if (!udc_buf_peek(dev, USB_CONTROL_EP_OUT)) {
1595+
/* Data stage is STALLed, allow receiving next SETUP */
1596+
dwc2_ctrl_feed_dout(dev, 8);
15941597
}
15951598

15961599
return 0;

0 commit comments

Comments
 (0)