Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I detect a USB connection using information in Cortex M7 registers

I'm moving an application that runs on a K20 processor (Teensy 3.2) to a Cortex M7 (Teensy 4.0). On the K20 I was able  to use the LINESTATESTABLE field in the OTGSTAT register to reliably tell via software if the device was connected to a windows PC. How can I tell if the usb cable is connected to a windows pc or not. So far I've tried the following, none of which changed state when the USB cable was unplugged:

USBPHY_STATUS OTGID_STATUS (bit 8) and DEVPLUGIN_STATUS (bit 6)

USB1_OTGSC bits 8-10 related to Vbus, 

USB1_USBSTS PCI bit 2 port change detect

What field can I test to see if there is a USB connection or not? At over 3500 pages, the i.MX RT1060 Processor Reference Manual probably holds the answer, I can't seem to find it. Any help would be greatly appreciated