cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 and usb interface

Posted on May 02, 2017 at 15:03

I have a problem with usb interface.

Every time that I restart the microcontroller, I must to unplug and replug the usb cable.

Is there a way to reset the usb interface an startup?
6 REPLIES 6
howard n2wx
Senior
Posted on May 02, 2017 at 15:54

Classic problem.  Is USB_DP is pulled up to +5?

Posted on May 02, 2017 at 16:19

Using a multimeter I have 3.3

Posted on May 02, 2017 at 16:23

Thing is, if it's pulled up in hardware you'll need to either power cycle the board or unplug the PC to get it reconnected.

Perhaps consider switching the USB_DP pullup with a GPIO-controlled transistor or FET to signal the need to reinit the USB link.

Andre Webber
Associate
Posted on May 04, 2017 at 07:48

I had a similar problem on the STM32F4 series as the DP is pulled up in hardware - on boot-up I set the USB pins as GPIOs and set them low, waited for 100msec and then started the USB Host or Device driver up again which switches the pins to their alternate function for usb. This seemed to force the PC to see the device 'disappear'.

Posted on May 30, 2017 at 16:13

Many thanks.

Posted on May 30, 2017 at 16:38

https://community.st.com/0D50X00009bMM5DSAW