cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5Ax USB CoreReset timeout

MBirk.1
Associate II

Hi,

I am stuck on this issue on the STM32U5A9J-DK. I have ported the USB part from a H725 i have running. Where i have copied the init code from generated code.

In USB_CoreReset() the USB_OTG_GESTCTL_CSRST bit is never reset and hence a timeout occurs.

The OTG HS Clock mux is set to HSE, which is 16 MHz.

The OTG PHY ref. clock selection is set to 16 MHz.

 

1 ACCEPTED SOLUTION

Accepted Solutions
MBirk.1
Associate II

CubeMX does not generate an important function call:

__HAL_RCC_SYSCFG_CLK_ENABLE();

After adding this to HAL_MspInit() it works.

View solution in original post

5 REPLIES 5
MBirk.1
Associate II

CubeMX does not generate an important function call:

__HAL_RCC_SYSCFG_CLK_ENABLE();

After adding this to HAL_MspInit() it works.

You have no idea how long I have been trying to figure this out. Can confirm that CubeMX still does not generate the call.

calvinwiii
Associate

st32F4 version 1.28.0 seems to insert the correct code,  but I have the same issue. so far I just have base compiler generated code and  the hang is in initialization. Any other suggestions? 

 

Is this error completely internal setup, or could it be a hardware issue with the usb chip, we are usingusb3300-ezk-tr

 

this is a new pcb and a processor I'm not familar with

Zaher
Senior II

I can confirm that I have the same issue with a project built with HAL 1.28.0 for F4.

USB_CoreReset() always times out which prevents the USB stack from getting initialized. I have generated another project with basic code for testing, USB MSC in host mode, FS internal PHY, FreeRTOS, and it works just fine on the same base F4 board. So, it's a software/configuration issue that has nothing to do with the hardware or board used.

By going back to CubeMX (1.28.0 in my case) and generating the code again, but this time with 'Activate_VBUS' disabled, the problem disappeared and now USB initializes and works successfully.

Yet I need to figure out why activating VBUS caused this problem on one project while it worked with another one.

Again, this for MSC with 'HOST_ONLY' USB in FS mode (internal PHY)

I can confirm that to this date, using CubeMX 6.12.1 and STM32 U5 FW 1.6.0 the error still persists.

The workaround solves the problem for me.