Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-L/Peripherals/USB Host

5 bytes removed, 11 January
m
U0007 moved page DESK-MX6UL-L/Pheripherals/USB Host to DESK-MX6UL-L/Peripherals/USB Host without leaving a redirect
<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|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"14248|Month Year2021/07/20}}|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"|TBDFirst 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" |{{oldid|16317|2022/03/16}}
| 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-MX6UL-L 3.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]|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; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|TBD|-|! 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"|...2023/05/04|! 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="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; borderDESK-bottom:solid 2px #73B2C7; backgroundMX6UL-color:#edf8fb; padding:5px; color:#000000"|.L 4.0.0 release
|-
|}
<section end="History" /><section begin="Body" />
==Peripheral USB Host ==
''TBD: sostituire tutti i dump con le informazioni sull'uso della periferica''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 ===
Here below an example of device tree configuration used on standard DAVE's kit for the AXEL ULite SOM:
From <code>''carrierimx6ul-axelulite-cb003a.dts''</code>:
<pre>
&can1 reg_usb_otg1_vbus: regulator@2 { compatible = "regulator-fixed"; reg = <2>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flexcan1_axelpinctrl_usb_otg1>; regulator-name = "usb_otg1_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>; enable-active-high; };......&usbotg1 { vbus-supply = <&reg_usb_otg1_vbus>; disable-over-current; dr_mode = "host"; status = "okay";
};
</pre>
 
From <code>''carrier-common.dtsi''</code>:
 
<pre>
can1 {
pinctrl_flexcan1_axel: flexcan1axelgrp-1 {
fsl,pins = <
MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x80000000
MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x80000000
>;
};
};
</pre>
 
===Accessing the peripheral===
====Linux messages at boot time====
 
<pre class="workstation-terminal">
...
...
[ 1.807495] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not found, using dummy regulator&iomuxc {[ 1.817366] flexcan 2090000.flexcan: device registered (reg_base pinctrl-0 =c0a30000, irq=31)<&pinctrl_hog_gpios>; imx6ul-axelulite {
...
...
[ 3.952659] can pinctrl_usb_otg1: controller area network core (rev 20170425 abi 9)usbotg1grp {[ 3.963413] can: raw protocol (rev 20170425) fsl,pins = < MX6UL_PAD_UART1_CTS_B__GPIO1_IO18 0x10b0 /* HOST PWR */ MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0x10b0 /* HOST OC */ >;[ 3.967717] can: broadcast manager protocol (rev 20170425 t) };[ 3.973397] can: netlink gateway (rev 20170425) max_hops=1};
</pre>
====Enable the interface and check status====
<pre class="workstation-terminal">
root@imx6qxelk:~# ip link set can0 type can bitrate 500000
root@imx6qxelk:~# ifconfig can0 up
root@imx6qxelk:~# ifconfig can0
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:31
root@imx6qxelk:~#</pre>===Accessing the peripheral======= Usage with [https://github.com/linux-can/can-utils can-utils] Linux messages at boot time==== ''TBD: reference verso eventuali informazioni sul web''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.)
<pre class="workstation-terminal">
root@imx6qxelk[ 199.668004] usb 1-1:~# ip link set can0 type can bitrate 500000 triplenew high-sampling onspeed USB device number 2 using ci_hdrcroot@imx6qxelk[ 199.876433] usb 1-1:~# ifconfig can0 upNew USB device found, idVendor=13fe, idProduct=6700, bcdDevice= 1.10root@imx6qxelk[ 199.876545] usb 1-1:~# cansend can0 128#1122334455667788New USB device strings: Mfr=1, Product=2, SerialNumber=3root@imx6qxelk[ 199.876604] usb 1-1: Product:~# candump can0USB DISK 3.0 can0 [ 128 199.876647] usb 1-1: Manufacturer: Wilk[8 199.876690] usb 1-1: SerialNumber: 07012533C2BE5935[ 199.897372] usb-storage 1-1:1.0: USB Mass Storage device detected[ 199.918075] scsi host0: usb-storage 1-1:1.0[ 11 22 33 44 55 66 77 88200.961571] scsi 0:0:0:0: Direct-Access Wilk USB DISK 3.0 PMAP PQ: 0 ANSI: 6root@imx6qxelk[ 200.976402] sd 0:~# 0:0:0: [sda] 60628992 512-byte logical blocks: (31.0 GB/28.9 GiB)[ 200.977682] sd 0:0:0:0: [sda] Write Protect is off[ 200.977729] sd 0:0:0:0: [sda] Mode Sense: 45 00 00 00[ 200.989604] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA[ 201.200618] sda: sda1 sda2[ 201.214974] sd 0:0:0:0: [sda] Attached SCSI removable disk
</pre>
 
=== Additional information ===
Each CAN port appears like a networking interface in If the form <code>canX</code> where <b><i>X</i></b> root file system configuration does not automatically mount the partition, it is possible to mount the port number.  Information about programming the CAN socket interface is given in device using the kernel tree under ''Documentation/networking/can.txt''<section end=Body/>following command:
<pre class="workstation-terminal">
root@desk-mx6ul-axelulite:~# mkdir -p /mnt/usbApr
root@desk-mx6ul-axelulite:~# mount /dev/sda1 /mnt/usb/
root@desk-mx6ul-axelulite:~# ls -la /mnt/usb/
total 24
drwxr-xr-x 3 root root 4096 Apr 1 14:16 .
drwxr-xr-x 4 root root 4096 Apr 3 18:15 ..
drwx------ 2 root root 16384 Apr 3 14:16 lost+found
-rwxr-xr-x 1 root root 6881192 Apr 3 14:16 uImage
</pre>
----
[[Category:AXEL ULite]]
8,226
edits