cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U595 timeout in USB_CoreReset()

Lukasz Nowak
Associate III

I am working on a project using USB HS with:

STM32U595VJT
STM32CubeIDE 1.14.0
STM32Cube_FW_U5_V1.4.0

Using the init code, as generated by CubeMX, I was getting HAL_TIMEOUT returned by USB_CoreReset():

MX_USB_OTG_HS_PCD_Init() -> HAL_PCD_Init() -> USB_CoreInit() -> USB_CoreReset()

After looking into example applications, e.g.:

STM32Cube_FW_U5_V1.4.0/Projects/NUCLEO-U5A5ZJ-Q/Applications/USBX/Ux_Device_CDC_ACM/Core/Src/stm32u5xx_hal_msp.c

the problem turns out to be a missing call to:

__HAL_RCC_SYSCFG_CLK_ENABLE();

CubeMX code does not generate it.

The application example has it in the "USER CODE" section:

 

void HAL_PCD_MspInit(PCD_HandleTypeDef* hpcd)
{
  RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
  if(hpcd->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 */

 

This seems to be specific to chips with USB HS (U595, U599, U5A5, U5A9).

As the USB is not usable without it, can this missing call be added to output code generated by CubeMX?

Thank you.

2 REPLIES 2
KDJEM.1
ST Employee

Hello @Lukasz Nowak ,

Thank you for sharing this issue.

I confirm the issue and it has already been reported internally.

Internal ticket number: 157784 (This is an internal tracking number and is not accessible or usable by customers).

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello,

Getting the same issue with an STM32F722RET. HAL_TIMEOUT returned by USB_CoreReset():

But at the same time, USB_OTG_FS init is working and there is no time-out. 

Any solution or workaround for this issue?