9 years, 8 months ago.

detecting which usb port is connected

Is there any cool way to detect, which USB port is connected to a PC? For example - the KL25Z provides 2 USB plugs: The mbed programming port and an aditional USB connector. So if plugged in the mbed USB port into a PC, the mbed drive appears. If I plug in the other USB port, the board powered also, and the USBMSD_SD lib can be used to to access data on a SD card, connected to the platform. It then appears on a PC as a mass storage device, accessing the content of the SD. To either initialize SDFileSystem sd(...) or USBMSD_SD sd(...), it needs to be detected which one of the USB ports are connected. Is there a way to do so? Any ideas would be great!

Be the first to answer this question.