6ul USB OTG

From embeddedTS Manuals
Revision as of 11:19, 13 December 2016 by Mark (talk | contribs) (Created page with "Depending on which baseboard the TS-4100 is used with, the OTG port may be usable as host, or it may be brought out to a MicroAB port allowing it to be host or device. Severa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Depending on which baseboard the TS-4100 is used with, the OTG port may be usable as host, or it may be brought out to a MicroAB port allowing it to be host or device. Several devices are compiled into the default kernel. Additional devices can be compiled into the kernel by following the section here.

USB Serial

modprobe g_serial use_acm=1

This will create a /dev/ttyGS0. See the kernel documentation for more information:

USB Ethernet

modprobe g_ether

This provides a usb0 network interface which simulates an ethernet network connection between the host pc and the i.MX6.

Mass Storage

modprobe g_mass_storage file=/dev/mmcblk0

This will present the SD card to the host pc connected to the USB port. Eg:

[85421.087855] scsi 4:0:0:0: Direct-Access     Linux    File-Stor Gadget 0401 PQ: 0 ANSI: 2
[85421.088486] sd 4:0:0:0: Attached scsi generic sg2 type 0
[85421.089546] sd 4:0:0:0: [sdc] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[85421.196213] sd 4:0:0:0: [sdc] Write Protect is off
[85421.196218] sd 4:0:0:0: [sdc] Mode Sense: 0f 00 00 00
[85421.306216] sd 4:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[85421.530556]  sdc: sdc1
[85421.746283] sd 4:0:0:0: [sdc] Attached SCSI disk