Bug report, USB Host hangs on STM32F417, issue in HAL library used by MX
Bug report in HAL.
Under heavy load, the USB Host stack can hang due to the EPDIR flag on an IN Channel being incorrectly cleared by the HAL.
stm32f4xx_ll_usb.c, function USB_HC_Halt, clears EPDIR in the case that the request queue is full. This routine is called by IN & OUT interrupt handlers and can there leave EPDIR wrongly reset for an IN channel.
In the case of using DMA, tech ref says (in section 'Halting a Channel') that code does not need to check for request queue full - so I think the code should probably take DMA into account as well.
I am using DMA, I have commented out the process queue check.
