2024-02-19 03:09 PM - edited 2024-02-19 03:11 PM
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:
Screenshot of the STM32 USB pins:
And here are screenshots from CubeMX configuration:
And the intialization of the USB from the code perspective:
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!
Solved! Go to Solution.
2024-02-20 01:46 PM
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:
This code does the job done:
HAL_PWREx_EnableUSBVoltageDetector();
while(!LL_PWR_IsActiveFlag_VDDUSB()){}
HAL_PWREx_EnableVddUSB();
Aadditionaly remember to enable the Flash!:
Thanks @waclawek.jan for the reminder that the reference manual is always our best friend in such situations.
2024-02-20 03:29 AM - edited 2024-02-20 03:30 AM
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
2024-02-20 01:46 PM
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:
This code does the job done:
HAL_PWREx_EnableUSBVoltageDetector();
while(!LL_PWR_IsActiveFlag_VDDUSB()){}
HAL_PWREx_EnableVddUSB();
Aadditionaly remember to enable the Flash!:
Thanks @waclawek.jan for the reminder that the reference manual is always our best friend in such situations.