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

From DAVE Developer's Wiki
Jump to: navigation, search
(Linux messages at boot time)
Line 10: Line 10:
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Jan 2022
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Jan 2022
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M release
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M release
 +
|-
 +
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|2.0.0
 +
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Feb 2023
 +
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|DESK-MX8M-L-2.0.0
 
|}
 
|}
 
<section end=History/>
 
<section end=History/>

Revision as of 14:54, 13 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]

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.

Device tree configuration[edit | edit source]

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

From imx8mp-mito8mplus-cb1001.dts:

...
...
&usb3_phy0 {
	vbus-power-supply = <&ptn5110>;
	fsl,phy-tx-vref-tune = <6>;
	fsl,phy-tx-rise-tune = <0>;
	fsl,phy-tx-preemp-amp-tune = <3>;
	fsl,phy-comp-dis-tune = <7>;
	fsl,pcs-tx-deemph-3p5db = <0x21>;
	fsl,phy-pcs-tx-swing-full = <0x7f>;
	status = "okay";
};

&usb3_0 {
	status = "okay";
};

&usb_dwc3_0 {
	dr_mode = "host";
	status = "okay";

	port {
		usb3_drd_sw: endpoint {
			remote-endpoint = <&typec_dr_sw>;
		};
	};
};

Accessing the peripheral[edit | edit source]

Linux messages at boot time[edit | edit source]

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.)

root@desk-mx8mp:~# [ 2406.464399] usb 6-1: USB disconnect, device number 2
[ 2407.644440] usb 2-1.3: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd
[ 2407.670023] usb-storage 2-1.3:1.0: USB Mass Storage device detected
[ 2407.677192] scsi host0: usb-storage 2-1.3:1.0
[ 2408.691090] scsi 0:0:0:0: Direct-Access     HYPER    FLASHDISK        1507 PQ: 0 ANSI: 0
[ 2408.701469] sd 0:0:0:0: [sda] 129630208 512-byte logical blocks: (66.4 GB/61.8 GiB)
[ 2408.709458] sd 0:0:0:0: [sda] Write Protect is off
[ 2408.714509] sd 0:0:0:0: [sda] No Caching mode page found
[ 2408.719856] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2408.743246]  sda: sda1
[ 2408.747220] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@desk-mx8mp:~#

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