Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX8M-L/Peripherals/USB1 OTG

2,864 bytes added, 15 April
no edit summary
<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"|X.Y.Z{{oldid|15724|2021/12/30}}|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"|Month Year|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; borderFirst DESK-bottom:solid 2px #73B2C7; backgroundMX8M-color:#edf8fb; padding:5px; color:#000000"|TBDL 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" |{{oldid|17612|2023/02/24}}
| 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 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"|[TBD_link X.Y.Z]{{oldid|19173|2023/08/22}}|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"|Month Year|style="borderDESK-left:solid 2px #73B2C7; borderMX8M-right:solid 2px #73B2C7;borderL-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD4.0.0 release
|-
|! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fbededed; padding:5px; color:#000000"|...2024/04/11|! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fbededed; padding:5px; color:#000000"|...|style="borderDESK-left:solid 2px #73B2C7; borderMX8M-right:solid 2px #73B2C7;borderL-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|.4.1.0 release
|-
|}
<section end="History" /><section begin="Body" />
==Peripheral USB USB1 OTG ==
''TBD: sostituire tutti i dump con le informazioni sull'uso della periferica''=== Device tree configuration === ==== ORCA SOM ====
=== Device tree configuration ===
Here below an example of device tree configuration used on standard DAVE's kit for the ORCA SOM:
From <code>''carrierimx8mp-mito8mplus-cb1001.dts''</code>:
<pre>
......&can1 usb3_phy0 { pinctrl vbus-power-names supply = "default"<&ptn5110>; fsl,phy-tx-vref-tune = <6>; pinctrl fsl,phy-tx-rise-tune = <0 >; fsl,phy-tx-preemp-amp-tune = <&pinctrl_flexcan1_axel3>; 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>;
};
};
};
...
...
</pre>
==== MITO 8M Mini ==== Here below an example of device tree configuration used on standard DAVE's kit for the MITO 8M Mini: From <code>''carrierimx8mm-commonmito8mmini.dtsi''</code>:
<pre>
can1 ......&usbotg1 { pinctrl_flexcan1_axel: flexcan1axelgrp dr_mode = "otg"; picophy,pre-emp-curr-1 {control = <3>; fsl picophy,pins dc-vol-level-adjust = <7>; disable-over-current; MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x80000000 srp-disable; MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x80000000 hnp-disable; > adp-disable; } status = "disabled"; };......
</pre>
===Accessing the peripheral=======Linux messages at boot time====From <code>imx8mm-mito8mmini-sbcx.dts</code>:
<pre class="workstation-terminal">
...
...
[ 1.807495] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not found, using dummy regulator&usbotg1 {[ 1.817366] flexcan 2090000.flexcan: device registered (reg_base status =c0a30000, irq=31)"okay";};
...
...
[ 3.952659] can: controller area network core (rev 20170425 abi 9)
[ 3.963413] can: raw protocol (rev 20170425)
[ 3.967717] can: broadcast manager protocol (rev 20170425 t)
[ 3.973397] can: netlink gateway (rev 20170425) max_hops=1
</pre>
===Accessing the peripheral SBC ORCA===
 
====Linux messages in host mode====
 
When a USB2.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">
root@desk-mx8mp:~# [ 2778.596667] usb 1-1.2: new high-speed USB device number 4 using xhci-hcd
[ 2778.733583] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 2778.741662] scsi host0: usb-storage 1-1.2:1.0
[ 2780.854831] scsi 0:0:0:0: Direct-Access Fanxiang F206 1100 PQ: 0 ANSI: 4
[ 2780.864795] sd 0:0:0:0: [sda] 61440000 512-byte logical blocks: (31.5 GB/29.3 GiB)
[ 2780.875879] sd 0:0:0:0: [sda] Write Protect is off
[ 2780.882883] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[ 2780.883777] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 2780.902324] sda: sda1
[ 2780.908573] sd 0:0:0:0: [sda] Attached SCSI removable disk
</pre>
 
When a USB3.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">
root@desk-mx8mp:~# [ 2786.628638] usb 2-1.2: new SuperSpeed USB device number 4 using xhci-hcd
[ 2786.663569] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[ 2786.670261] scsi host0: usb-storage 2-1.2:1.0
[ 2787.695351] scsi 0:0:0:0: Direct-Access Wilk USB DISK 3.0 PMAP PQ: 0 ANSI: 6
[ 2787.719089] sd 0:0:0:0: [sda] 60628992 512-byte logical blocks: (31.0 GB/28.9 GiB)
[ 2787.727267] sd 0:0:0:0: [sda] Write Protect is off
[ 2787.732132] sd 0:0:0:0: [sda] Mode Sense: 45 00 00 00
[ 2787.733341] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 2787.818114] sda:
[ 2787.822985] sd 0:0:0:0: [sda] Attached SCSI removable disk
</pre>
 
