HCD: Re-activate the USB channel if not ready.
Otherwise the ErrCnt doesn't work, and the HAL_HCD_HC_NotifyURBChange_Callback
never gets invoked.
diff --git a/Src/stm32h7xx_hal_hcd.c b/Src/stm32h7xx_hal_hcd.c
index 17f99ed..12d2714 100644
--- a/Src/stm32h7xx_hal_hcd.c
+++ b/Src/stm32h7xx_hal_hcd.c
@@ -1693,6 +1693,12 @@
else
{
hhcd->hc[chnum].urb_state = URB_NOTREADY;
+
+ /* re-activate the channel */
+ tmpreg = USBx_HC(chnum)->HCCHAR;
+ tmpreg &= ~USB_OTG_HCCHAR_CHDIS;
+ tmpreg |= USB_OTG_HCCHAR_CHENA;
+ USBx_HC(chnum)->HCCHAR = tmpreg;
}
}
__HAL_HCD_CLEAR_HC_INT(chnum, USB_OTG_HCINT_TXERR);