Changes

Jump to: navigation, search

Physical devices mapping (XUELK)

5,104 bytes added, 20:53, 26 April 2018
minor changes to history table
{{AppliesToSBCLynx}}
{{InfoBoxBottom}}
This article details how physical devices are mapped to handled by the Linux device files kernel in the context of the [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)|XUELK kit]]. == History == {| class="wikitable" border="1"!Version!Date![[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)|XUELK version]]!Notes|-|{{oldid|6648|1.0.0}}|December 2016|1.0.0|First public release|-|1.2.0|May 2017|1.2.0|Update for new XUELK release|-|2.0.0|September 2017|2.0.0|Validated on latest XUELK release|-|} 
==Console UART==
{| class="wikitable"
|}
==Multi-protocol UARTs==
 
{{ImportantMessage|text=From [[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)|XUELK]] version 1.2.0 UART are automatically initialized at boot time, depending on [[ConfigID (XUELK)|ConfigID]]. For XUELK release 1.1.3 and below, in order to use UART8 as RS232 interface, some GPIOs need to be configured as follows explained {{oldid|6648|into release 1.0.0 of this page}} }}
 
 
===Ordering code: XUBxx0xxx0x===
{| class="wikitable"
| MPUART0 || UART7 || J34 || 2-wire RS232 || <code>/dev/ttymxc6</code> ||
|-
| MPUART1 || UART3 || J21 || RS485 [1]|| <code>/dev/ttymxc2</code> ||
|-
|}
===Ordering code: XUBxx0xxx1xXUBxx0xxxxx===
{| class="wikitable"
|-
| MPUART0 || UART8 || J34 || 2-wire RS232 || <code>/dev/ttymxc7</code> ||
|-
| MPUART1 || UART3 || J21 || RS485 [1] || <code>/dev/ttymxc2</code> |||-|} [1] Supported baud rate range: 9600 Bps - 115200 Bps. ===Ordering code: XUBxx3xxxxx==={| class="wikitable"|-! Physical device !! Processor's resource !! Connector !! Type !! Linux device file !! Notes|-| MPUART0 || UART8 || J38 || RS485 [1] || <code>/dev/ttymxc7</code> |||-| MPUART1 || UART3 || J39 || RS485 [1] || <code>/dev/ttymxc2</code> ||
|-
|}
 
[1] Supported baud rate range: 9600 Bps - 115200 Bps.
 
==UART2 on mezzanine connector J53==
Please note that '''this UART is not available if WiFi/Bluetooth module is populated'''.
{| class="wikitable"
|-
! Processor's resource !! Connector .pin# !! Type !! Linux virtual resource !! Notes
|-
| MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 || J53 .6 || LVTTL GPIO || GPIO #31 || see following examples
|-
| MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 || J53 .5 || LVTTL GPIO || GPIO #30 || see following examples
|-
| MX6UL_PAD_LCD_DATA19__GPIO3_IO24 || J53 .7 || LVTTL GPIO || GPIO #24 || see following examples
|-
| MX6UL_PAD_LCD_DATA22__GPIO3_IO27 || J53 .8 || LVTTL GPIO || GPIO #27 || see following examples
|-
| MX6UL_PAD_LCD_DATA23__GPIO3_IO28 || J53 .9 || LVTTL GPIO || GPIO #28 || see following examples
|-
|}
Once mounted (at <code>/run/media/sda1</code> in the esampleexample), the memory stick can be accessed via by regular commands:
<pre>
root@sbc-lynx:~# mount
[1] This type of cables forces the ID signal of the USB port to be connected to ground, selecting the host mode on SBC Lynx side.
 
===Device mode===
The following examples shows how to configure SBC Lynx to act as a mass storage device.
 
