Hi,
I have a usb device who act as a mass storage device for my sd card on a BeagleBone with Starterware and I want to be able to know when the USB cable is plugged/unplugged to start/stop some services depending on state of usb. First, I'm calling USBDMSCInit when sd card is present and USBDMSCTerm when sd card is removed to remove it from windows. But now, I want to enable USB MSC device only if usb is connected AND sd card is present and disable USB MSC device when usb cable in disconnected or sd card is removed. I was thinking I can check with USBModeGet and mask with USB_DEVCTL_VBUS_M to know if cable is connected to host, but after a disconnect/reconnect, I can't detect cable, I see always the same thing USB_DEVCTL_DEV. How to detect usb cable connect/disconnect to host with USB_VBUS tied directly to USB0_VBUS.
Thank you
Jim