I use a STM32U5 and the Keil V8.0.0 USB and MSC driver.But during initalisation I run in a Timeout in the stm32u5xx_ll_usb.c file at USB_CoreReset for the Core Soft Reset.
I use it as host only in full speed, configuration done in CubeMX.The clock couldn't be configured to 48MHz as writen in the driver head in USBH_STM32.c.
I add the Handle from the usb_otg.c file to the MX_Device.h file#define MX_USB_OTG_HS_HANDLE hhcd_USB_OTG_HS
Thanks and kind regardsRené
Code with Timeout in stm32u5xx_ll_usb.c
static HAL_StatusTypeDef USB_CoreReset(USB_OTG_GlobalTypeDef *USBx){ __IO uint32_t count = 0U;
/* Wait for AHB master IDLE state. */ do { count++;
if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_AHBIDL) == 0U);
/* Core Soft Reset */ count = 0U; USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;
do { count++;
if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; <============ run into this timeout } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);
return HAL_OK;}
For others that are also running into this error. I had to call "__HAL_RCC_SYSCFG_CLK_ENABLE();" It should be done by CubeMX but it looks like there is an error with that. I call it at the end of HAL_MspInit() function.