First, a local file named <code>mass</code> is created to emulate a mass storage disk that is populated with a file named <code>file.txt</code>:
<pre>
root@sbc-lynx:~# dd if=/dev/zero of=mass count=16 bs=1M
16+0 records in
16+0 records out
root@sbc-lynx:~# mkfs.msdos mass
mkfs.msdos 2.11 (12 Mar 2005)
root@sbc-lynx:~# mkdir loop
root@sbc-lynx:~# mount -o loop mass loop
root@sbc-lynx:~# echo dummy > loop/file.txt
root@sbc-lynx:~# umount loop
</pre>
Then the proper drivers are loaded on target side:
<pre>
root@sbc-lynx:~# insmod modules/libcomposite.ko
root@sbc-lynx:~# insmod modules/usb_f_mass_storage.ko
root@sbc-lynx:~# insmod modules/g_mass_storage.ko file=mass
Number of LUNs=8
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
Number of LUNs=1
LUN: file: /home/root/mass
Number of LUNs=1
g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
g_mass_storage gadget: userspace failed to provide iSerialNumber
g_mass_storage gadget: g_mass_storage ready
</pre>
Last, SBC Lynx is connected to a PC with a USB cable like this one:
 
[[File:USB-cable-micro-host-a.png|thumb|center|400px|USB cable used to connect SBC Lynx to PC]]
 
 
On PC side, SBC Lynx is detected as a common USB mass storage device.
 
==USB host==
The following example shows how an USB memory stick is detected by the Linux kernel when plugged into the J48 connector:
<pre>
root@imx6ulevk:~# [ 75.584841] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 75.742301] usb 1-1: New USB device found, idVendor=13fe, idProduct=3e00
[ 75.749941] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 75.757910] usb 1-1: Product: DISK
[ 75.761448] usb 1-1: Manufacturer: USB
[ 75.766141] usb 1-1: SerialNumber: 9BC3170089A71A0A
[ 75.777163] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 75.786170] scsi0 : usb-storage 1-1:1.0
[ 76.817769] scsi 0:0:0:0: Direct-Access USB DISK PMAP PQ: 0 ANSI: 4
[ 79.046564] sd 0:0:0:0: [sda] 15646720 512-byte logical blocks: (8.01 GB/7.46 GiB)
[ 79.056659] sd 0:0:0:0: [sda] Write Protect is off
[ 79.062243] sd 0:0:0:0: [sda] No Caching mode page found
[ 79.068416] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 79.083946] sd 0:0:0:0: [sda] No Caching mode page found
[ 79.089858] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 79.122209] sda: sda1
[ 79.139095] sd 0:0:0:0: [sda] No Caching mode page found
[ 79.146243] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 79.152561] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 80.060663] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
</pre>
Once mounted (at <code>/mnt/usb/</code> in the example), the memory stick can be accessed with regular commands:
<pre>
root@imx6ulevk:~# mkdir /mnt/usb
root@imx6ulevk:~# mount /dev/sda1 /mnt/usb/
root@imx6ulevk:~# time cp LibreOffice_4.1.1_Win_x86.msi /mnt/usb/; sync
 
real 0m47.236s
user 0m0.020s
sys 0m8.590s
root@imx6ulevk:~# ls -la /mnt/usb/
total 215152
drwxrwx--- 3 root disk 4096 Mar 4 20:48 .
drwxr-xr-x 5 500 502 4096 Mar 9 2016 ..
-rwxrwx--- 1 root disk 112328 Jan 14 18:47 CoreIBEXarm
-rwxrwx--- 1 root disk 215056384 Mar 4 20:49 LibreOffice_4.1.1_Win_x86.msi
-rwxrwx--- 1 root disk 173 Jan 1 1980 UpdateIBEX.log
drwxrwx--- 2 root disk 4096 Jan 1 1980 UpdateIBEX19700101010500
-rwxrwx--- 1 root disk 1303 Feb 19 12:36 Xilinx_OSD_19-02-2016.lic
-rwxrwx--- 1 root disk 5105327 Jan 18 16:31 ibex.war
-rwxrwx--- 1 root disk 105 Jun 10 2015 update-script.sh
-rwxrwx--- 1 root disk 6494 Jan 18 16:52 update-script_.sh
root@imx6ulevk:~# umount /mnt/usb/
root@imx6ulevk:~#
root@imx6ulevk:~#
root@imx6ulevk:~# [ 456.298630] usb 1-1: USB disconnect, device number 2
</pre>
743
edits

Navigation menu