cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 USB internal PU resistor on USB DP line "floating"

bursztyn12
Associate

Hello,

I've developed a custom board based on the STM32H573RI MCU. Everything on the board is operating properly except the USB C, which is far from working out of the box.

The problem that I'm experiencing is that after the initialization (enable the USB_BCDR_DPPU bit) of the USB driver the DP pin in not pulled high (3.3V), it's stays low/floating at 0.160V (which is different from the behaviour on the e.g Nulceo H503 board, where the DP pin is at expected 3.3V). The USB driver implementation is based on the following article:

How to use STMicroelectronics classic USB device m... - STMicroelectronics Community

The DP and DM pins are not shorted and from the CubeMX perspective the USB, both peripheral and pins, are configured with default values (e.g alternating function/no pull up for pins).

 

Screenshot of the USB connector:

usb_connector.png

Screenshot of the STM32 USB pins:

stm32_usb pins.png

And here are screenshots from CubeMX configuration:

bursztyn12_0-1708383785655.png

bursztyn12_1-1708383816125.pngbursztyn12_2-1708383837944.png

And the intialization of the USB from the code perspective:

bursztyn12_4-1708383965067.png

If someone has an idea of what I did wrong or has an explanation why the DP pin stays low, I would appraciate any input. Thanks in advance! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bursztyn12
Associate

Of course I haven't!, I guess I've become more and more used to CubeMX and the HAL drivers do everything for me.

For every newcomer to the STM32H573 micro this is a key chapter regarding the usb:

bursztyn12_0-1708465149261.png

This code does the job done:

HAL_PWREx_EnableUSBVoltageDetector();
while(!LL_PWR_IsActiveFlag_VDDUSB()){}
HAL_PWREx_EnableVddUSB();

Aadditionaly remember to enable the Flash!:

bursztyn12_1-1708465276394.png

Thanks @waclawek.jan for the reminder that the reference manual is always our best friend in such situations.

View solution in original post

2 REPLIES 2

I don't know the 'H5, but generally:

- read out given register content and check if given bit is indeed set

- make sure all clocks necessary are up and running (in some STM32 there are several separate clocks for USB core and USB PHY)

- in some STM32 USB PHY is in a separate power domain (separate VDDIO/VDDUSB or similarly named pin) so make sure all VDD pins are powered properly

You've read thoroughly the initial chapters (including PWR, RCC, SYSCFG) and the USB chapter in RM, haven't you.

JW

bursztyn12
Associate

Of course I haven't!, I guess I've become more and more used to CubeMX and the HAL drivers do everything for me.

For every newcomer to the STM32H573 micro this is a key chapter regarding the usb:

bursztyn12_0-1708465149261.png

This code does the job done:

HAL_PWREx_EnableUSBVoltageDetector();
while(!LL_PWR_IsActiveFlag_VDDUSB()){}
HAL_PWREx_EnableVddUSB();

Aadditionaly remember to enable the Flash!:

bursztyn12_1-1708465276394.png

Thanks @waclawek.jan for the reminder that the reference manual is always our best friend in such situations.