Difference between revisions of "DESK-MX8M-L/Peripherals/USB2 OTG"

From DAVE Developer's Wiki
Jump to: navigation, search
(Accessing the peripheral)
Line 86: Line 86:
 
</pre>
 
</pre>
  
===Accessing the peripheral===
+
===Accessing the peripheral SBC ORCA===
  
This procedure is the same for both ORCA SOM and MITO 8M Mini.
+
====Linux messages at boot time in host mode====
  
====Linux messages at boot time====
+
When a USB 2.0 peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.)
  
When a USB peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.)
+
<pre class="workstation-terminal">
 +
root@desk-mx8mp:~# [  949.406404] usb 3-1: new high-speed USB device number 3 using xhci-hcd
 +
[  949.559777] usb-storage 3-1:1.0: USB Mass Storage device detected
 +
[  949.566805] scsi host0: usb-storage 3-1:1.0
 +
[  950.603883] scsi 0:0:0:0: Direct-Access    SanDisk  Cruzer Force    1.00 PQ: 0 ANSI: 6
 +
[  950.613554] sd 0:0:0:0: [sda] 60088320 512-byte logical blocks: (30.8 GB/28.7 GiB)
 +
[  950.621925] sd 0:0:0:0: [sda] Write Protect is off
 +
[  950.627095] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 +
[  950.688387]  sda: sda1
 +
[  950.695304] sd 0:0:0:0: [sda] Attached SCSI removable disk
 +
root@desk-mx8mp:~#
 +
</pre>
 +
 
 +
When a USB 3.0 peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.)
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
root@desk-mx8mp:~# [ 2406.464399] usb 6-1: USB disconnect, device number 2
+
root@desk-mx8mp:~# [ 1026.205678] usb 4-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[ 2407.644440] usb 2-1.3: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd
+
[ 1026.231220] usb-storage 4-1:1.0: USB Mass Storage device detected
[ 2407.670023] usb-storage 2-1.3:1.0: USB Mass Storage device detected
+
[ 1026.237848] scsi host0: usb-storage 4-1:1.0
[ 2407.677192] scsi host0: usb-storage 2-1.3:1.0
+
[ 1027.275191] scsi 0:0:0:0: Direct-Access    HYPER    FLASHDISK        1507 PQ: 0 ANSI: 0
[ 2408.691090] scsi 0:0:0:0: Direct-Access    HYPER    FLASHDISK        1507 PQ: 0 ANSI: 0
+
[ 1027.284305] sd 0:0:0:0: [sda] 129630208 512-byte logical blocks: (66.4 GB/61.8 GiB)
[ 2408.701469] sd 0:0:0:0: [sda] 129630208 512-byte logical blocks: (66.4 GB/61.8 GiB)
+
[ 1027.292341] sd 0:0:0:0: [sda] Write Protect is off
[ 2408.709458] sd 0:0:0:0: [sda] Write Protect is off
+
[ 1027.297451] sd 0:0:0:0: [sda] No Caching mode page found
[ 2408.714509] sd 0:0:0:0: [sda] No Caching mode page found
+
[ 1027.302780] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2408.719856] sd 0:0:0:0: [sda] Assuming drive cache: write through
+
[ 1027.336127]  sda: sda1
[ 2408.743246]  sda: sda1
+
[ 1027.340540] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 2408.747220] sd 0:0:0:0: [sda] Attached SCSI removable disk
 
root@desk-mx8mp:~#
 
 
</pre>
 
</pre>
  

Revision as of 14:28, 16 February 2023

History
Version Issue Date Notes
1.0.0 Jan 2022 First DESK-MX8M release
2.0.0 Feb 2023 DESK-MX8M-L-2.0.0


Peripheral USB Host[edit | edit source]

Device tree configuration[edit | edit source]

ORCA SOM[edit | edit source]

The USB2 Type-C port requires to configure the USB VBUS regulator and the gpio used for enabling the 5V USB power switch in Host mode.

Here below an example of device tree configuration used on standard DAVE's kit for the ORCA SOM:

