cancel
Showing results for 
Search instead for 
Did you mean: 

Enumeration_USB_VBUS

D3jan
Associate II

Hello,

let say that STM32H753 mCU has connected VBUS (via resistor divider to be sure that voltage on VBUS detection pin (PA9) would never exceed AMR), D-, D+ and GND lines with PC, before mCU core is supplied. At the moment when mCU core is then connected to power supply, would enumeration starts normally as it should or fact that USB module of mCU was connected to PC before core parts of mCU were supplied could bring problems?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

There are no issues here. Connecting USB to the chip won't do anything until the code which initializes the USB module is ran. For example, the bootloader will initialize USB. If you gate that code behind the VBUS connection, the chip will enumerate correctly regardless of when the data lines are connected. The device pulls the D+ high (or similar, depending on USB speed) to initiate the enumeration process. Nothing happens before that.

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

View solution in original post

4 REPLIES 4
TDK
Super User

There are no issues here. Connecting USB to the chip won't do anything until the code which initializes the USB module is ran. For example, the bootloader will initialize USB. If you gate that code behind the VBUS connection, the chip will enumerate correctly regardless of when the data lines are connected. The device pulls the D+ high (or similar, depending on USB speed) to initiate the enumeration process. Nothing happens before that.

If you feel a post has answered your question, please click "Accept as Solution".
D3jan
Associate II

Thanks for quick reply.

So, regardless of fact that USB module of the mCU would be connected to the PC before other (core) parts of mCU would be supplied, enumeration will begin normally at the moment when supply to that parts will be provided. This includes also enabling pull-up resistor on D+ line.This includes also enabling pull-up resistor on D+ line.

D3jan
Associate II

Hello @TDK 

I made some tests today where I tried to connect just D-, D+ and GND lines with PC when uC was supplied. Communication was working ok, even when 5V from the computer was not connected with the VBUS detection pin (PA9) on uC. I was able to measure 10 mV on the that pin on uC during communication between PC and uC. So, it is not completly mandatory to connect 5V from PC to VBUS detection pin on uC for operation?

Many thanks.

VBUS is not mandatory in all cases. It is only ever needed:

  • To supply power if the device is bus-powered.
  • To detect that power is present if the device is self-powered. (You are not allowed to energize DM/DP if VBUS is not present per the USB standard.) If you ignore this, generally nothing bad will happen and things will still work but your device will not be USB compliant.
If you feel a post has answered your question, please click "Accept as Solution".