[HAL][USB] Ensure to reactivate the usb channel in case of transfer error
diff --git a/Src/stm32f7xx_hal_hcd.c b/Src/stm32f7xx_hal_hcd.c
index 4fd006a..93a0980 100644
--- a/Src/stm32f7xx_hal_hcd.c
+++ b/Src/stm32f7xx_hal_hcd.c
@@ -1720,6 +1720,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);