Bug in USB Host core STM32Cube_FW_H7_V1.12.0 causes USBH_Init failure.
(found using STM32H723 NUCLEO board)
Hi,
When trying to implement a USG OTG application, where the USB port is required to switch backwards and forwards many times between device and host mode, there appears to be an error in the USBH_DeInit function in usbh_core.c:
The function does not call USBH_LL_DeInit and as a result a subsequent re-initialisation of the host stack fails because the host state is not set back to RESET and the peripheral clock does not then get re-started.
Compare this with the equivalent function in the device stack (USBD_DeInit in usbd_core.c). This correctly calls the equivalent function USBD_LL_DeInit at the end of the function and as a result the device stack can be de-initialised and re-initialised many times.
The fix is simply to add the call to USBH_LL_DeInit at the end of USBH_DeInit and the host stack can then be de-initialised and re-initialised many times without issue.
Thanks,
Steve
