cancel
Showing results for 
Search instead for 
Did you mean: 

Powering USB Memory device On/Off reliably

Marco Hess
Associate II
Posted on May 31, 2016 at 09:17

Hi,

In a product using an STM32F407 we use the USB interface to connect to a USB memory stick. The base of the project was generated with CubeMX.

To conserve battery power, we need to switch off the USB memory device as we only write or read from it intermittently.

However, we have a small problem when we power up the USB again after a while in that the USBH interface detects that a device is connected but then fails to continue enumerating the device and I never get the  HOST_USER_CLASS_ACTIVE event.

So far I used a timeout of 10 seconds for this to come in and then power cycle the USB port again. Then often it wakes up correctly and I get the HOST_USER_CLASS_ACTIVE within some 500ms or so.

After I power up the USB I call MX_USB_HOST_Init() to what I think is to kick the USBH library and init and enumerate the device.

So how I am supposed to power up the USB on demand and get it to enumerate and be ready in a reliable way without having to power cycle multiple times?

#usbh-msc
2 REPLIES 2
Marco Hess
Associate II
Posted on June 06, 2016 at 09:12

Nobody any idea as to what the proper way is to switch the VBUS on/off to a memory stick and to have it reliably detected and enumerated the next time it powers up?

Posted on June 06, 2016 at 17:17

Forums can be like empty rooms, and when there are people they are often more interested in their own problems.

So how exactly are you turning off power and tri-state the pins currently?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..