Difference between revisions of "Physical devices mapping (XUELK)"

From DAVE Developer's Wiki
Jump to: navigation, search
(NOR and NAND flash)
Line 116: Line 116:
 
==USB host==
 
==USB host==
 
==NOR and NAND flash==
 
==NOR and NAND flash==
NOR and NAND flashes are managed as [Memory_Tecnology_Device_(MTD) MTD devices].  
+
NOR and NAND flashes are managed as [[Memory_Tecnology_Device_(MTD) MTD devices]].  
  
 
Generally speaking, their partitioning is defined via Linux kernel command line. For instance this command line
 
Generally speaking, their partitioning is defined via Linux kernel command line. For instance this command line
Line 142: Line 142:
 
mtd14: 01400000 00010000 "spi-free"
 
mtd14: 01400000 00010000 "spi-free"
 
</pre>
 
</pre>
 +
 
==ADCs==
 
==ADCs==
 
The following processor's signals are available on J54 mezzanine connector and can be configured as 12-bit ADC inputs:
 
The following processor's signals are available on J54 mezzanine connector and can be configured as 12-bit ADC inputs:

Revision as of 15:56, 4 October 2016

Info Box
SBC Lynx-top.png Applies to SBC Lynx

This article details how physical devices are mapped to Linux device files in the context of the XUELK kit.

Console UART[edit | edit source]

Physical device Processor's resource Connector Type Linux device file Notes
Boot Console UART1 J42 2-wire LVTTL UART /dev/ttymxc0

Multi-protocol UARTs[edit | edit source]

Ordering code: XUBxx0xxx0x[edit | edit source]

Physical device Processor's resource Connector Type Linux device file Notes
MPUART0 UART7 J34 2-wire RS232 /dev/ttymxc6
MPUART1 UART3 J21 RS485 /dev/ttymxc2

Ordering code: XUBxx0xxx1x[edit | edit source]

Physical device Processor's resource Connector Type Linux device file Notes
MPUART0 UART8 J34 2-wire RS232 /dev/ttymxc7
MPUART1 UART3 J21 RS485 /dev/ttymxc2

UART2 on mezzanine connector J53[edit | edit source]

Please note that this UART is not available if WiFi/Bluetooth module is populated.

Processor's resource Connector Type Linux device file Notes
UART2 J53 4-wire LVTTL /dev/ttymxc1

Ethernet[edit | edit source]

Ethernet port is associated to eth0 interface. It can be managed with standard Linux commands. See for example http://www.tecmint.com/ifconfig-command-examples/.

GPIOs on mezzanine connector J53[edit | edit source]

Processor's resource Connector Type Linux virtual resource Notes
MX6UL_PAD_UART5_RX_DATA__GPIO1_IO31 J53 LVTTL GPIO GPIO #31 see following examples
MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 J53 LVTTL GPIO GPIO #30 see following examples
MX6UL_PAD_LCD_DATA19__GPIO3_IO24 J53 LVTTL GPIO GPIO #24 see following examples
MX6UL_PAD_LCD_DATA22__GPIO3_IO27 J53 LVTTL GPIO GPIO #27 see following examples
MX6UL_PAD_LCD_DATA23__GPIO3_IO28 J53 LVTTL GPIO GPIO #28 see following examples

Example #1[edit | edit source]

The following commands can be issued from command line in order to configure GPIO #30 as output:

echo 30 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio30/direction

To set the GPIO #30 to 0 logical value:

echo 0 > /sys/class/gpio/gpio30/value

To set the GPIO #30 to 1 logical value:

echo 1 > /sys/class/gpio/gpio30/value

Example #2[edit | edit source]

The following commands can be issued from command line in order to configure GPIO #30 as input:

echo 30 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio30/direction

To read the GPIO value:

cat /sys/class/gpio/gpio$i/value

microSD card[edit | edit source]

microSD card, if present, will be associated by the Linux kernel to the mmcblk0 device:

mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU08G 7.40 GiB
 mmcblk0: p1
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Once detected, it can be mounted and accessed via usual Linux commands:

root@sbc-lynx:~# mount /dev/mmcblk0p1 /mnt/mmcblk0p1/
root@sbc-lynx:~# time cp VirtualBox-5.0.14-105127-Win.exe /mnt/mmcblk0p1/

real    0m14.274s
user    0m0.020s
sys     0m4.640s
root@sbc-lynx:~# ls -la /mnt/mmcblk0p1/
total 114452
drwxrwx--- 3 root disk      4096 Apr  1 19:52 .
drwxr-xr-x 7 root root      4096 Jul 22  2016 ..
drwxrwx--- 2 root disk      4096 Jul 22  2016 System Volume Information
-rwxrwx--- 1 root disk 117185736 Apr  1 19:52 VirtualBox-5.0.14-105127-Win.exe
root@sbc-lynx:~# umount /mnt/mmcblk0p1/

WiFi/Bluetooth[edit | edit source]

Please refer to this page.

USB OTG[edit | edit source]

USB host[edit | edit source]

NOR and NAND flash[edit | edit source]

NOR and NAND flashes are managed as Memory_Tecnology_Device_(MTD) MTD devices.

Generally speaking, their partitioning is defined via Linux kernel command line. For instance this command line

mtdparts=gpmi-nand:8M(nand-uboot),1M(nand-env1),1M(nand-env2),1M(nand-fdt),1M(nand-spare),8M(nand-kernel),4M(nand-splash),-(nand-ubi);spi0.0:1M(spi-uboot),256k(spi-env1),256k(spi-env2),512k(spi-dtb),6M(spi-kernel),4M(spi-splash),-(spi-free)

defines these partitions:

root@sbc-lynx:~#  cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00020000 "nand-uboot"
mtd1: 00100000 00020000 "nand-env1"
mtd2: 00100000 00020000 "nand-env2"
mtd3: 00100000 00020000 "nand-fdt"
mtd4: 00100000 00020000 "nand-spare"
mtd5: 00800000 00020000 "nand-kernel"
mtd6: 00400000 00020000 "nand-splash"
mtd7: 3e800000 00020000 "nand-ubi"
mtd8: 00100000 00010000 "spi-uboot"
mtd9: 00040000 00010000 "spi-env1"
mtd10: 00040000 00010000 "spi-env2"
mtd11: 00080000 00010000 "spi-dtb"
mtd12: 00600000 00010000 "spi-kernel"
mtd13: 00400000 00010000 "spi-splash"
mtd14: 01400000 00010000 "spi-free"

ADCs[edit | edit source]

The following processor's signals are available on J54 mezzanine connector and can be configured as 12-bit ADC inputs:

  • GPIO1_IO01
  • GPIO1_IO02
  • GPIO1_IO03
  • GPIO1_IO04
  • GPIO1_IO05

To read the digital value of the converted analog voltage, issue the following command (the example refers to the GPIO1_IO05 pin):

cat /sys/bus/iio/devices/iio\:device0/in_voltage5_raw