Initialisation of USB_OTG_FS locks up during initialisation on HAL_Delay
When I try to add USB_OTG_FS (host only) to a project which uses FreeRTOS the code locks up on initialisation of USB_OTG_FS.
When USB OTG FS is added, a call to "MX_USB_OTG_FS_HCD_Init" is added to "main" function. It goes before a call to "osKernelStart()". During initialisation HAL_Delay is called, and the code locks up on that.
The path looks like this: MX_USB_OTG_FS_HCD_Init >> HAL_HCD_Init >> USB_SetCurrentMode >> HAL_Delay(1U)
And that is where it locks up.
If I comment out the call to "MX_USB_OTG_FS_HCD_Init" the rest works fine. If I put "HAL_Delay" in one of FreeRTOS threads, that works as expected (presumably due to OS being fully functional by that point). If I put "HAL_Delay" just before a call to "osKernelStart()" - it locks up.
It seems that HAL_Delay cannot be called before the call to osKernelStart, and the auto-generated code for initialisation of USB is doing exactly that.
Is it a bug or I am missing something? What would you recommend?
