How to set TX2 OTG USB as device mode and enable Android Gadget

How to set TX2 OTG USB as device mode and enable Android Gadget? I want connect the TX2 to HOST PC through usb cable. PC is the host and TX2 is the device. The PC accesses a specific partition.

What board is that? NVIDIA developer kit or custom carrier board?

Which software release are you using?

developer kit and the software is Linux version 4.9.201-tegra ,Ubuntu is 18.04.


By default the usb device mode is ON when you connected the micro usb port to your host machine.
There should be a window jumping out from your ubuntu host and it contains the L4T-readme file inside it. You can read it.

However, we don’t have experience to enable Android gadget mode. Thus, maybe should wait for other users here to share their case.

Some info, not really an answer…

The micro-OTG connector accepts either a micro-A connector (in which case the port is a regular port for a host and not a device), or a micro-B connector (in which case an ID pin detects this and switches to device mode). The supplied cable is a micro-B USB cable.

What the device type is is completely up to the programmer. The sample devices (such as mass storage or virtual wired networking) are there because someone created that setup using the kernel’s USB Gadget API and not a full driver.

There are a lot of different devices which can connect via USB, and some use “standardized” generic drivers for their class, while a few have custom drivers. Standard class drivers include devices such as keyboard/mouse (Human Interface Device, or HID), mass storage (such as USB thumb drives), and some other types. If the device itself is one of the “standard” class devices, then probably the Gadget API can be used emulate that device.

If the device is not one of the “standard” class devices, then you cannot use the Gadget API, and must build a full driver yourself.

There isn’t really such a thing as “an Android” gadget, it isn’t a standard class. There are many devices an Android o/s can be used with and pretend to be, e.g., mass storage, but this is generic and would not have Android in its name. You would need to specify much more detail of what you want the port to provide, and unless it is a standard class, then you won’t be able to do this without building a custom driver.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.