=== Additional information ===
If the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command:
====Enable the interface and check status====
<pre class="workstation-terminal">
root@imx6qxelkdesk-mx8mp:~# ip link set can0 type can bitrate 500000mkdir -p /mnt/usbroot@imx6qxelkdesk-mx8mp:~# ifconfig can0 upmount /dev/sda1 /mnt/usbroot@imx6qxelkdesk-mx8mp:~# ifconfig can0ls -la /mnt/usbcan0 Link encaptotal 104drwxr-xr-x 5 root root 4096 Jul 26 06:UNSPEC 58 .drwxr-xr-x 3 root root HWaddr 004096 Jul 26 06:45 ..drwxr-00xr-00x 2 root root 4096 Jul 26 06:57 boot-00rw-00r-00-00r-00-001 root root 33432 Jul 26 06:57 boot.scr-00rw-00r-00-00r-00-001 root root 0 Jul 26 06:57 config.txtdrwx-00----- 2 root root 16384 Jul 26 06:54 lost+found UP RUNNING NOARP drwxr-xr-x 2 root root MTU4096 Jul 26 06:16 Metric58 rfs-rw-r--r-- 1 root root 33432 Jul 26 06:158 settings.txt</pre> RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0===Accessing the peripheral MITO 8M Mini=== collisions:0 txqueuelen:10 RX bytes==== Usage with [https:0 (0//www.kernel.0 B) TX bytes:0 (0org/doc/Documentation/usb/mass-storage.0 B) Interrupt:31txt mass-storage] ====
<pre class="workstation-terminal">root@imx6qxelkdesk-mx8mm:~# dd if=/dev/zero of=mass_storage count=256 bs=1M256+0 records in256+0 records out268435456 bytes (268 MB, 256 MiB) copied, 0.844688 s, 318 MB/sroot@desk-mx8mp:~# mkfs.msdos mass_storagemkfs.fat 4.1 (2017-01-24)root@desk-mx8mm:~# mkdir looproot@desk-mx8mm:~# mount -o loop mass_storage looproot@desk-mx8mm:~# echo "Test USB OTG with mass storage device" > loop/usb.txtroot@desk-mx8mm:~# umount looproot@desk-mx8mm:~#
</pre>
==== Usage with [https:then insert the <code>g_mass_storage<//github.com/linux-can/can-utils can-utils] ====code> kernel module driver enabling an Windows PC to see it as a ''removable device''
''TBD<pre class="workstation-terminal">root@desk-mx8mm:~# modprobe g_mass_storage removable=y file=mass_storage[ 128.240835] Mass Storage Function, version: 2009/09/11[ 128.246113] LUN: removable file: (no medium)[ 128.250510] LUN: removable file: /home/root/mass_storage[ 128.255874] Number of LUNs=1[ 128.259140] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11[ 128.266151] g_mass_storage gadget: userspace failed to provide iSerialNumber[ 128.273216] g_mass_storage gadget: g_mass_storage readyroot@desk-mx8mm:~#</pre> Once the USB cable is connected to the PC, the kernel prints the following messages: reference verso eventuali informazioni sul web''
<pre class="workstation-terminal">
root@imx6qxelk:~# ip link set can0 type can bitrate 500000 tripledesk-sampling onroot@imx6qxelkmx8mm:~# ifconfig can0 uproot@imx6qxelk:~# cansend can0 128#1122334455667788root@imx6qxelk:~# candump can0 can0 [ 128 [8892.036840] 11 22 33 44 55 66 77 88root@imx6qxelkg_mass_storage gadget:~high-speed config # 1: Linux File-Backed Storage
</pre>
=== Additional information ===Each CAN port appears like a networking interface in and the Windows PC activate the driver and the form <code>canX</code> where <b><i>X</i></b> disk is available as a Drive Unit (with the port number''usb.txt'' file available).
Information about programming the CAN socket interface is given in the kernel tree under ''Documentation/networking/can.txt''
<section end=Body/>
----
[[Category:ORCA]] [[Category:MITO 8M Mini]]
dave_user
424
edits