cancel
Showing results for 
Search instead for 
Did you mean: 

USB Slave - does the code need to change USBDM USBDP (PA11 PA12) to inputs when VBUS_SENSE=0?

PHolt.1
Senior III

We are using the STM32 USB Device Library.

This is the USB circuit

https://peter-ftp.co.uk/screenshots/20210511523173514.jpg

Does the STM library implement this, or do I need to detect a drop in VBUS (cable to Controller being disconnected), or is no action required?

The concern is that current can flow from those two lines of a powered 32F417 into an unpowered USB Controller. But maybe this doesn't matter.

Many thanks!

1 REPLY 1
PHolt.1
Senior III

Can anyone offer any input on this?

There is a 1.5k resistor to +3.3V which is enabled or disabled. This obviously works in normal USB operation where +5V is arriving from the USB Controller, but what if the +5V connection is broken? That is partly what VBUS_SENSE is for - to make sure that resistor is not enabled in that case, because it would feed a bit of current into the controller.