Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-L/Peripherals/USB OTG

451 bytes added, 18:29, 27 February 2022
USB OTG section update for DESK-MX6UL-L release
<section begin="History" />
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
|-
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
|-
|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"|1.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"|Apr 2021|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 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" |3.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 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" |3.0.0 DESK release
|}
<section end="History" /><section begin="Body" />
==Peripheral USB OTG ==
Here below an example of device tree configuration used on standard DAVE's kit for the [[AXEL ULite SOM]] where USB OTG1 is configured as ''otg'' while the USB OTG2 port is configured in ''host'' mode:
From <code>imx6ul-axelulitelynx-cb003asom0013-cb002f.dts</code>:
<pre>
&usbotg2 pinctrl_usb_otg2: usbotg2grp { vbus-supply fsl,pins = <&reg_usb_otg2_vbus>; pinctrl-names = "default"; MX6UL_PAD_ENET2_TX_DATA1__GPIO2_IO12 0x17059 /* OTG2_PWR */ MX6UL_PAD_ENET2_TX_EN__USB_OTG2_OC 0x17059 /* OTG2_OC */ pinctrl-0 = <&pinctrl_usb_otg2_id >; disable-over-current }; dr_mode = "host"; status = "okay" };
};
...</pre> and from <code>imx6ul-lynx-som0013...dtsi</code>:&iomuxc {...<pre>... usb { pinctrl_usb_otg2_id pinctrl_usb_otg2: usbotg2idgrp usbotg2grp { fsl,pins = < MX6UL_PAD_ENET2_TX_CLK__ANATOP_OTG2_ID MX6UL_PAD_ENET2_TX_DATA1__GPIO2_IO12 0x17059 /* OTG2_PWR */ MX6UL_PAD_ENET2_TX_EN__USB_OTG2_OC 0x17059 /* OTG ID OTG2_OC */ >; }; pinctrl_usb_otg2 pinctrl_usb_otg2_1: usbotg2grp -1 { fsl,pins = < MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x17059 /* OTG PWR OTG2_PWR */ MX6UL_PAD_UART2_CTS_B__GPIO1_IO22 0x10b0 MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x17059 /* OTG OC OTG2_OC */ >; }; };
</pre>
...
...
[ 13.939073691938] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10[ 13.945990700663] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1[ 13.953298708200] usb usb2: Product: EHCI Host Controller[ 13.958211713101] usb usb2: Manufacturer: Linux 45.1410.9835-desk-mx6ul-l-13.0.1 0+g48931d32962e ehci_hcd[ 13.965426721517] usb usb2: SerialNumber: ci_hdrc.1[ 3.667157] usbcore: registered new interface driver usbhid[ 3.672771] usbhid: USB HID core driver
...
...
<pre class="workstation-terminal">
root@desk-mx6ul-axelulite:~# [ 4086.533219792011] usb 21-1: new high-speed USB device number 2 3 using ci_hdrc[ 4086.775605994587] usb 21-1: New USB device found, idVendor=09510781, idProduct=16655591, bcdDevice= 1.00[ 4087.782554003001] usb 21-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3[ 4087.797569010294] usb 21-1: Product: DataTraveler 2 SanDisk 3.02Gen1[ 4087.802174021695] usb 21-1: Manufacturer: Kingston USB[ 4087.813793028329] usb 21-1: SerialNumber: 50E549C202681071F97202CB03017128082020175157[ 4087.827294044709] usb-storage 21-1:1.0: USB Mass Storage device detected[ 4087.850364065893] scsi host0: usb-storage 21-1:1.0[ 4188.926319094462] scsi 0:0:0:0: Direct-Access Kingston DataTraveler 2 USB SanDisk 3.2Gen1 1.0 0000 00 PQ: 0 ANSI: 46[ 4188.953445114699] sd 0:0:0:0: [sda] 15151168 30031872 512-byte logical blocks: (715.76 4 GB/714.22 3 GiB)[ 4188.976216138282] sd 0:0:0:0: [sda] Write Protect is off[ 41.981055] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00[ 4288.003870153463] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA[ 4288.040175228657] sda: sda1[ 4288.063618248736] sd 0:0:0:0: [sda] Attached SCSI removable disk root@desk[ 90.031956] EXT4-mx6ul-axelulitefs (sda1): mounted filesystem with ordered data mode. Opts:~#(null)
</pre>
<pre class="workstation-terminal">
root@desk-mx6ul-axelulitelynx:~# dd if=/dev/zero of=mass_storage count=32 bs=1M
32+0 records in
32+0 records out
33554432 bytes (34 MB, 32 MiB) copied, 30.62181 593427 s, 956.3 5 MB/sroot@desk-mx6ul-axelulitelynx:~# mkfs.msdos mass_storagemkfs.fat 4.1 2 (20172021-01-2431)root@desk-mx6ul-axelulitelynx:~# mkdir looproot@desk-mx6ul-axelulitelynx:~# mount -o loop mass_storage looproottxtt@desk-mx6ul-axelulitelynx:~# echo "Test USB OTG with mass storage device" > loop/usb.txtroot@desk-mx6ul-axelulitelynx:~# umount loop/
</pre>
<pre class="workstation-terminal">
root@desk-mx6ul-axelulitelynx:~# modprobe g_mass_storage removable=y file=mass_storageroot@desk-mx6ul-lynx:~# dmesg | tail -n 7[ 137205.706620107477] Mass Storage Function, version: 2009/09/11[ 137205.711809107514] LUN: removable file: (no medium)[ 137205.731390107758] LUN: removable file: /home/root/mass_storage[ 137205.737101107775] Number of LUNs=1[ 137205.740256113207] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11[ 137205.751272113238] g_mass_storage gadget: userspace failed to provide iSerialNumber[ 137205.760299113253] g_mass_storage gadget: g_mass_storage readyroot@desk-mx6ul-axelulite:~#
</pre>
Once the USB cable is connected to the PC, the kernel prints storage is mounted and the following messages''usb.txt'' file is available:
<pre class="workstation-terminal">
root@desk$ cat /media/tomzy/42D5-mx6ul-axelulite:~# [ 214CBA5/usb.837430] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storagetxt Test USB OTG with mass storage device
</pre>
and the The Windows PC also activate the driver and the disk is available as a Drive Unit (with the ''usb.txt'' file available).
=== Additional information ===
More information about Mass Storage Gadget driver is given in the kernel tree under ''Documentation/usb/mass-storage.txtrst''
<section end="Body" />
----
[[Category:AXEL ULite]]
devwiki_user
120
edits