Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-L/Peripherals/USB Host

358 bytes removed, 15:40, 15 July 2021
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 YearJul 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"|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
|-
|}
==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";};......&iomuxc { pinctrl-0 = <&pinctrl_hog_gpios>; imx6ul-axelulite {...... pinctrl_usb_otg1: usbotg1grp { fsl,pins = < MX6UL_PAD_UART1_CTS_B__GPIO1_IO18 0x10b0 /* HOST PWR */ MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0x10b0 /* HOST OC */ >; };
};
</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====
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@desk-mx6ul-axelulite:~# [ 564......193377] usb 1-1: new high-speed USB device number 2 using ci_hdrc[ 1 564.807495435616] flexcan 2090000.flexcanusb 1-1: 2090000.flexcan supply xceiver not New USB device found, using dummy regulatoridVendor=0951, idProduct=1665[ 1 564.817366442457] flexcan 2090000.flexcanusb 1-1: New USB device registered (reg_basestrings: Mfr=1, Product=c0a300002, irqSerialNumber=31)3[ 564.457846] usb 1-1: Product: DataTraveler 2.....0[ 3 564.952659462455] canusb 1-1: controller area network core (rev 20170425 abi 9)Manufacturer: Kingston[ 3 564.963413474290] canusb 1-1: SerialNumber: raw protocol (rev 20170425)50E549C202681071F97202CB[ 3 564.967717488603] canusb-storage 1-1: broadcast manager protocol (rev 20170425 t)1.0: USB Mass Storage device detected[ 3 564.973397508986] canscsi host0: netlink gateway (rev 20170425) max_hops=usb-storage 1</pre> ====Enable the interface and check status====<pre class="workstation-terminal">1:1.0root@imx6qxelk[ 565.526470] scsi 0:~# ip link set can0 type can bitrate 500000root@imx6qxelk0:~# ifconfig can0 uproot@imx6qxelk0:~# ifconfig can0can0 Link encap0:UNSPEC HWaddr 00Direct-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 UP RUNNING NOARP MTUAccess Kingston DataTraveler 2.0 0000 PQ:16 Metric0 ANSI:14 RX packets[ 565.555313] sd 0:0 errors:0 dropped:0 overruns:[sda] 15151168 512-byte logical blocks: (7.76 GB/7.22 GiB)[ 565.583739] sd 0 frame:0 TX packets:0 errors:0 dropped:[sda] Write Protect is off[ 565.599208] sd 0 overruns:0 carrier:0 collisions:0 txqueuelen:10[sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA RX bytes[ 565.637032] sda:0 (0sda1[ 565.663492] sd 0 B) TX bytes:0 (:0.:0 B) Interrupt:31[sda] Attached SCSI removable disk
root@imx6qxelk:~#
</pre>
 ===Additional information = Usage with [https://github.com/linux-can/can-utils can-utils] ==== ''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@imx6qxelkdesk-mx6ul-axelulite:~# ip link set can0 type can bitrate 500000 triplemkdir -sampling onp /mnt/usbroot@imx6qxelkdesk-mx6ul-axelulite:~# ifconfig can0 upmount /dev/sda1 /mnt/usb[ 640.717947] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.root@imx6qxelkdesk-mx6ul-axelulite:~# cansend can0 128#1122334455667788 ls -la /mnt/usbtotal 6756drwxr-xr-x 3 root root 16384 Jan 1 1970 .drwxr-xr-x 4 root root@imx6qxelk 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@imx6qxelkdesk-mx6ul-axelulite:~#
</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/>
 
----
[[Category:AXEL ULite]]
8,226
edits