Skip to main content
Denis Gottardello
Associate III
May 2, 2017
Question

stm32 and usb interface

  • May 2, 2017
  • 6 replies
  • 1018 views
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?
    This topic has been closed for replies.

    6 replies

    howard n2wx
    Associate III
    May 2, 2017
    Posted on May 02, 2017 at 15:54

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

    Denis Gottardello
    Associate III
    May 2, 2017
    Posted on May 02, 2017 at 16:19

    Using a multimeter I have 3.3

    howard n2wx
    Associate III
    May 2, 2017
    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
    Visitor II
    May 4, 2017
    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'.

    Denis Gottardello
    Associate III
    May 30, 2017
    Posted on May 30, 2017 at 16:13

    Many thanks.

    Nesrine M_O
    Associate
    May 30, 2017
    Posted on May 30, 2017 at 16:38

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