Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6-L/Peripherals/USB Host

974 bytes removed, 07:45, 12 October 2020
no edit summary
!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"|X1.Y0.Z0|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 YearOct 2020|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:#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:#edf8fb; padding:5px; color:#000000"|...|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"|...|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
|}
<section end=History/>
==Peripheral USB Host ==
The USB Host port requires to configure the USB VBUS regulator and the ''TBD: sostituire tutti i dump con le informazioni sull'uso della perifericagpio''' 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 Lite SOM:
From <code>''carrierimx6qdl-axelcommon.dts''dtsi</code>:
<pre>
&can1 regulators { compatible = "simple-bus"; reg_usb_h1_vbus: usb_h1_vbus { pinctrl compatible = "regulator-fixed"; regulator-names name = "defaultusb_h1_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; gpio = <&gpio2 11 0>; enable-active-high; }; };......&usbh1 { pinctrlvbus-0 supply = <&pinctrl_flexcan1_axelreg_usb_h1_vbus>;
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>
====Linux messages at boot time====
<pre class="workstation-terminal">......[ 1.807495] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not foundWhen a USB peripheral is inserted, using dummy regulator[ 1.817366] flexcan 2090000.flexcan: in the following example a memory mass storage device registered (reg_base=c0a30000, irq=31)......[ 3.952659] can: controller area network core the kernel recognizes the device (rev 20170425 abi 9)[ 3i.963413] can: raw protocol (rev 20170425)[ 3e.967717] can: broadcast manager protocol (rev 20170425 t)[ 3xlass, vendor id, product id, etc.973397] can: netlink gateway (rev 20170425) max_hops=1</pre>
====Enable the interface and check status====
<pre class="workstation-terminal">
root@imx6qxelkimx6qdlxelk:~# ip link set can0 type can bitrate 500000[ 635.250658] usb 1-1: new high-speed USB device number 3 using ci_hdrcroot@imx6qxelk[ 635.452905] usb 1-1:~# ifconfig can0 upNew USB device found, idVendor=18a5, idProduct=0302root@imx6qxelk[ 635.459662] usb 1-1: New USB device strings:~# ifconfig can0Mfr=1, Product=2, SerialNumber=3can0 Link encap[ 635.468681] usb 1-1:UNSPEC Product: STORE N GO[ HWaddr 00635.473596] usb 1-001: Manufacturer: Verbatim[ 635.477809] usb 1-001: SerialNumber: CCYYMMDDHHmmSSNUFLQ9[ 635.491337] usb-00storage 1-00-00-00-00-00-00-00-00-00-00-00-001:1.0: USB Mass Storage device detected UP RUNNING NOARP [ MTU635.497852] scsi host0:16 Metricusb-storage 1-1:1.0 RX packets[ 638.418581] scsi 0:0 errors:0 dropped:0 overruns:Direct-Access Verbatim STORE N GO 1100 PQ: 0 ANSI: 4[ 638.429992] sd 0 frame:0 TX packets:0 errors:0 dropped:[sda] 61069312 512-byte logical blocks: (31.3 GB/29.1 GiB)[ 638.444695] sd 0 overruns:0 carrier:0 collisions:0 txqueuelen:10[sda] Write Protect is off RX bytes[ 638.453430] sd 0:0:0 (:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA[ 638.473696] sda: sda1[ 638.481431] sd 0 B) TX bytes:0 (:0.:0 B) Interrupt:31[sda] Attached SCSI removable diskroot@imx6qxelkimx6qdlxelk:~#
</pre>
==== Usage with [https://github.com/linux-can/can-utils can-utils] =Additional information === ''TBDIf the root file system configuration does not automatically mount the partition, it is possible to mount the device using the following command: reference verso eventuali informazioni sul web''
<pre class="workstation-terminal">
root@imx6qxelkimx6qdlxelk:~# ip link set can0 type can bitrate 500000 triplemkdir -sampling onp /mnt/usbroot@imx6qxelkimx6qdlxelk:~# ifconfig can0 upmount /dev/sda1 /mnt/usb[ 831.081734] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.root@imx6qxelkimx6qdlxelk:~# cansend can0 128#1122334455667788 ls -la /mnt/usbtotal 6756drwxr-xr-x 3 root root 16384 Jan 1 1970 .drwxr-xr-x 4 root@imx6qxelkroot 4096 Oct 7 16:~# candump can033 ..drwxr-xr-x 2 root root can0 16384 Feb 26 128 [8] 2020 System Volume Information-rwxr-xr-x 1 root root 6881192 Mar 31 11 22 33 44 55 66 77 882020 uImage-4.14.98-xelk-5.0.0-rc2+gb0960b6root@imx6qxelkimx6qdlxelk:~#
</pre>
=== Additional information ===
Each CAN port appears like a networking interface in the form <code>canX</code> where <b><i>X</i></b> is the port number.
 
Information about programming the CAN socket interface is given in the kernel tree under ''Documentation/networking/can.txt''
<section end=Body/>
8,226
edits