USB 2.0 device mode support on Jetson TK1?

Customer would like to use TK1 as coprocessor to process image analysis from external YUV camera. Meta data transmission via USB interface but TK1 must be in device mode which is accessed by other SOC.
Any help are thanks.

Device mode has the Linux “gadget” framework to speed development of known standard USB classes…that framework is documented in the kernel source Documentation directory, plus there are many examples out on the web.

The ID pin is not set up to switch to device mode by default since by default a Jetson is not programmed to have any device mode other than flashing in recovery mode (you’d have to set up OTG ID pin switching). If you want to manually manipulate the micro-USB port for using device mode instead of host mode there are files in “/sys” from which mode can be manipulated. I use the following aliases for conveniently manually switching between host and device modes (e.g., in ~/.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_*'

With those aliases you can type “otg” to see current mode, “otgdev” to set device mode, or “otghost” to set host mode (you have to use sudo if changing mode).

If you want the new “device” to act as a standard USB class then your job will be fairly easy using the gadget framework, e.g., bulk storage behavior or taking on the commands of a USB Video Class device (such devices have defined interfaces within the USB standard). If you want a custom device behavior you have significantly more work to do since you would need to develop drivers at both the JTK1 end and your host computer.