cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5G7 MX_USB_OTG_HS_PCD_Init() hangs

Jack3
Senior III

Hello STM32 friends!

I've previously used USB on an STM32G474RET6, and it was initialized with the function:

MX_USB_Device_Init()

The goal is to use it as a USB serial port to communicate with my device, and that worked.

Now I'm using the STM32U5G7VJT6, and this time, the USB is initialized with the function:

MX_USB_OTG_HS_PCD_Init()

But this function hangs.
I've enabled USB interrupts in the STM32CubeMX, but that doesn't help.

I haven't been able to isolate the problem yet, but it's probably something very simple.
Is this another new USB library?
As requested, I attached my IOC file.

What could be the problem?

Sincerely, Jack

6 REPLIES 6
FBL
ST Employee

Hi @Jack3 

Would you attach your IOC file?

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.




Best regards,
FBL

Hi FBL, A good one, thank you!

FBL
ST Employee

Hi @Jack3 

To narrow down the issue, try to reproduce it using a minimal configuration, enabling only the peripherals directly related to the problem and removing the configuration of any unrelated peripherals. 

Do you reproduce using a reference board? If not, you should provide better details about your hardware.

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.




Best regards,
FBL

Unfortunately, that's not very helpful.

It's a custom-built board, but that shouldn't have anything to do with the issue here.
Only USB DP and USB DM are used for USB.

Below, I added the USB part of the schematic, it's straight forward:

0000_chrome_20260226_073201.png

0000_chrome_20260226_073721.png

https://www.we-online.com/components/products/datasheet/82400102.pdf

 

The other configured peripherals are necessary for the project and hopefully have nothing to do with USB.

So I can safely assume the new HAL library for USB is defective, right?

FBL
ST Employee

Hi @Jack3 

OK, in my understanding, you might have usb core soft reset stuck due to incorrect configuration or initialization.

I suggest you to narrow down the issue and test this template project under this path STM32Cube_FW_U5_V1.8.0\Projects\STM32U5x9J-DK\Templates

You can find this article also useful.

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.




Best regards,
FBL

Hi FBL, thank you very much!
My configs are all the same (Clocks, USB), and no luck on this side.
So I guess it's the HAL libraries itself (STM32Cube FW_U5 V1.8.0).