2021-01-25 10:41 AM
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
2021-01-25 12:53 PM
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