All Colibri modules have one port which can work either in USB host or in USB function mode (also known as Client mode). This is not a full support of all USB On-The-Go (OTG) features, but it is possible to switch between host and function mode at runtime, without reboot.
The Colibri PXA modules automatically select between host and function mode, depending on the USB cable detect pin. For details, refer to the following article:
USB client driver registry settings
The port is working in function mode by default. To activate the host mode, add the following registry settings:
[HKLM\Drivers\BuiltIn\USBEHCI1] Dll="libnvusbh.dll" ;activate USBEHCI1 driver [HKLM\Drivers\BuiltIn\USBFN] Dll="_libnvusbfn.dll" ;deactivate USBFN driver
Don't forget to save the registry before rebooting the module.
Automatic switching between USB host and function is supported in image V1.2 and later for Colibri Tegra T20 modules. On Colibri and Apalis T30 you need to manually switch as described above.
To enable the automatic switching, disable USBFN and USBEHCI1, enable USBOTG instead. This can be achieved by a few registry settings:
[HKLM\Drivers\BuiltIn\USBEHCI1] Dll="_libnvusbh.dll" ;deactivate USBEHCI1 driver [HKLM\Drivers\BuiltIn\USBFN] Dll="_libnvusbfn.dll" ;deactivate USBFN driver [HKLM\Drivers\BuiltIn\USBOTG] Dll="libnvusbotg.dll" ;activate USBOTG driver
Depending on the hardware layout some additional settings are needed in order to make the OTG switch working stable:
[HKLM\Drivers\BuiltIn\USBOTG] DebounceDelay=dword:50 ;Delay to OTG driver waits for settling the CableDetectPin ;before switching between Host <-> Client in ms. Default: 50ms USBFNUnloadDelay=dword:10 ;Delay before unloading USBFn after level change is detected ;on CableDetectPin in ms. Default: 10ms
Don't forget to save the registry before rebooting the module.
It is possible to force the usb on-the-go port to behave only as host or as client by changing some registry entries.
First of all, USB on-the-go must be disabled. Change the following entry:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\UsbOtg] “Dll” = “_fsl_usbotg.dll”
To enable host change those entries:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\HCD_HSH2] "Dll"="hcd_hsotg.dll"
To enable client:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\UFN] "Prefix"="UFN" "Dll"="usbfn.dll"
It's obviously not possible to enable host and client at the same time. You will need to save registry and reboot to apply those changes.
There are basically two hardware configurations for the USB OTG, which should be handled differently.
In both configurations the 5V USB power is controlled by a Power Enable (PE) pin:
There is a registry setting to switch between the behaviors:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USBOTG] "CableDetectPol"=dword:0x00000001 ;default 1
On the Module we only have one pin to detect the host/client status. Default is, that we detect the 5V connected to a USB client(B) connector (CableDetectPol=1). The alternative configuration is to detect an ID pin pulled to GND (CableDetectPol=0)
It is possible to force the usb on-the-go port to behave only as host or as client by changing some registry entries.
First of all, USB on-the-go must be disabled. Change the following entry:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USBOTG] "Dll"="_otg_vybrid.dll"
To enable host change those entries:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\HCD_HSH2] "Dll"="hcd_hsh1.dll"
To enable client:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\UFN] "Dll"="usbfn.dll"
It's obviously not possible to enable host and client at the same time. You will need to save registry and reboot to apply those changes.