Skip to main content
Visitor II
November 27, 2019
Question

STM32 USB connect recognition

  • November 27, 2019
  • 1 reply
  • 489 views

how to know it is a usb charger or PC connect to the stm32 USB device mass storage?​

    This topic has been closed for replies.

    1 reply

    Super User
    November 27, 2019

    If it enumerates the device, it is a PC.

    Else, to further detect the kind of charger, google for "USB charger detection". ST has a chip for this.

    -- pa

    Visitor II
    December 2, 2019

    >>If it enumerates the device, it is a PC.

    means that i need to check the enumerates flag in stm32 usb driver?