From imx8mp-mito8mplus-cb1001.dts:

&usb3_phy1 {
	fsl,phy-tx-preemp-amp-tune = <2>;
	status = "okay";
};

&usb3_1 {
	status = "okay";
};

&usb_dwc3_1 {
	dr_mode = "otg";
	extcon = <&extcon_usbotg2>;
	hnp-disable;
	srp-disable;
	adp-disable;
	rsp-disable;
	disable-over-current;
	status = "okay";
};

MITO 8M Mini[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the MITO 8M Mini:

From imx8mm-mito8mmini.dts:

...
...
&usbotg2 {
	dr_mode = "host";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usb_pwr>;
	vbus-supply = <&reg_usb_pwr>;
	picophy,pre-emp-curr-control = <3>;
	picophy,dc-vol-level-adjust = <7>;
	status = "okay";
};
...
...
&iomuxc {
...
...
	pinctrl_usb_pwr: usbpwrgrp {
		fsl,pins = <
			MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12			  0x19
		>;
	};
...
...
};

Accessing the peripheral SBC ORCA[edit | edit source]

Linux messages at boot time in host mode[edit | edit source]

When a USB 2.0 peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.)

root@desk-mx8mp:~# [  949.406404] usb 3-1: new high-speed USB device number 3 using xhci-hcd
[  949.559777] usb-storage 3-1:1.0: USB Mass Storage device detected
[  949.566805] scsi host0: usb-storage 3-1:1.0
[  950.603883] scsi 0:0:0:0: Direct-Access     SanDisk  Cruzer Force     1.00 PQ: 0 ANSI: 6
[  950.613554] sd 0:0:0:0: [sda] 60088320 512-byte logical blocks: (30.8 GB/28.7 GiB)
[  950.621925] sd 0:0:0:0: [sda] Write Protect is off
[  950.627095] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  950.688387]  sda: sda1
[  950.695304] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@desk-mx8mp:~#

When a USB 3.0 peripheral is inserted, in the following example a memory mass storage device, the kernel recognizes the device (i.e. class, vendor id, product id, etc.)

root@desk-mx8mp:~# [ 1026.205678] usb 4-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[ 1026.231220] usb-storage 4-1:1.0: USB Mass Storage device detected
[ 1026.237848] scsi host0: usb-storage 4-1:1.0
[ 1027.275191] scsi 0:0:0:0: Direct-Access     HYPER    FLASHDISK        1507 PQ: 0 ANSI: 0
[ 1027.284305] sd 0:0:0:0: [sda] 129630208 512-byte logical blocks: (66.4 GB/61.8 GiB)
[ 1027.292341] sd 0:0:0:0: [sda] Write Protect is off
[ 1027.297451] sd 0:0:0:0: [sda] No Caching mode page found
[ 1027.302780] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 1027.336127]  sda: sda1
[ 1027.340540] sd 0:0:0:0: [sda] Attached SCSI removable disk

Additional information[edit | edit source]

If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:

root@desk-mx8mp:~# mkdir -p /mnt/usb
root@desk-mx8mp:~# mount /dev/sda1 /mnt/usb
[ 1245.415662] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
root@desk-mx8mp:~# ls -la /mnt/usb
total 128
drwxr-xr-x 10 root root  4096 Jan  1  1970 .
drwxr-xr-x  3 root root  4096 Dec 30 11:24 ..
drwxr-xr-x  2 root root  4096 May 13  2021 System Volume Information
drwxr-xr-x  2 root root  4096 Nov 17 15:27 boot
-rwxr-xr-x  1 root root  8016 Nov 17 15:27 boot.scr
-rwxr-xr-x  1 root root  1712 Dec 10 16:16 config.txt
drwxr-xr-x  2 root root  4096 Nov 17 15:27 rfs
-rwxr-xr-x  1 root root 57458 Nov 17 15:27 run-system-update.sh
-rwxr-xr-x  1 root root   531 Nov 17 15:27 settings.txt