STM32U5A5ZTJ USB PCD failing on initialization at USB_CoreReset()
Hello,
I have a Nucleo-U5A5ZJQ dev board and am attempting to get a minimum USB HS example working using the PCD HAL library. When `MX_USB_OTG_HS_PCD_Init()` is called, a HAL_TIMEOUT occurs when attempting a CoreReset using the `USB_OTG_GRSTCTL_CSRST`, specifically this line in stm32u5xx_ll_usb.c
/* Core Soft Reset */
count = 0U;
USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;
do
{
count++;
if (count > 200000U)
{
return HAL_TIMEOUT; <---- THIS LINE
}
} while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);
return HAL_OK;I have checked and confirmed that the USBPHYCEN and OTGEN bits are set in the AHB2ENR1 register before this function call. I have also confirmed that OTGHSPHYCR is enabled and set to 16Mhz (the USB PHY clock speed).
I'm currently out of ideas on what would be causing the USB peripheral to fail on initialization. My intuition is saying that it's clock related, but as far as I can tell, I have setup the clocks correctly according to the datasheet.
I've attached my project below. Any thoughts would be very much appreciated!
