DESK-MX6-L/Pheripherals/USB Host

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

14091

16/07/2021 First DESK release

17002

03/03/2022 DESK 3.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.)

[  293.085612] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[  293.287458] usb 1-1: New USB device found, idVendor=0781, idProduct=5591, bcdDevice= 1.00
[  293.287490] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  293.287509] usb 1-1: Product:  SanDisk 3.2Gen1
[  293.287525] usb 1-1: Manufacturer:  USB
[  293.287541] usb 1-1: SerialNumber: 03017128082020175157
[  293.289195] usb-storage 1-1:1.0: USB Mass Storage device detected
[  293.302275] scsi host0: usb-storage 1-1:1.0
[  294.376862] scsi 0:0:0:0: Direct-Access      USB      SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
[  294.379701] sd 0:0:0:0: [sda] 30031872 512-byte logical blocks: (15.4 GB/14.3 GiB)
[  294.381105] sd 0:0:0:0: [sda] Write Protect is off
[  294.381122] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  294.381838] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  294.439432]  sda: sda1
[  294.446425] 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
drwxr-xr-x 3 root root    4096 Feb 24 14:16 .
drwxr-xr-x 5 root root    4096 Feb 27 15:41 ..
drwx------ 2 root root   16384 Feb 24 14:16 lost+found
-rwxr-xr-x 1 root root 6881192 Feb 24 14:16 uImage