STM32U595ZJT6Q USB not initializing
I'm trying to work with USB on STM32U595ZJT6Q (with SMPS)
Ref Clock Selection under USB_OTG_HS is set to 16MHz
OTS HS Clock Mux is set to HSE (the board has 16MHz crystal)
CubeMX 6.11
STM32Cube_FW_U5_V1.5.0
The code is stuck in USB_CoreReset, more specifically it waits for USB_OTG_GRSTCTL_CSRST to become 0
do
{
count++;
if (count > HAL_USB_TIMEOUT)
{
return HAL_TIMEOUT;
}
} while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);
After searching the forum I discovered that CubeMX is not generating __HAL_RCC_SYSCFG_CLK_ENABLE call in HAL_PCD_MspInit. However, after adding this call nothing changes.
void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
{
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
if(pcdHandle->Instance==USB_OTG_HS)
{
/* USER CODE BEGIN USB_OTG_HS_MspInit 0 */
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* USER CODE END USB_OTG_HS_MspInit 0 */
Can someone help me resolve the issue?
