Skip to main content
Visitor II
January 25, 2021
Question

Over-current indication on USB host on STM32F2xx

  • January 25, 2021
  • 1 reply
  • 786 views

Hello, I am using the STM32F2xx ev board to develop a simple application that utilizes the USB port as a HOST. I would like to check if a device has been connected to the port and it causes over-current on the USB.

Looking into the source code, It seems that the USB_OTG_HPRT_POCCHNG bit indicates over-current. Is this correct?

Would someone guide me how to get this indication in my application?

Thanks

    This topic has been closed for replies.

    1 reply

    Super User
    January 25, 2021

    As many of the OTG module's features, also this bit (together with the related POCA flag) is entirely undocumented. IMO best treated as nonexistent.

    The RM/DS indicates, that you have to use an arbitrary GPIO/EXTI pin as input from an external overcurrent detector. I doubt there is any support for this in the Cube USB stack, but I also don't use it.

    JW