cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H733: USB HAL initialization ends up in Error_Handler()

Bacamhao
Associate
I'm using STM32H733VGT6, USB configured as:
External Phy: Device_Only,
Speed: Device Full Speed 12 Mbit/s,
USB tacting from HSI48
 
And initialization ends up in Error_Handler(), anyway..

 

All is up-to-date, updated today, software packages, etc, STM32CubeMX version: 6.10.0 

 

Initialization trace is:
MX_USB_OTG_HS_PCD_Init() ->
 HAL_PCD_Init(&hpcd_USB_OTG_HS) ->
  runs USB_CoreInit  (line 184 of stm32h7xx_hal_pcd.c) -> 
   runs USB_CoreReset (line 101 of stm32h7xx_II_usb) -> 
    returns HAL_TIMEOUT (line 1413 of stm32h7xx_II_usb) ->
     returns to Error_Handler()

 

  Any suggestions? Thanks in advance
3 REPLIES 3
Imen.D
ST Employee

Hello @Bacamhao 

Welcome to the Community 🙂

Check the OTG_HS limitation, that Host packet transmission may hang when connecting the full speed interface through a hub to a low-speed device.

ImenD_0-1705341997080.png

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Thank you @Imen.D for the response, but code fails before any transmission, just during starting initialization code.

Nevertheless, I've found the solution here:

 


In my case, in file usbd.conf, in procedure HAL_PCD_MspInit,
 
__HAL_RCC_USB_OTG_HS_CLK_ENABLE();
__HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE(); <- remove

I removed  __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE(); line.

Also, in the same file usbd.conf in USBD_LL_Init:

 hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_ULPI_PHY; <----- ?????

I for sure don't want to use external PHY, but in Cube configurator the only option is EXTERNAL PHY (why????), so I changed it manually:

hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_EMBEDDED_PHY;

At least it's now detected by Windows
Imen.D
ST Employee

Hi @Bacamhao ,

Thank you for the update you provided. I'm glad to hear that it worked.

An internal ticket number 171028 is submitted in order to analyze this issue and take the necessary action.

 (PS: ticket number 171028 is an internal tracking number and is not accessible or usable by customers).

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen