USB OTG host and device role detection via software

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB OTG host and device role detection via software

599 Views
yangao
Contributor III

Hi

We use iMX6 and expose the USB OTG port. We use OTG-ID pin to set host/device role. When we pull down OTG-ID, it works as a host; we leave it float to make it work as a device. 

We have two kind of special cables to connect to the OTG port:

1) one side of the cable connects to USB OTG port, the other side is UAB-A male. OTG port is in device role when using this cable.

2) one side of the cable connects to USB OTG port, the other side is USB-A female. OTG port is in host role when using this cable.

Everything works fine after we set the OTG-ID. The problem is we have to set OTG-ID manually.

My question is: is there a way to find out what USB cable/device is connected via software and thus we can set OTG-ID properly automatically?

Thanks,

Winston

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

588 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yan

 

in general one can make necessary connections (ground OTG-ID of float) on cable side

and in software read ID signal as GPIO_1 (ALT3)  on i.MX6DL.

 

Best regards
igor

0 Kudos
Reply