Skip to main content
Visitor II
July 14, 2023
Solved

STM32U5Ax USB CoreReset timeout

  • July 14, 2023
  • 4 replies
  • 5514 views

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.

 

    This topic has been closed for replies.
    Best answer by MBirk.1

    CubeMX does not generate an important function call:

    __HAL_RCC_SYSCFG_CLK_ENABLE();

    After adding this to HAL_MspInit() it works.

    4 replies

    MBirk.1AuthorAnswer
    Visitor II
    August 1, 2023

    CubeMX does not generate an important function call:

    __HAL_RCC_SYSCFG_CLK_ENABLE();

    After adding this to HAL_MspInit() it works.

    Explorer
    May 8, 2024

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

    Visitor II
    June 27, 2024

    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

    Visitor II
    August 20, 2024

    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)

    Graduate
    February 21, 2025

    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