DESK-MX6-L/Peripherals/USB Host

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2021/07/16

First DESK-MX6-L release

2022/03/03

DESK-MX6-L 3.0.0 release
2023/04/11 DESK-MX6-L 4.0.0 release


Peripheral USB Host[edit | edit source]

The USB Host port requires to configure the USB VBUS regulator and the gpio used for enabling the 5V USB power switch.

Device tree configuration[edit | edit source]

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

From imx6qdl-axelcommon.dtsi:

    regulators {
        compatible = "simple-bus";
 
        reg_usb_h1_vbus: usb_h1_vbus {
            compatible = "regulator-fixed";
            regulator-name = "usb_h1_vbus";
            regulator-min-microvolt = <5000000>;
            regulator-max-microvolt = <5000000>;
            gpio = <&gpio2 11 0>;
            enable-active-high;
        };
    };
...
...
&usbh1 {
    vbus-supply = <&reg_usb_h1_vbus>;
    status = "okay";
};

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. xlass, vendor id, product id, etc.)

[  949.174288] usb 1-1: New USB device found, idVendor=13fe, idProduct=6700, bcdDevice= 1.10
[  949.182598] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  949.192339] usb 1-1: Product: USB DISK 3.0
[  949.196474] usb 1-1: Manufacturer: Wilk
[  949.202608] usb 1-1: SerialNumber: 07012533C2BE5935
[  949.216478] usb-storage 1-1:1.0: USB Mass Storage device detected
[  949.234501] scsi host0: usb-storage 1-1:1.0
[  950.319317] scsi 0:0:0:0: Direct-Access     Wilk     USB DISK 3.0     PMAP PQ: 0 ANSI: 6
[  950.334575] sd 0:0:0:0: [sda] 60628992 512-byte logical blocks: (31.0 GB/28.9 GiB)
[  950.343311] sd 0:0:0:0: [sda] Write Protect is off
[  950.357023] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  950.421972]  sda: sda1 sda2
[  950.433822] 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-mx6:~# mkdir -p /mnt/usb
root@desk-mx6:~# mount /dev/sda1 /mnt/usb/
root@desk-mx6:~# ls -la /mnt/usb/
total 24
drwxrwx--- 3 root disk    16384 Jan  1  1970 .
drwxr-xr-x 6 root root     4096 Apr  4 07:11 ..
drwxrwx--- 3 root disk     2048 Apr  5  2011 EFI
-rwxrwx--- 1 root disk 10193056 Apr  5  2011 uImage