Linux USB Host: Difference between revisions

From Variscite Wiki
(Created page with "{{PageHeader|VAR-SOM-MX6 - USB Host}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__ Plug a DiskOnKey, Mouse or Keyboard to any of the 3 USB host ports on the DVK....")
 
m (Nate moved page IMX USB Host to Linux USB Host)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{PageHeader|VAR-SOM-MX6 - USB Host}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__
{{PageHeader|USB Host}} {{DocImage|category1=Yocto|category2=Debian}}[[Category:VAR-SOM-MX6]][[Category:DART-6UL]][[Category:VAR-SOM-MX7]][[Category:DART-MX8M]][[Category:DART-MX8M-MINI]][[Category:DART-MX8M-PLUS]] __toc__
Plug a DiskOnKey, Mouse or Keyboard to any of the 3 USB host ports on the DVK.
Plug in a USB mass storage device / mouse / keyboard / any other supported USB device to any of the USB host ports on your DVK.
= Example DiskOnKey =
 
Insert DiskOnKey:
= USB Mass Storage Device Example =
<pre>usb 2-1.3: new high-speed USB device number 8 using ci_hdrc
After inserting a USB stick you should get output similar to this:
usb-storage 2-1.3:1.0: USB Mass Storage device detected
<pre>
scsi2 : usb-storage 2-1.3:1.0
usb 1-1: new high-speed USB device number 3 using ci_hdrc
scsi 2:0:0:0: Direct-Access    SanDisk  Cruzer Blade    2.01 PQ: 0 ANSI: 6
usb-storage 1-1:1.0: USB Mass Storage device detected
sd 2:0:0:0: [sdb] 7821312 512-byte logical blocks: (4.00 GB/3.72 GiB)
scsi1 : usb-storage 1-1:1.0
sd 2:0:0:0: [sdb] Write Protect is off
scsi 1:0:0:0: Direct-Access    SanDisk  U3 Cruzer Micro  8.02 PQ: 0 ANSI: 0 CCS
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 1:0:0:0: [sda] 3907583 512-byte logical blocks: (2.00 GB/1.86 GiB)
  sdb: sdb1
sd 1:0:0:0: [sda] Write Protect is off
sd 2:0:0:0: [sdb] Attached SCSI disk
sd 1:0:0:0: [sda] No Caching mode page found
FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write through
  sda: sda1 sda2
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write thr
</pre>
</pre>
List directory
 
<pre> $ ls /run/media/sdb1/
List directory content:
<pre>
# ls /run/media/sda1
$RECYCLE.BIN                  bookmarks-2015-06-25.json
$RECYCLE.BIN                  bookmarks-2015-06-25.json
Android                        iMX6_gpio_test
Android                        iMX6_gpio_test
LOST.DIR                      linux-3.2.0-psp04.06.00.11
LOST.DIR                      junk
LS1021_SOM                    tek00000.png
LS1021_SOM                    linux-3.2.0-psp04.06.00.11
Movies                        tek00001.png
Movies                        tek00000.png
Mpeg                          tek00002.png
Mpeg                          tek00001.png
Music                          test0.wav
Music                          tek00002.png
Playlists                      test2.wav
Playlists                      test0.wav
SanDiskSecureAccessV2.0        test3.wav
SanDiskSecureAccessV2.0        test2.wav
SanDiskSecureAccessV2_win.exe  testx.wav
SanDiskSecureAccessV2_win.exe  test3.wav
System Volume Information      vmlinux
System Volume Information      testx.wav
TIInit_11.8.32.bts            wifi_fw_android_working
TIInit_11.8.32.bts            vmlinux
VAR-SOM-AM33-SCHV212.DSN      wl1271-nvs.bin
VAR-SOM-AM33-SCHV212.DSN      wifi_fw_android_working
am43-demo                      xorcom
am43-demo                      wl1271-nvs.bin
apk                            zImage
apk                            xorcom
backing_file
backing_file                   zImage
</pre>
</pre>
Write some data:
Write some data:
<pre>$ dd if=/dev/urandom of=/run/media/sdb1/junk bs=1M count=20  
<pre>
# dd if=/dev/urandom of=/run/media/sda1/junk bs=1M count=20  
20+0 records in
20+0 records in
20+0 records out
20+0 records out
20971520 bytes (21 MB) copied, 8.35507 s, 2.5 MB/s
20971520 bytes (21 MB) copied, 22.9626 s, 913 kB/s
</pre>
</pre>


