cancel
Showing results for 
Search instead for 
Did you mean: 

USB VDD issue

Kaushik1
Associate III
We are using the STM32H7R7L8H6H microcontroller in our product design.
During firmware initialization, we observed inconsistent behavior related to the USB voltage detector on different boards that share the same hardware design and firmware.
Specifically, the following code auto generated by STM32Cube ide (stm32h7rsxx_hal_msp.c), this causes the MCU to halt on certain boards:
if (HAL_PWREx_EnableUSBVoltageDetector() != HAL_OK)
{  
Error_Handler();
}
 
On some boards, the code runs normally, but on others, it enters Error_Handler() immediately after executing this function.
Both boards have identical hardware configuration — USB is not used, and VDD33USB and VDD50USB are tied to 3.3 V.
- Advise whether disabling the USB voltage detector is the recommended workaround when USB is not used.
- Provide any official ST guidance or firmware-level / Hardware level workaround for this behaviour.
USBVDD.png

Should we modify the voltage level on the VDDUSB pin, or adjust the mounting status of the 0-ohm resistor instead? please see attached image.
- Should we comment above line permanently, in that case this lines will auto generated when moodifying .ioc file.
@Mehulrana511 
2 REPLIES 2
TDK
Super User

This shouldn't even compile. HAL_PWREx_EnableUSBVoltageDetector does not return a type.

stm32h7xx-hal-driver/Src/stm32h7xx_hal_pwr_ex.c at d649ed2c7784bfbef4be144e7bfd8dbb41dce5c3 · STMicroelectronics/stm32h7xx-hal-driver

 

If CubeMX is generating this, it's a bug in CubeMX. Please attach your IOC file.

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @Kaushik1 

For STM32H7RS, when USB is not used, you can connect VDD33USB to 0 V to minimize any possible leakage. Also, USB33DEN should be set if a GPIO on port M is used.

It is mentioned in this knowledge base article.

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.