Jetson TK1 - USB OTG - client mode

Is there USB OTG client mode support in L4T package?

I have tried using USB OTB port in Jetson TK1 in client mode in Linux kernel (using g_mass_storage driver), but it is not working.


  1. USB OTG is working good in Force Recovery Mode.
  2. I can also expose eMMC as mass storage to Linux PC in bootloader level using USB OTG cable.
  3. USB OTG is working good in host mode in kernel level.

Can anyone please confirm, is there support for USB OTG in client mode in L4T Linux kernel?

Jai Ganesh

TK1 switch from host mode to client/device mode and back (micro-A/B connector), based on automatic cable detect, has not been implemented. Manual switch is currently possible via echo to sysfs. Once switched from host mode to device mode via sysfs, a kernel patch is required in order to switch back to host mode from device mode. Kernel patch to be explained last.

I created these bash aliases as a convenience, and placed them in my ~/.bashrc:

alias otg='egrep '[01]' /sys/devices/platform/tegra-otg/enable_*'
alias otgdev='echo 0 > /sys/devices/platform/tegra-otg/enable_host ;\
 echo 1 > /sys/devices/platform/tegra-otg/enable_device ;\
 egrep '[01]' /sys/devices/platform/tegra-otg/enable_*'
alias otghost='echo 0 > /sys/devices/platform/tegra-otg/enable_device ;\
 echo 1 > /sys/devices/platform/tegra-otg/enable_host ;\
 egrep '[01]' /sys/devices/platform/tegra-otg/enable_*'

The alias “otg” displays current micro-A/B host/device mode. The alias “otgdev” puts the TK1 micro-A/B in device mode. The alias “otghost” puts the TK1 micro-A/B in host mode.

For reference, the TK1 kernel code being used for the OTG patches implies L4T R21.4. See this URL:

For convenience, the kernel patch is re-posted here:

--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1520,6 +1520,9 @@
/* REVISIT: should we have config and device level
* disconnect callbacks?
+ if (!cdev )
+ return;
spin_lock_irqsave(&cdev->lock, flags);
if (cdev->config)


As I posted my query in

I tried switching to device mode and tried with mass storage and also ether, but no success. I have applied the patch also. In device mode there is no exception or error messages from jetson side and there is no message from the PC side.

Am I missing something else here?

I replied in that other thread. Best to keep things in a single thread.