= Example FTDI =  
= FTDI Example =  
Inseret the FTDI device:
After inserting the FTDI device you should get output similar to this:
<pre>usb 2-1.2: USB disconnect, device number 4
<pre>
usb 2-1.2: new full-speed USB device number 7 using ci_hdrc
usb 1-1: new full-speed USB device number 5 using ci_hdrc
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbcore: registered new interface driver usbserial_generic
Line 49: Line 58:
usbcore: registered new interface driver ftdi_sio
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
usbserial: USB Serial support registered for FTDI USB Serial Device
ftdi_sio 2-1.2:1.0: FTDI USB Serial Device converter detected
ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
usb 2-1.2: Detected FT232RL
usb 1-1: Detected FT232RL
usb 2-1.2: Number of endpoints 2
usb 1-1: Number of endpoints 2
usb 2-1.2: Endpoint 1 MaxPacketSize 64
usb 1-1: Endpoint 1 MaxPacketSize 64
usb 2-1.2: Endpoint 2 MaxPacketSize 64
usb 1-1: Endpoint 2 MaxPacketSize 64
usb 2-1.2: Setting MaxPacketSize 64
usb 1-1: Setting MaxPacketSize 64
usb 2-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
</pre>
</pre>
Connect to the target:
 
<pre>$ ssh root@192.168.1.130</pre>
Start minicom and set the interface:
Start minicom and set the interface
<pre>
<pre>$ minicom -s
# minicom -s
</pre>
</pre>
[[File:Minicom_set.png]]
[[File:Minicom_set.png]]
<br/><br/>connect pin 2 to 3 on the serial port and test for loop-back.
<br><br>
connect pin 2 to 3 on the serial port and test for loop-back.

Latest revision as of 21:42, 22 March 2023

USB Host

Plug in a USB mass storage device / mouse / keyboard / any other supported USB device to any of the USB host ports on your DVK.

USB Mass Storage Device Example

After inserting a USB stick you should get output similar to this:

usb 1-1: new high-speed USB device number 3 using ci_hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi1 : usb-storage 1-1:1.0
scsi 1:0:0:0: Direct-Access     SanDisk  U3 Cruzer Micro  8.02 PQ: 0 ANSI: 0 CCS
sd 1:0:0:0: [sda] 3907583 512-byte logical blocks: (2.00 GB/1.86 GiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1 sda2
sd 1:0:0:0: [sda] No Caching mode page found
sd 1:0:0:0: [sda] Assuming drive cache: write thr

List directory content:

# ls /run/media/sda1
$RECYCLE.BIN                   bookmarks-2015-06-25.json
Android                        iMX6_gpio_test
LOST.DIR                       junk
LS1021_SOM                     linux-3.2.0-psp04.06.00.11
Movies                         tek00000.png
Mpeg                           tek00001.png
Music                          tek00002.png
Playlists                      test0.wav
SanDiskSecureAccessV2.0        test2.wav
SanDiskSecureAccessV2_win.exe  test3.wav
System Volume Information      testx.wav
TIInit_11.8.32.bts             vmlinux
VAR-SOM-AM33-SCHV212.DSN       wifi_fw_android_working
am43-demo                      wl1271-nvs.bin
apk                            xorcom
backing_file                   zImage

Write some data:

# dd if=/dev/urandom of=/run/media/sda1/junk bs=1M count=20 
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 22.9626 s, 913 kB/s

FTDI Example

After inserting the FTDI device you should get output similar to this:

usb 1-1: new full-speed USB device number 5 using ci_hdrc
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
usb 1-1: Detected FT232RL
usb 1-1: Number of endpoints 2
usb 1-1: Endpoint 1 MaxPacketSize 64
usb 1-1: Endpoint 2 MaxPacketSize 64
usb 1-1: Setting MaxPacketSize 64
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0

Start minicom and set the interface:

# minicom -s

Minicom set.png

connect pin 2 to 3 on the serial port and test for loop-back.