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

9 REPLIES 9
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.

Hello! I've been struggling with this problem and stumbled on your post. 


I tried your solution. However, when I pasted __HAL_RCC_SYSCFG_CLK_ENABLE(); into HAL_MspInit(void) it returns the error  "Undefined reference to '__HAL_RCC_SYSCFG_CLK_ENABLE();'". 

 

Here is some additional information:

Using STM32H7S3R8

I am using device mode for USB HS

60MHz going into USBOHS. 

USB OTG global interrupt enabled. 

STM32H7S/R require enable USB HS power:

CubeMX -> Power and Thermal -> PWR -> USB_HS_REGEN = Enabled

 

AlexShao
Visitor

Quick update on my IOC configuration. 
1. Enabled USB_HS_REGEN
2. In 'RCC' set 'CRS SYNC' to 'CRS SYNC Source USB' *
3. In 'NVIC' enable the global interrupt for USB *

* Source: StefanH Associate III

Thank you for the response WojRus! 

I have enabled USB_HS_REGEN. However, the same issue still occurs in USB_CoreReset(), any other insights that might solve the issue? 

Which documentation explains that you need to enable USB_HS_REGEN, and where can I find it? 

0 Kudos