From Technologic Systems Manuals
Jump to: navigation, search
TS-TPC-7990
ts-tpc-7990.gif
Product Page
Product Images
Specifications
Processor
NXP i.MX6 Quad core, or Solo
i.MX6 Quad Product Page
i.MX6 Solo Product Page
IMX6Q Reference Manual
IMX6S Reference Manual

Contents

1 Overview

The TS-TPC-7990 is a touch panel computer supporting either capacitive or resistive touch using the i.MX6 800 MHz Solo or 1 GHz Quad core CPU.

2 Getting Started

A Linux PC is recommended for development, and will be assumed for this documentation. For users in Windows or OSX we recommend virtualizing a Linux PC. Most of our platforms run Debian and if you have no other distribution preference this is what we recommend.

Virtualization

Suggested Linux Distributions

It may be possible to develop using a Windows or OSX system, but this is not supported. Development will include accessing drives formatted for Linux and often Linux based tools.

2.1 Getting Console and Powering up

WARNING: Be sure to take appropriate Electrostatic Discharge (ESD) precautions. Disconnect the power source before moving, cabling, or performing any set up procedures. Inappropriate handling may cause damage to the unit.

To get the initial console first connect a USB micro cable to the Console/P2 header near the bottom of the board, and connect the host cable to your workstation. This can be done before or after power is applied, but bringing up a serial connection before applying power will allow viewing of the first few console messages.

Most Linux distributions include the cp210x driver and will register this as /dev/ttyUSB0. For other operating systems:

The serial console is provided through this port at 115200 baud, 8n1, with no flow control. Picocom is the recommended client which can connect with:

sudo picocom -b 115200 /dev/ttyUSB0

This will output some serial settings and then "Terminal ready". Any messages after this will be from the unit itself. Now that the terminal is ready, power can be applied. The power input for the TS-TPC-7990 uses a removable terminal block which accepts 5 VDC, or 8-28 VDC input. Only one should be connected at a time.

A power supply should be prepared to provide 20 W, but the device power consumption will typically be around 8 W on an idle quad core. See the Specifications section for further details on power requirements, differences between build options, and options to reduce power.

Power connector

Console output should appear immediately after power input is applied. The first output is from U-Boot:

U-Boot 2015.04-07904-g87ba17a (Jan 23 2017 - 11:56:50)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
CPU:   Temperature 42 C
Reset cause: POR
Board: TS-TPC-7990 REV B
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected N25Q64 with page size 256 Bytes, erase size 4 KiB, total 8 MiB
auto-detected panel LXD-WSVGA
Display: LXD-WSVGA (1024x600)
In:    serial
Out:   serial
Err:   serial
FPGA Rev: 8
SilabRev: 2
Net:   using phy at 1
FEC [PRIME]
SF: Detected N25Q64 with page size 256 Bytes, erase size 4 KiB, total 8 MiB
SF: 7655 bytes @ 0x200000 Read: OK

Jumpers on the DIO header are used to influence where and how the system boots. When set, the "SD Boot" jumper will cause the unit to boot to SD, otherwise boot to eMMC. Setting the "U-Boot" jumper will cause the unit to check for USB updates on startup, and then stop at a U-Boot console. If it is not set then U-Boot will quickly boot to the selected boot media as fast as possible.

Note: The "*** Warning - bad CRC, using default environment" message is expected if the U-Boot scripts and/or environment variables have not been modified from factory defaults, and can be safely ignored. Using the U-Boot command 'env save' will save the current environment to flash, and cause this message to be removed.

2.2 First Linux Boot

U-Boot is loaded from the onboard SPI flash, which is the CPU boot source. U-Boot can boot to to Linux, Android, or other operating systems, from a variety of source mediums (most commonly SD or eMMC). The eMMC and SD cards shipped with the unit will be programmed with Debian Jessie. Other OS sections on this wiki can provide further guidance on switching to Yocto, Ubuntu, Android, or others.

[  OK  ] Started Serial Getty on ttymxc0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started SLiM Simple Login Manager.
[  OK  ] Created slice user-0.slice.
         Starting LSB: RPC portmapper replacement...
         Starting User Manager for UID 0...
[  OK  ] Started User Manager for UID 0.
[  OK  ] Started LSB: RPC portmapper replacement.
[  OK  ] Reached target RPC Port Mapper.
         Starting Authenticate and Authorize Users to Run Privileged Tasks...

Debian GNU/Linux 8 ts-imx6 ttymxc0

ts-imx6 login: 

By default the boot output is fairly verbose and includes kernel messages and Debian's startup messages from systemd. On the touch panel, Debian will by default boot to a minimal XFCE desktop. This is intended as an example to try out the display. In an actual shipping application this is typically disabled and only the applications specifically intended to run are given access to draw on the screen. See Starting automatically in Debian for more details.

Note: During development it is recommended to leave the verbose boot output on as these can help with debugging. The messages can be disabled by modifying the kernel cmdline for a quiet boot which will only print error messages.

The login prompt will ask for a username/password. Under Debian this is just "root" with no password which will allow the initial login. From here, development can continue as suggested in the Debian section of the manual.

2.3 Comparison of Distributions

We currently offer a Debian, Ubuntu, Yocto, and Android OS for the TS-TPC-7990. Each of these have their pros and cons. We typically recommend Debian if the user does not require GPU support, or Yocto if the goal is to use QT with remote debug support.

Distribution Pros Cons
Debian
  • Cross compiler requires running the same Debian release
  • Not conveniently patched for hardware support
    • No OpenGL or 2D acceleration from GPU, though framebuffer access is typically fast enough for most applications
Ubuntu
  • Cross compilation requires running the same Ubuntu release on a host PC
  • Not conveniently patched for hardware support
    • No OpenGL or 2D acceleration from GPU, though framebuffer access is typically fast enough for most applications
Yocto
  • Large focus on up-to-date packages
  • Allows rebuilding all packages with custom modifications
  • Supports fairly portable toolchain packages that integrate with QtCreator and Eclipse
  • Includes all patches needed for graphics support.
  • Distribution can be rebuilt to include specific needs.
  • Short life cycles
  • Does not support any online repository of pre-built applications. Adding packages requires rebuilding Yocto or building the required package manually.
  • Less examples and documentation available online
Android
  • Simple well defined API using well documented tools.
  • Allows existing apps to be run without huge customization
  • Under Android it is difficult to access hardware that is not typically on an Android tablet/phone such as UARTs, GPIO, ADC, etc. Often users write a standard application that communicates over a localhost socket to an Android application.
  • Slow boot time
  • Poor documentation for OS customization

3 U-Boot

This platform uses U-Boot as the bootloader to launch the full operating system. The i.MX6 processor loads U-Boot from the onboard 8MB SPI flash. U-Boot provides support for loading data from various mediums; this allows booting a kernel from SD, eMMC, SATA, NFS, or USB. U-Boot is a general purpose bootloader that is capable of booting into common Linux distributions, Android, Windows, or custom software OSes.

On a normal boot the output should be similar to the output below:

U-Boot 2015.04-07932-g68f7575230 (Apr 12 2017 - 10:16:39)

CPU:   Freescale i.MX6SOLO rev1.1 at 792 MHz
CPU:   Temperature 59 C
Reset cause: WDOG
Board: TS-TPC-7990 REV B
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected N25Q64 with page size 256 Bytes, erase size 4 KiB, total 8 MiB
auto-detected panel LXD-WSVGA
Display: LXD-WSVGA (1024x600)
In:    serial
Out:   serial
Err:   serial
FPGA Rev: 8
SilabRev: 6
Net:   using phy at 1
FEC [PRIME]
SF: Detected N25Q64 with page size 256 Bytes, erase size 4 KiB, total 8 MiB
SF: 7655 bytes @ 0x200000 Read: OK
Booting from eMMC ...

By default the unit will boot to SD or eMMC depending on the status of the SD boot jumper on startup. If the jumper is set it boots to SD, otherwise the unit will boot to eMMC. Other boot options like SATA, Network, USB, will require customizing the U-Boot environment.

3.1 U-Boot Environment

The SPI flash contains both the U-Boot executable binary and U-Boot environment. Our default build has 8KB of environment space which can be used for variables and boot scripts. The following commands are examples of how to manipulate the U-Boot environment:

# Print all environment variables
env print -a
 
# Sets the variable bootdelay to 5 seconds
env set bootdelay 5;
 
# Variables can also contain commands
env set hellocmd 'led red on; echo Hello world; led green on;'
 
# Execute commands saved in a variable
env run hellocmd;
 
# Commit env changes to the spi flash
# Otherwise changes are lost
env save
 
# Restore env to default
env default -a
 
# Remove a variable
env delete emmcboot

3.2 U-Boot Commands

# The most important command is 
help
# This can also be used to see more information on a specific command
help i2c
 
# This is a command added to u-boot by TS to read the baseboard id
bbdetect
echo ${baseboard} ${baseboardid} 
# The echos willreturn:
# TS-8390 2
 
# Boots into the binary at $loadaddr.  This file needs to have
# the uboot header from mkimage.  A uImage already contains this.
bootm
# Boots into the binary at $loadaddr, skips the initrd, specifies
# the fdtaddr so Linux knows where to find the board support
bootm ${loadaddr} - ${fdtaddr}
 
# Get a DHCP address
dhcp
# This sets ${ipaddr}, ${dnsip}, ${gatewayip}, ${netmask}
# and ${ip_dyn} which can be used to check if the dhcp was successful
 
# These commands are used for scripting:
false # do nothing, unsuccessfully
true # do nothing, successfully
 
# This command lets you set fuses in the processor
# Setting fuses can brick your board, will void your warranty,
# and should not be done in most cases
fuse
 
# GPIO can be manipulated from u-boot.  Keep in mind that the IOMUX 
# in u-boot is only setup enough to boot the board, so not all pins will
# be set to GPIO mode out of the box.  Boot to the full operating system
# for more GPIO support.
# GPIO are specified in bank, IO in the imx6 manual.  U-boot uses a flat numberspace,
# so for CN2_83/EIM_OE this is bank 2 dio 25, or (32*2)+25=89
# Set CN1_83 low
gpio clear 83
# Set CN1_83 high
gpio set 83
# Read CN1_83
gpio input 83
 
# Control LEDs
led red on
led green on
led all off
led red toggle
 
# This command is used to copy a file from most devices
# Load kernel from SD
load mmc 0:1 ${loadaddr} /boot/uImage
# Load Kernel from eMMC
load mmc 1:1 ${loadaddr} /boot/uImage
# Load kernel from USB
usb start
load usb 0:1 ${loadaddr} /boot/uImage
# Load kernel from SATA
sata init
load sata 0:1 ${loadaddr} /boot/uImage
 
# You can view the fdt from u-boot with fdt
load mmc 0:1 ${fdtaddr} /boot/imx6q-ts4900.dtb
fdt addr ${fdtaddr}
fdt print
 
# You can blindly jump into any memory
# This is similar to bootm, but it does not use the 
# u-boot header
load mmc 0:1 ${loadaddr} /boot/custombinary
go ${loadaddr}
 
# Browse fat,ext2,ext3,or ext4 filesystems:
ls mmc 0:1 /
 
# Access memory like devmem in Linux, you can read/write arbitrary memory
# using mw and md
# write
mw 0x10000000 0xc0ffee00 1
# read
md 0x10000000 1
 
# Test memory.
mtest
 
# Check for new SD card
mmc rescan
# Read SD card size
mmc dev 0
mmcinfo
# Read eMMC Size
mmc dev 1
mmcinfo
 
# The NFS command is like 'load', but used over the network
dhcp
env set serverip 192.168.0.11
nfs ${loadaddr} 192.168.0.11:/path/to/somefile
 
# Test ICMP
dhcp
ping 192.168.0.11
 
# Reboot
reset
 
# SPI access is through the SF command
# Be careful with sf commands since
# this is where u-boot and the FPGA bitstream exist
# Improper use can render the board unbootable
sf probe
 
# Delay in seconds
sleep 10
 
# You can load HUSH scripts that have been created with mkimage
load mmc 0:1 ${loadaddr} /boot/ubootscript
source ${loadaddr}
 
# Most commands have return values that can be used to test
# success, and HUSH scripting supports comparisons like
# test in Bash, but much more minimal
if load mmc 1:1 ${fdtaddr} /boot/uImage;
	then echo Loaded Kernel
else
	echo Could not find kernel
fi
 
# Commands can be timed with "time"
time sf probe
 
# Print U-boot version/build information
version

3.3 Modify Linux Kernel cmdline

The Linux kernel cmdline can be customized by modifying the cmdline_append variable. If new arguments are added, the existing value should also be included with the new arguments.

env set cmdline_append console=ttymxc0,115200 init=/sbin/init quiet
env save

The kernel command line can also be modified from from the onboard Linux. From the linux shell prompt run the following commands to install the necessary tools and create the script:

apt-get update && apt-get install u-boot-tools -y
echo "env set cmdline_append console=ttymxc0,115200 init=/sbin/init quiet" > /boot/boot.scr
mkimage -A arm -T script -C none -n 'tsimx6 boot script' -d /boot/boot.scr /boot/boot.ub

The boot.scr includes the plain text commands to be run in U-Boot on startup. The mkimage tool adds a checksum and header to this file which can be loaded by U-Boot. The .ub file should not be edited directly.

3.4 Linux NFS Boot

U-Boot includes support for NFS client which can be used to load the kernel, device tree binary, and root filesystem across the network. Our default environment contains the nfsboot command which can be updated to boot NFS on your network:

# Set this to your NFS server ip
env set nfsroot 192.168.0.36:/mnt/storage/imx6/
env save
# Boot to NFS once
run nfsboot;
 
# To make the NFS boot the persistent default
env set bootcmd run nfsboot;
env save

3.5 Linux USB Boot

On startup u-boot will attempt to boot to USB if the u-boot jumper is on. This can be use for reprogramming the board, or for booting. To make a bootable drive create a single ext3 partition on a USB drive and copy over your preferred rootfs just like you would with an SD card. This is described in the Debian and Yocto sections. Put on the U-Boot jumper on the board, and create the /tsinit.ub file in the root of the USB drive.

# Prepare with:
# mkimage -A arm -T script -C none -n 'mx6 usb' -d tsinit.scr tsinit.ub
 
# DO NOT MANUALLY EDIT THE .UB FILE
 
if test ${model} = '7990'; 
	if load usb ${bootpart} ${loadaddr} /boot/ts7990-fpga.vme; then
		fpga load 0 ${loadaddr} ${filesize};
	fi;
 
	if test ${pcbrev} != 'a'; then
		load usb ${bootpart} ${fdtaddr} /boot/imx6${cpu}-ts7990-${lcd}-revb.dtb;
	else
		load usb ${bootpart} ${fdtaddr} /boot/imx6${cpu}-ts7990-${lcd}.dtb;
	fi;
 
	load usb 0:1 ${loadaddr} ${uimage};
	setenv bootargs root=/dev/sda1 rootwait rw ${cmdline_append};
	bootm ${loadaddr} - ${fdtaddr};
fi
 
load usb 0:1 ${loadaddr} /boot/uImage;
setenv bootargs root=/dev/sda1 rootwait rw ${cmdline_append};
bootm ${loadaddr} - ${fdtaddr};

Then in the same directory generate the tsinit.ub file:

mkimage -A arm -T script -C none -n 'mx6 usb' -d tsinit.scr tsinit.ub

You may need to install u-boot-tools or the equivalent package for your distribution.

3.6 Update U-Boot

WARNING: Installing your own U-Boot binary is not recommended and may cause the unit to fail to boot.

U-Boot requires a different build for Quad/Dual and Solo/Duallite. Flashing the wrong U-Boot image will cause the board to fail to properly boot. Recovery in this case would require submitting an RMA request.

On a booted unit at the U-Boot console, type "env print ${imx_type}" and this will return the U-Boot build that should be used. Copy the correct u-boot.imx file to the SD card, boot to the U-Boot shell, and run:

mmc dev 0
load mmc 0:1 ${loadaddr} /u-boot.imx
sf probe
sf erase 0 0x80000
sf write ${loadaddr} 0x400 $filesize

3.7 U-Boot Development

We do provide our U-Boot sources but we do not recommend rebuilding a custom U-Boot if it can be avoided. The largest worry is that this CPU has a long lifetime which will outlast most RAM chips. If we have to change the RAM timing later in the product lifetime due to an EOL, die change, or any other change that may require new RAM configuration/timing changes, we will update this in our shipping U-Boot. If your application is using our stock U-Boot then these changes will happen without affecting your application. If you are using a custom built U-Boot you may need to rebuild to get the updated settings.

Our U-Boot includes a variable "imx_type". If you are loading a custom U-Boot binary, make sure you check the value of this before writing. If we are forced to update the RAM configuration we will change this variable. We will also send out a product change to anyone who is subscribed to our PCS system.

If you still need to proceed with building a custom U-Boot, use the master branch from the github here: https://github.com/embeddedarm/u-boot-imx/

On a booted unit at the U-Boot console, type "env print ${imx_type}" and this will return the U-Boot build that should be used and the correct RAM timing.

After that, adjust the following commands to match the build configuration; these commands will build the u-boot.imx binary.

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export DATE=$(date +"%b-%d-%Y")
 
make ts7990-s-1g-800mhz-i_defconfig
make -j9 u-boot.imx

This will output a u-boot.imx file that can be written to the SPI flash following the instructions in the update U-Boot section.

4 Yocto

Yocto is our recommended distribution for graphics packages as the software includes patches to support the GPU. X11 in Yocto includes drivers for providing 2D support as well. Support is also provided for OpenGLES 1&2, as well as GStreamer acceleration, included standalone or with Qt. Yocto also provides cross toolchains that include the rootfs. This toolchain allows integration with the Qt Creator IDE and Eclipse.

Yocto does not provide binary security updates. This distribution also does not have any remote repository of pre-built applications. For either of these we features we recommend using Debian.

Our current Yocto support is based off of Yocto 2.2 "Morty".

4.1 Getting Started with Yocto

Yocto itself is a set of scripts and tools used to build a custom Distribution. In our default images we try to include all the common utilities requested by users. Rebuilding Yocto should not be necessary for many users, but is possible if needed. Once installed the default user is "root" with no password.

Our Yocto rootfs is available here:

Yocto Download Links
Yocto Image Download Link
ts-x11-image Download

To write this to an SD card, first partition the SD card to have one large ext3 partition. See the guide here for more information. Once it is formatted, extract this tar with:

# Assuming your SD card is /dev/sdc with one partition
mkfs.ext3 /dev/sdc1
mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar --numeric-owner -jxf ts-x11-image-tsimx6-latest.rootfs.tar.bz2 -C /mnt/sd
sudo umount /mnt/sd
sync
Note: The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used. Older versions of e2fsprogs do not need these options passed.

To rewrite the eMMC, boot to the SD card. You cannot rewrite the eMMC while it is mounted elsewhere, or used to currently boot the system. Once booted to the SD, run:

mkfs.ext3 /dev/mmcblk2p1
mkdir /mnt/emmc
mount /dev/mmcblk2p1 /mnt/emmc
wget -qO- ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/\
ts-4900-linux/distributions/yocto/morty/ts-x11-image-tsimx6-\
latest.rootfs.tar.bz2 | tar --numeric-owner xj -C /mnt/emmc/
umount /mnt/emmc
sync

The same commands can be used to write SATA by substituting /dev/mmcblk2p1 with /dev/sda1.

4.2 Yocto Networking

Our Yocto image uses systemd which stores its network files in "/etc/systemd/network/". The simplest network config for a DHCP configuration would look like this:

In /etc/systemd/network/eth.network

[Match]
Name=eth*
 
[Network]
DHCP=yes

For a static configuration create a config file for that specific interface. /etc/systemd/network/eth0.network

[Match]
Name=eth0
 
[Network]
Address=192.168.0.50/24
Gateway=192.168.0.1
DNS=192.168.0.1

For more information on what options are available to configure the network, see the systemd network documentation.

4.2.1 Yocto Wireless

Yocto uses systemd to start wpa_supplicant, and systemd-networkd to set an IP address via a static setting or DHCP.

Scan for a network

ifconfig wlan0 up
 
# Scan for available networks
iwlist wlan0 scan

An example of connecting to an open network with an SSID of "default":

          Cell 03 - Address: c0:ff:ee:c0:ff:ee
                    Mode:Managed
                    ESSID:"default"
                    Channel:2
                    Encryption key:off
                    Bit Rates:9 Mb/s

To connect to this open network manually for just this boot:

iwconfig wlan0 essid "default"

Use the iwconfig command to determine authentication to an access point. Before connecting it will show something like this:

# iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"default"  
          Mode:Managed  Frequency:2.417 GHz  Access Point: c0:ff:ee:c0:ff:ee   
          Bit Rate=1 Mb/s   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-34 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

If connecting using WEP, also specify a network key:

iwconfig wlan0 essid "default" key "yourpassword"

If connecting to a WPA network use wpa_passphrase and wpa_supplicant:

mkdir /etc/wpa_supplicant/
wpa_passphrase "ssid name" "full passphrase" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

After generating the configuration file the wpa_supplicant daemon can be started.

wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -B

This will come back with:

 root@ts-imx6-q:~# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
 Successfully initialized wpa_supplicant
 root@ts-imx6-q:~# [  306.924691] wlan0: authenticate with 28:cf:da:b0:f5:bb
 [  306.959415] wlan0: send auth to 28:cf:da:b0:f5:bb (try 1/3)
 [  306.968137] wlan0: authenticated
 [  306.978477] wlan0: associate with 28:cf:da:b0:f5:bb (try 1/3)
 [  306.988577] wlan0: RX AssocResp from 28:cf:da:b0:f5:bb (capab=0x1431 status=0 aid=9)
 [  307.009751] wlan0: associated
 [  307.012768] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 [  307.047989] wlcore: Association completed.

Use "iwconfig wlan0" to verify an "Access Point" is specified to verify a connection. This will also report the link quality to the AP.

Wireless may be associated, but this does not get an IP on the network. To connect to the internet or talk to the internal network first configure the interface. See configuring the network, but on many networks only a DHCP client is needed:

udhcpc -i wlan0

Systemd can also be configured to start wpa_supplicant on boot up.

# Assuming the same path for the wpa conf file as shown above
systemctl enable wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0

Once this service is started it will bring up the wlan0 link and associate it to the SSID that is noted in the wpa_supplicant.conf file. Configure the IP settings the same way as a wired network.

In /etc/systemd/network/wlan0.network

[Match]
Name=wlan0
 
[Network]
DHCP=yes

For a static configuration create a config file for that specific interface. /etc/systemd/network/wlan0.network

[Match]
Name=wlan0
 
[Network]
Address=192.168.0.50/24
Gateway=192.168.0.1
DNS=192.168.0.1

For more information on what options are available to configure the network, see the systemd network documentation.

4.3 Yocto Application Development

Yocto provides cross toolchains including the native tools and required arm files. First get the toolchain by right clicking and "Save as":

In the case of either toolchain you would run these commands to install them:

chmod a+x poky-*.sh
sudo ./poky-*.sh

To build an application first source the environment for the toolchain:

source /opt/poky/2.2.2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
 
# Assuming you have a hello.c:
$CC hello.c -o hello
 
#If you cat the environment file you can see all the paths this sets up.
$ echo $CC
arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/opt/poky/2.2.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi

It is also possible to develop over the serial console or ssh on the board itself. Yocto includes development tools such as vim, gcc, g++, gdb, make, autoconf, binutils, and more. See the next sections for using the cross toolchain with IDEs.

4.3.1 Configure Qt Creator IDE

Note: This guide is intended for our stock Yocto image using systemd. On custom images the directions should apply if a toolchain is compiled. "bitbake meta-toolchain-qt5", and update the paths if you are using a different distribution.


Install the qtcreator tool on a host Linux PC. Any recent version from a modern Linux distribution should be sufficient and work without issue. On a Debian/Ubuntu desktop, run:

sudo apt-get update && sudo apt-get install qtcreator -y

You will also need to download the SDK which includes the Qt support (Right click and save as):

You can install these with:

sudo bash ./poky-*.sh

These instructions assume the path will be default at "/opt/poky/2.2.2/".


Note: An environment script has to be sourced before every execution of qtcreator. Without this, builds will fail.
source /opt/poky/2.2.2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
qtcreator


Qt Creator needs to be configured to build using this toolchain. Once Qt Creator is launched, select Tools->Options->Devices. Click "Add," select "Generic Linux Device," and then click "Start Wizard".

Qt Device Configuration

On the next page specify the IP address or hostname of the device running Yocto. In this example, the unit has an IP address of 192.168.2.45 obtained by DHCP. The default Yocto image will use "root" with no password to connect. Set the name to TSIMX6.

Qt Device Configuration

It will then verify connectivity. Click close and continue.

Qt Device Test
Note: If this returns an error: "SSH connection failure: SSH Protocol error: Server and client capabilities don't match. Client list was: aes128-cbc,3des-cbc.

Server list was chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com.". If this happens connect to the board's console and edit /etc/ssh/sshd_config and append the line "Ciphers +aes128-cbc". Reset sshd, or reboot the board and try again. Upgrading Qt Creator may also resolve this issue.

Note: The paths given in the images may not match the latest toolchain, but are meant to show where these values would go. Follow the text appropriate to the architecture of your host PC for the correct values


In the left column of the Options menu, select "Build & Run". On the "Qt Versions" tab, click "Add" in the upper right to configure the TS Kit. Qt Creator may see the "qmake" binary added to your path from the sourced environment script. If this is detected add in the string "TSIMX6" to the title. If not, add the full path and ensure the version name is set to "TSIMX6 QT 5.7.1". This will allow it to be recognized when setting the right binary for the kit.

i686
/opt/poky/2.2.2/sysroots/x86-pokysdk-linux/usr/bin/qt5/qmake
x86_64
/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
Qt Versions tab


On the "Compilers" tab click "Add", and select "GCC". Set the Name to "TSIMX6 GCC". For the "Compiler Path" use one of the following:

i686
/opt/poky/2.2.2/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
x86_64
/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
Qt Compiler tab

On the "Debuggers" tab click "Add". For name, specify "TSIMX6 GDB". For the paths, specify the location of gdb with one of the following:

i686
/opt/poky/2.2.2/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
x86_64
/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
Qt Debugger tab

On the "Kits" tab click "Add". For "Name", enter "TSIMX6". Set device type to "Generic Linux Device". Set the device to "TSIMX6 (default for Generic Linux)". Set Qt mkspec to:

/opt/poky/2.2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++

Make sure there is no space at the end.

Set "Compiler" to "TSIMX6 GCC". Set "Debugger" to "TSIMX6 GDB". Set the "Qt version" to "TSIMX6 QT 5.7.1". Finally, click Apply.

Qt Kit tab
Note: If there is a red exclamation point over the kits icon, it indicates that the compiler ABI does not match. In this case, you will need to revisit the "Compiler", "Debugger", and "Qt Versions" tabs, and browse the host PC for these files manually rather than copy/pasting the paths from these instructions. This is a bug in Ubuntu 16.04's Qt Creator, and may be in later versions as well.

At this point Qt Creator is set up to begin a hello world project.

4.3.1.1 Qt Creator Hello World

Open the Qt Creator IDE and click "New Project".

Qt New Project

Qt provides multiple templates for application development. For this example select the default "Qt Widgets Application".

Qt Widgets App

Specify the location for your project. Keep in mind that the compile process will create more build paths in the "Create In:" path.

Qt Location

Next, select the kit. The TSIMX6 is the kit we set up in the last section, but you may have other kits preinstalled on your system. These can be used for testing graphical development on your PC. Keep in mind distribution versions may contain different functionality.

Qt Select Kit

Next select the class and filename information. This example will use the defaults.

Qt Select Classes

Select any version control for the project. The example will use none and finish the wizard. This will generate the new project.

Qt Project Management

Click the button under "Help" on the left column, and select "TSIMX6" debug. If you only have one kit selected this will be default.

Qt Select build

Now return to edit, and open the Qt project file (qt5-helloworld.pro). Add in these lines anywhere after the target is specified:

linux-* {
    target.path = /home/root/
    INSTALLS += target
}
Qt pro file

At this point click the green allow in the bottom left to run the application. This can also be launched from the menu at Build->Run.

Qt Build and Deploy

From here, you can begin customizing your application. Refer to the official Qt documentation for more information

4.3.2 Yocto Hide Cursor

The default image includes the xcursor-transparent icon theme. This can hide the mouse pointer. To enable this, run these commands:

mkdir -p ~/.icons/default/
 
echo "[Icon Theme]" > ~/.icons/default/index.theme
echo "Inherits=xcursor-transparent" >> ~/.icons/default/index.theme
 
# Now reset x, or reset the unit and the cursor will be invisible.

4.4 Yocto Startup Scripts

To have a custom headless application start up at boot a systemd service needs to be created. Create the file /etc/systemd/system/yourapp.service with contents similar to below:

[Unit]
Description=Run an application on the i.MX6
 
[Service]
Type=simple
ExecStart=/usr/local/bin/your_app_or_script
 
[Install]
WantedBy=multi-user.target

If you depend on networking you should add "After=network.target" in the Unit section. Once this file is in place, it cab be added to automatic startup with the following:

# Start your app on bootup, but will not start it now
systemctl enable yourapp.service
 
# Start your app now, but doesn't change auto startup
systemctl start yourapp.service
Note: See the systemd documentation for in depth documentation on services.

To set up a graphical application startup, change the file: /usr/bin/mini-x-session

At the end of the script replace "matchbox-terminal" with your application (absolute path may need to be specified):

matchbox-terminal&
exec matchbox-window-manager

The exec statement must be last in the script in order to take over this script's PID for correct operation.

4.5 Custom Build Yocto

If our stock Yocto distribution does not meet all of your needs, it is possible to re-build it with a custom set of features. Including less options for a smaller footprint, or more packages to add more features.

While we may provide guidance, our free support does not include every situation that can cause a build failure in generating custom images.

5 Debian

Debian is a community run Linux distribution. Debian provides tens of thousands of precompiled applications and services. This distribution is known for stability and large community providing support and documentation. This distribution does not include the same support as Yocto for the GPU. OpenGL ES, Gstreamer, or OpenCL are not supported in Debian. The framebuffer is supported so 2D applications will still run well. Debian is also very well suited for headless applications.

5.1 Getting Started with Debian

Once installed the default user is "root" with no password.

Note: This is a shared image that supports the TS-4900, TS-7970, and TS-TPC-7990.


To prepare an SD card, use partitioning tools such as 'fdisk' 'cfdisk' or 'gparted' in linux to create a single linux partition on the SD card. See the guide here for more information. Once it is formatted, extract the above tarball with:

# Assuming your SD card is /dev/sdc with one partition
mkfs.ext3 /dev/sdc1
mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar --numeric-owner -xjf debian-armhf-jessie-latest.tar.bz2 -C /mnt/sd
sudo umount /mnt/sd
sync
Note: The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used. Older versions of e2fsprogs do not need these options passed.

To rewrite the eMMC the unit must be booted to SD or any other media that is not eMMC. Once booted, run the following commands.:

mkfs.ext3 /dev/mmcblk2p1
mkdir /mnt/emmc
mount /dev/mmcblk2p1 /mnt/emmc
wget -qO- ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/debian/debian-armhf-jessie-latest.tar.bz2 | tar xj -C /mnt/emmc/
umount /mnt/emmc
sync


The same commands can be used to write a SATA drive by substituting /dev/mmcblk2p1 with /dev/sda1.

5.2 Debian Networking

From almost any Linux system you can use 'ip' command or the 'ifconfig' and 'route' commands to initially set up the network.

# Bring up the CPU network interface
ifconfig eth0 up
 
# Or if you're on a baseboard with a second ethernet port, you can use that as:
ifconfig eth1 up
 
# Set an ip address (assumes 255.255.255.0 subnet mask)
ifconfig eth0 192.168.0.50
 
# Set a specific subnet
ifconfig eth0 192.168.0.50 netmask 255.255.0.0
 
# Configure your route.  This is the server that provides your internet connection.
route add default gw 192.168.0.1
 
# Edit /etc/resolv.conf for your DNS server
echo "nameserver 192.168.0.1" > /etc/resolv.conf

Most networks will offer a DHCP server, an IP address can be obtained from a server with a single command in linux:

Configure DHCP in Debian:

# To setup the default CPU ethernet port
dhclient eth0
# Or if you're on a baseboard with a second ethernet port, you can use that as:
dhclient eth1
# You can configure all ethernet ports for a dhcp response with
dhclient


Systemd provides a networking configuration option to allow for automatic configuration on startup. Systemd-networkd has a number of different configuration files, some of the default examples and setup steps are outlined below.

/etc/systemd/network/eth.network

[Match]
Name=eth*
 
[Network]
DHCP=yes

To use DHCP to configure DNS via systemd, start and enable the network name resolver service, systemd-resolved:

systemctl start systemd-resolved.service 
systemctl enable systemd-resolved.service
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf


For a static config create a network configuration for that specific interface.

/etc/systemd/network/eth0.network

[Match]
Name=eth0
 
[Network]
Address=192.168.0.50/24
Gateway=192.168.0.1
DNS=192.168.0.1

For more information on networking, see Debian and systemd's documentation:

5.2.1 Debian WIFI Client

If connecting to a WPA/WPA2 network, a wpa_supplicant config file must first be created:

wpa_passphrase yournetwork yournetworkpassphrase > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf


Create the file /lib/systemd/system/wpa_supplicant@.service with these contents

[Unit]
Description=WPA supplicant daemon (interface-specific version)
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
 
[Service]
Type=simple
ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
 
[Install]
Alias=multi-user.target.wants/wpa_supplicant@%i.service


Next, enable the service to start up on boot:

systemctl enable wpa_supplicant@wlan0


Create the file /etc/systemd/network/wlan0.network with:

[Match]
Name=wlan0
 
[Network]
DHCP=yes


See the systemctl-networkd example for setting a static IP for a network interface. The wlan0.network can be configured the same way as an eth.network. To enable all of the changes that have been made, run the following commands:

systemctl enable wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0
systemctl restart systemd-networkd

5.2.2 Debian WIFI Access Point

First, hostapd needs to be installed in order to manage the access point on the device:

apt-get update && apt-get install hostapd -y

Note: The install process will start an unconfigured hostapd process. This process must be killed and restarted before a new hostapd.conf will take effect.

Edit /etc/hostapd/hostapd.conf to include the following lines:

interface=wlan0
driver=nl80211
ssid=YourAPName
channel=1
Note: Refer to the kernel's hostapd documentation for more wireless configuration options.


To start the access point launch hostapd:

hostapd /etc/hostapd/hostapd.conf &

This will start up an access point that can be detected by WIFI clients. A DHCP server will likely be desired to assign IP addresses. Refer to Debian's documentation for more details on DHCP configuration.

5.3 Debian Application Development

5.3.1 Debian Jessie Cross Compiling

Debian Jessie provides cross compilers from its distribution. An install on a workstation can build for the same release on other architectures. A PC, virtual machine, or chroot will need to be used for this. Install Debian Jessie for your workstation here.

From a Debian workstation (not the target), run these commands to set up the cross compiler:

# Run "lsb_release -a" and verify Debian 8.X is returned.  These instructions are not
# expected to work on any other version or distribution.
 
apt-get install curl build-essential
 
su root
echo "deb http://emdebian.org/tools/debian jessie main" > /etc/apt/sources.list.d/emdebian.list
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
# Note that while Ubuntu uses apt as well, Ubuntu host setup is slightly different, instead of the above commands use the following:
# echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports trusty main restricted universe multiverse" >> /etc/apt/sources.list
# echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list
# echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports trusty-security main restricted universe multiverse" >> /etc/apt/sources.list
dpkg --add-architecture armhf
apt-get update
apt-get install crossbuild-essential-armhf

This will install a toolchain that can be used with the prefix "arm-linux-gnueabihf-". The standard GCC tools will start with that name, eg "arm-linux-gnueabihf-gcc".

The toolchain can now compile a simple hello world application. Create hello-world.c on the Debian workstation:

#include <stdio.h>
int main(){
    printf("Hello World\n");
}

To compile this:

arm-linux-gnueabihf-gcc hello-world.c -o hello-world
file hello-world

This will return that the binary created is for ARM. Copy this to the target platform to run it there.

Debian Jessie supports multiarch which can install packages designed for other architectures. On workstations this is how 32-bit and 64-bit support is provided. This can also be used to install armhf packages on an x86 based workstation.

This cross compile environment can link to a shared library from the Debian root. The package would be installed in Debian on the workstation to provide headers and .so. This is included in most "-dev" packages. When run on the arm target it will also need a copy of the library installed, but it does not need the -dev package.

apt-get install libcurl4-openssl-dev:armhf
 
# Download the simple.c example from curl:
wget https://raw.githubusercontent.com/bagder/curl/master/docs/examples/simple.c
# After installing the supporting library, curl will link as compiling on the unit.
arm-linux-gnueabihf-gcc simple.c -o simple -lcurl

Copy the binary to the target platform and run on the target. This can be accomplished with network protocols like NFS, SCP, FTP, etc.

If any created binaries do not rely on hardware support like GPIO or CAN, they can be run using qemu.

# using the hello world example from before:
./hello-world
# Returns Exec format error
apt-get install qemu-user-static
./hello-world

5.4 Debian Installing New Software

Debian provides the apt-get system which allows management of pre-built applications. First apt will need a network connection to the internet. The update command will download a list of prebuilt packages and the current version.

Debian provides the apt-get system which lets you manage pre-built applications. Before you do this you need to update Debian's list of package versions and locations. This assumes you have a valid network connection to the internet.

apt-get update

A common example is installing Java runtime support for a system. Find the package name first with search, and then install it.

root@ts:~# apt-cache search openjdk
jvm-7-avian-jre - lightweight virtual machine using the OpenJDK class library
freemind - Java Program for creating and viewing Mindmaps
icedtea-7-plugin - web browser plugin based on OpenJDK and IcedTea to execute Java applets
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
jtreg - Regression Test Harness for the OpenJDK platform
libreoffice - office productivity suite (metapackage)
icedtea-7-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
openjdk-7-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-7-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-7-doc - OpenJDK Development Kit (JDK) documentation
openjdk-7-jdk - OpenJDK Development Kit (JDK)
openjdk-7-jre - OpenJDK Java runtime, using Hotspot Zero
openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot Zero (headless)
openjdk-7-jre-lib - OpenJDK Java runtime (architecture independent libraries)
openjdk-7-source - OpenJDK Development Kit (JDK) source files
uwsgi-app-integration-plugins - plugins for integration of uWSGI and application
uwsgi-plugin-jvm-openjdk-7 - Java plugin for uWSGI (OpenJDK 7)
uwsgi-plugin-jwsgi-openjdk-7 - JWSGI plugin for uWSGI (OpenJDK 7)
                                                       

In this case you will want the openjdk-7-jre package. Names of packages are on Debian's wiki or the packages site.

With the package name apt-get install can be used to install the prebuilt packages.

apt-get install openjdk-7-jre
# More than one package can be installed at a time.
apt-get install openjdk-7-jre nano vim mplayer

For more information on using apt-get refer to Debian's documentation here.

5.5 Debian Setting up SSH

To install ssh, install the package as normal with apt-get:

apt-get install openssh-server

Make sure the device is configured on the network, and set a password for your remote user. SSH will not allow remote connections without a password or a shared key.

passwd root

After this setup it is now possible to connect from a remote PC supporting SSH. On Linux/OS X this is the "ssh" command, or from Windows using a client such as putty.

Note: If a DNS server is not present on the target network, it is possible to save time at login by adding "UseDNS no" in /etc/ssh/sshd_config.

5.6 Debian Starting Automatically

A systemd service can be created to start up headless applications. Create a file in /etc/systemd/system/yourapp.service

[Unit]
Description=Run an application on startup
 
[Service]
Type=simple
ExecStart=/usr/local/bin/your_app_or_script
 
[Install]
WantedBy=multi-user.target

If networking is a dependency add "After=network.target" in the Unit section. Once you have this file in place add it to startup with:

# Start the app on startup, but will not start it now
systemctl enable yourapp.service
 
# Start the app now, but doesn't change auto startup
systemctl start yourapp.service
Note: See the systemd documentation for in depth documentation on services.

To start an application on bootup with X11 instead change the x-session-manager. By default the system starts xfce:

root@ts:~# ls -lah /usr/bin/x-session-manager 
lrwxrwxrwx 1 root root 35 May 26  2015 /usr/bin/x-session-manager -> /etc/alternatives/x-session-manager
root@ts:~# ls -lah /etc/alternatives/x-session-manager
lrwxrwxrwx 1 root root 19 May 26  2015 /etc/alternatives/x-session-manager -> /usr/bin/startxfce4

The x-session can be modified to only start specified processes. Create the file /usr/bin/mini-x-session with these contents:

#!/bin/bash
matchbox-window-manager -use_titlebar no &
 
exec xfce4-terminal

You may need to "apt-get install matchbox-window-manager." first. This is a tiny window manager which also has a few flags that simplify embedded use. Now enable this session manager and restart slim to restart x11 and show it now.

chmod a+x /usr/bin/mini-x-session
rm /etc/alternatives/x-session-manager
ln -s /usr/bin/mini-x-session /etc/alternatives/x-session-manager
service slim restart

If the x-session-manager process ever closes x11 will restart. The exec command allows a new process to take over the existing PID. In the above example xfce4-terminal takes over the PID of x-session-manager. If the terminal is closed with commands like exit the slim/x11 processes will restart.

6 Ubuntu

Ubuntu is a distribution provided by Canonical which is based on Debian. Ubuntu often has more recent packages but follows a shorter release cycle. The image we provide is based on Ubuntu. We use the root filesystem, but the kernel is not provided by Ubuntu or in any way associated with Canonical. Our Kernel is based on the imx_4.1.15_1.0.0_ga release from git.freescale.com. This is patched to provide support for our boards and peripherals.

This image includes support for the TS-4900, TS-7970, and TS-TPC-7990.

6.1 Getting Started with Ubuntu

The latest release is available here:

The login is either "root" with no password, or username "ubuntu" with the password "ubuntu". The ubuntu user is allowed to run sudo.

To write this to an SD card, first partition the SD card to have one large ext3, or ext4 partition. See the guide here for more information. Once it is formatted, extract this tar with:

# Assuming your SD card is /dev/sdc with one partition
mkfs.ext3 /dev/sdc1
mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar --numeric-owner -xjf ubuntu-armhf-16.04-latest.tar.bz2 -C /mnt/sd
sudo umount /mnt/sd
sync

To rewrite the eMMC, boot to the SD card. You cannot rewrite the emmc while it is mounted elsewhere, or used to currently boot the system. Once booted to the SD, run:

mkfs.ext3 /dev/mmcblk2p1
mkdir /mnt/emmc
mount /dev/mmcblk2p1 /mnt/emmc
wget -qO- ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/ubuntu/ubuntu-armhf-16.04-latest.tar.bz2 | tar --numeric-owner -xj -C /mnt/emmc/
umount /mnt/emmc
sync


Note: The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used. Older versions of e2fsprogs do not need these options passed.

6.2 Ubuntu Networking

From almost any Linux system you can use "ip" or the ifconfig/route commands to set up the network.

# Bring up the CPU network interface
ifconfig eth0 up
 
# Or if you're on a baseboard with a second ethernet port, you can use that as:
ifconfig eth1 up
 
# Set an ip address (assumes 255.255.255.0 subnet mask)
ifconfig eth0 192.168.0.50
 
# Set a specific subnet
ifconfig eth0 192.168.0.50 netmask 255.255.0.0
 
# Configure your route.  This is the server that provides your internet connection.
route add default gw 192.168.0.1
 
# Edit /etc/resolv.conf for your DNS server
echo "nameserver 192.168.0.1" > /etc/resolv.conf

Most networks will offer DHCP which can be set up with one command:

# To setup the default CPU ethernet port
dhclient eth0
# Or if you're on a baseboard with a second ethernet port, you can use that as:
dhclient eth1
# You can configure all ethernet ports for a dhcp response with
dhclient

To make DHCP run on startup systemd's networking will need to be configured.

In /etc/systemd/network/eth.network

[Match]
Name=eth*
 
[Network]
DHCP=yes

Then, if you intend to use DHCP to configure your DNS, start and enable the network name resolver service:

systemctl start systemd-resolved.service 
systemctl enable systemd-resolved.service
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

For a static configuration create a config file for that specific interface. /etc/systemd/network/eth0.network

[Match]
Name=eth0
 
[Network]
Address=192.168.0.50/24
Gateway=192.168.0.1
DNS=192.168.0.1

For more information on networking, see Ubuntu and systemd's documentation:

6.2.1 Ubuntu WIFI Client

If connecting to a WPA/WPA2 network, a wpa_supplicant config file must first be created:

wpa_passphrase yournetwork yournetworkpassphrase > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf


Create the file /lib/systemd/system/wpa_supplicant@.service with these contents

[Unit]
Description=WPA supplicant daemon (interface-specific version)
Requires=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
 
[Service]
Type=simple
ExecStart=/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I
 
[Install]
Alias=multi-user.target.wants/wpa_supplicant@%i.service


Next, enable the service to start up on boot:

systemctl enable wpa_supplicant@wlan0


Create the file /etc/systemd/network/wlan0.network with:

[Match]
Name=wlan0
 
[Network]
DHCP=yes

Enable networkd to run dhcp on startup:

systemctl enable systemd-networkd

See the systemctl-networkd example for setting a static IP for a network interface. The wlan0.network can be configured the same way as an eth.network. To enable all of the changes that have been made, run the following commands:

systemctl enable wpa_supplicant@wlan0
systemctl start wpa_supplicant@wlan0
systemctl restart systemd-networkd

6.2.2 Ubuntu WIFI Access Point

First, hostapd needs to be installed in order to manage the access point on the device:

apt-get update && apt-get install hostapd -y

Note: The install process will start an unconfigured hostapd process. This process must be killed and restarted before a new hostapd.conf will take effect.

Edit /etc/hostapd/hostapd.conf to include the following lines:

interface=wlan0
driver=nl80211
ssid=YourAPName
channel=1
Note: Refer to the kernel's hostapd documentation for more wireless configuration options.


To start the access point launch hostapd:

hostapd /etc/hostapd/hostapd.conf &

This will start up an access point that can be detected by WIFI clients. A DHCP server will likely be desired to assign IP addresses. Refer to Debian's documentation for more details on DHCP configuration.

6.3 Ubuntu Installing New Software

Ubuntu provides the apt-get system which lets you manage pre-built applications. Before you do this you need to update Ubuntu's list of package versions and locations. This assumes you have a valid network connection to the internet.

apt-get update

For example, lets say you wanted to install openjdk for Java support. You can use the apt-cache command to search the local cache of Debian's packages.

root@ts-imx6:~# apt-cache search openjdk
jvm-7-avian-jre - lightweight virtual machine using the OpenJDK class library
freemind - Java Program for creating and viewing Mindmaps
icedtea-7-plugin - web browser plugin based on OpenJDK and IcedTea to execute Java applets
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
jtreg - Regression Test Harness for the OpenJDK platform
libreoffice - office productivity suite (metapackage)
icedtea-7-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
openjdk-7-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-7-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-7-doc - OpenJDK Development Kit (JDK) documentation
openjdk-7-jdk - OpenJDK Development Kit (JDK)
openjdk-7-jre - OpenJDK Java runtime, using Hotspot Zero
openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot Zero (headless)
openjdk-7-jre-lib - OpenJDK Java runtime (architecture independent libraries)
openjdk-7-source - OpenJDK Development Kit (JDK) source files
uwsgi-app-integration-plugins - plugins for integration of uWSGI and application
uwsgi-plugin-jvm-openjdk-7 - Java plugin for uWSGI (OpenJDK 7)
uwsgi-plugin-jwsgi-openjdk-7 - JWSGI plugin for uWSGI (OpenJDK 7)
                                                       

In this case you will likely want openjdk-7-jre to provide a runtime environment, and possibly openjdk-7-jdk to provide a development environment.

Once you have the package name you can use apt-get to install the package and any dependencies. This assumes you have a network connection to the internet.

apt-get install openjdk-7-jre
# You can also chain packages to be installed
apt-get install openjdk-7-jre nano vim mplayer

For more information on using apt-get refer to Ubuntu's documentation here.

6.4 Ubuntu Setting up SSH

To install ssh, install the package as normal with apt-get:

apt-get install openssh-server

Make sure your board is configured properly on the network, and set a password for your remote user. SSH will not allow remote connections without a password or a shared key.

passwd root

You should now be able to connect from a remote Linux or OSX system using "ssh" or from Windows using a client such as putty.

6.5 Ubuntu Starting Automatically

A systemd service can be created to start up headless applications. Create a file in /etc/systemd/system/yourapp.service

[Unit]
Description=Run an application on startup
 
[Service]
Type=simple
ExecStart=/usr/local/bin/your_app_or_script
 
[Install]
WantedBy=multi-user.target

If networking is a dependency add "After=network.target" in the Unit section. Once you have this file in place add it to startup with:

# Start the app on startup, but will not start it now
systemctl enable yourapp.service
 
# Start the app now, but doesn't change auto startup
systemctl start yourapp.service
Note: See the systemd documentation for in depth documentation on services.

To start an application on bootup with X11 instead change the x-session-manager. By default the system starts xfce:

root@ts:~# ls -lah /usr/bin/x-session-manager 
lrwxrwxrwx 1 root root 35 May 26  2015 /usr/bin/x-session-manager -> /etc/alternatives/x-session-manager
root@ts:~# ls -lah /etc/alternatives/x-session-manager
lrwxrwxrwx 1 root root 19 May 26  2015 /etc/alternatives/x-session-manager -> /usr/bin/startxfce4

The x-session can be modified to only start specified processes. Create the file /usr/bin/mini-x-session with these contents:

#!/bin/bash
matchbox-window-manager -use_titlebar no &
 
exec xfce4-terminal

You may need to "apt-get install matchbox-window-manager." first. This is a tiny window manager which also has a few flags that simplify embedded use. Now enable this session manager and restart slim to restart x11 and show it now.

chmod a+x /usr/bin/mini-x-session
rm /etc/alternatives/x-session-manager
ln -s /usr/bin/mini-x-session /etc/alternatives/x-session-manager
service slim restart

If the x-session-manager process ever closes x11 will restart. The exec command allows a new process to take over the existing PID. In the above example xfce4-terminal takes over the PID of x-session-manager. If the terminal is closed with commands like exit the slim/x11 processes will restart.

7 Android

This Android distribution is based off of Freescale's port of AOSP to the i.MX6 platform. This allows users to run existing APKs to use this platform with no modifications, or develop new projects using Android Studio.

7.1 Getting Started with Android

Android must be run from the eMMC. This can be written with the USB production tool, or from the SD card. To use the USB drive, follow the instructions here, and download the image and copy it to the USB drive as emmcimage.dd.bz2.

Download the Android image here:

To load from the SD card, boot up to any Linux distribution from the SD card such as the default Debian. Once booted here, run:

wget -qO- ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7990-linux\
/distributions/android/android-7.1.1-tsimx6-atmelwifi-\
latest.dd.bz2 | bzcat | dd bs=4M of=/dev/mmcblk2 conv=fsync

This will download it, decompress it, and write it to the eMMC drive. Reboot and boot into Android.

7.2 Android Networking

Android supports networking through the integrated Atmel WIFI chipset, or through the ethernet port on the left side of the screen (eth0). This Ethernet interface will always grab DHCP by default if connected.

7.3 Android Software Development

AOSP development works exactly the same as on an Android phone, except the Google APIs associated with the store are not available. See The android documentation for getting started on development: http://developer.android.com/training/basics/firstapp/index.html

7.4 Android Install APK

Connect to the ADB USB on the TS-TPC-7990 by pluging a MicroUSB into P1/OTG.

APKs can be installed just like on any other Android device. On the device go to settings->About Tablet and press the "build number" until the text states "You are now a developer". Go back to Settings and there is now a "Developer Options" menu. Under Debugging enable USB Debugging. You should now be able to run adb commands to install apk files.

adb install </path/to/app.apk>

8 Backup / Restore

8.1 MicroSD Card

These instructions assume you have an SD card with one partition. Most SD cards ship this way by default. If the card has had its partition table modified this can be corrected with a tool like 'gparted' or 'fdisk'.

Plug the SD card into a USB reader and connect it to a linux workstation PC. Newer distributions include a utility called 'lsblk' which lists all block devices like a USB SD card reader:

lsblk
 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
 sdY      8:0    0   400G  0 disk 
 ├─sdY1   8:1    0   398G  0 part /
 ├─sdY2   8:2    0     1K  0 part 
 └─sdY5   8:5    0     2G  0 part [SWAP]
 sr0     11:0    1  1024M  0 rom  
 sdX      8:32   1   3.9G  0 disk 
 ├─sdX1   8:33   1   7.9M  0 part 
 ├─sdX2   8:34   1     2M  0 part 
 ├─sdX3   8:35   1     2M  0 part 
 └─sdX4   8:36   1   3.8G  0 part  

In this case the SD card is 4GB, so sdX is the target device. Note that on your system, sdX will not be a real device, it could be sda, sdb, mmcblk0, etc. Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card.

After plugging in the device after Linux has booted you can use dmesg to print out the kernel log. When the USB drive is added it will append to the end of that file. Try running:

dmesg | tail -n 100
 scsi 54:0:0:0: Direct-Access     Generic  Storage Device   0.00 PQ: 0 ANSI: 2
 sd 54:0:0:0: Attached scsi generic sg2 type 0
 sd 54:0:0:0: [sdX] 3862528 512-byte logical blocks: (3.97 GB/3.84 GiB)

In this case, sdXc is shown as a 3.97GB card. Note that on your system, sdX will not be a real device, it could be sda, sdb, mmcblk0, etc. Technologic Systems is not responsible for any damages cause by using the improper device node for imaging an SD card.

The following commands will reformat the first partition of the SD card, and unpack the latest filesystem on there:

# Verify nothing else has this mounted
sudo umount /dev/sdX1
 
sudo mkfs.ext3 /dev/sdX1
sudo mkdir /mnt/sd
sudo mount /dev/sdX1 /mnt/sd/
wget ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7990-linux/distributions/yocto/morty/ts-x11-image-tsimx6-latest.rootfs.tar.bz2
 
sudo tar -xf ts-x11-image-tsimx6-latest.rootfs.tar.bz2 -C /mnt/sd
sudo umount /mnt/sd
sync
Note: The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used. Older versions of e2fsprogs do not need these options passed.

Once written, the files on disk can be verified to ensure they are the same as the source files in the archive. Reinsert the disk to flush the block cache completely, then run the following commands:

mount /dev/sdX1 /mnt/sd
cd /mnt/sd/
sudo md5sum --quiet -c md5sums.txt
cd -
umount /mnt/sd
sync

The md5sum command will report what differences there are, if any, and return if it passed or failed.

8.2 eMMC

Pick the latest image to restore to here:

The simplest way to backup/restore the eMMC is through u-boot. If you boot up with JP2 connected and stop in u-boot you can run this command:

ums 0 mmc 1

Now plug in the P1 USB port and this will make the board act as a USB mass storage device with direct access to the eMMC disk. On a linux workstation, to backup the image:

dmesg | tail -n 30
# Look for the last /dev/sd* device connected.  This should also match the eMMC
# size of around 3.78GiB.  On my system, this is /dev/sdd.
sudo mkdir /mnt/emmc/
sudo mount /dev/mmcblk1p1 /mnt/emmc/
cd /mnt/emmc/
tar -cjf /path/to/ts-backup-image.tar.bz2
cd ../
umount /mnt/emmc/
sync

To write a new filesystem:

dmesg | tail -n 30
# Look for the last /dev/sd* device connected.  This should also match the eMMC
# size of around 3.78GiB.  On my system, this is /dev/sdd.
sudo mkdir /mnt/emmc/
sudo mkfs.ext3 /dev/mmcblk1p1
# If the above command fails, use fdisk or gparted to repartition the emmc
# to have one large partition.
sudo mount /dev/mmcblk1p1 /mnt/emmc/
tar -xjf /path/to/ts-new-image.tar.bz2 -C /mnt/emmc
umount /mnt/emmc/
sync

Note that this interface is limited to about 1MB/s. You can write the eMMC disk faster by booting to SD with access to the image and using the native SD linux install to rewrite eMMC.

9 Compile the Kernel

The kernels we use in our images are built using the toolchains built by Yocto. You can download the appropriate cross toolchain for your Linux system here. Right click and save as for the appropriate toolchain:

# X86_64 (64 bit)
chmod a+x poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh
sudo ./poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh
 
# i686 (32 bit)
chmod a+x poky-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh
sudo ./poky-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.1.sh

This will ask for the install directory for the toolchain. You can choose another directory than the default, but the following instructions will assume the defaults.

This also requires several tools from your distribution. For Ubuntu/Debian:

sudo apt-get install git build-essential lzop u-boot-tools libncursesw5-dev

Once those are installed:

# This is the branch we recommend for our standard images:
git clone https://github.com/embeddedarm/linux-3.10.17-imx6.git -b imx_4.1.15_1.0.0_ga linux-technologic
cd linux-technologic/
 
# This mus be run every time you open a new terminal to build the kernel
source /opt/poky/2.1.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
export LOADADDR=0x10008000
make ts4900_defconfig
 
## Make any changes in "make menuconfig" or driver modifications, then compile
make -j4 && make uImage

To install this to a board you would use a USB SD reader and plug in the card. Assuming your Linux rootfs is all on "sdc1":

export DEV=/dev/sdc1
sudo mount "$DEV" /mnt/sd
# Yocto makes this a symlink which must first be removed
sudo rm /mnt/sd/boot/uImage
sudo cp arch/arm/boot/uImage  /mnt/sd/boot/uImage
sudo cp arch/arm/boot/dts/imx6*ts*.dtb /mnt/sd/boot/
INSTALL_MOD_PATH="/mnt/sd" sudo -E make modules_install 
INSTALL_HDR_PATH="/mnt/sd" sudo -E make headers_install
sudo umount /mnt/sd/
sync

9.1 Change Kernel Splash Screen

This board uses two splash screens. By default they display the same image. U-boot draws the very first splash screen, and the kernel the second. U-boots by default is only present for about a second while the kernel, device tree, and optionally the FPGA are loaded. As a quick change the u-boot splash can be disabled and only the kernel's splash will be shown with:

# This tells the splash command to just run "true" which returns immediately instead of
# drawing a splash screen
env set splash true
env save

To use your logo in u-boot take the imagefile file and convert it to a .bmp, and compress it with gz. The logo should be as small and simple as possible to compress well and load fast.

Install imagemagick on your host system to convert to the correct format.

convert yoursplash.png -colors 256 -depth 8 -compress none splash.bmp3
gzip splash.bmp3

This is provided in u-boot primarily for users that may want to give some feedback to the user. For example, a developer may want to use this u-boot splash as failed to boot screen or to show the user a message while updating from custom u-boot scripts. In the default configuration when booting off of emmc/sd the splash screen from u-boot will only be shown for about 1-3 seconds until Linux is loaded.

After u-boot runs the Linux kernel is typically started which will set up the clock tree, and reinitialize hardware. It is not possible for the u-boot splash to persist through this, but the kernel can redraw the splash a second later which will appear as a short flicker.

The kernel splashscreen allows 224 colors. It also allows up to the full screen resolution, but for fastest boot speed it should be kept as small as possible. The image will be centered around a black background.

To convert your image, for example, "mylogo.png":

convert mylogo.png mylogo.ppm
ppmquant 224 mylogo.ppm > mylogo-224.ppm
pnmnoraw mylogo-224.ppm > logo_user_clut224.ppm
cp logo_user_clut224.ppm <kernel build sources>/drivers/video/logo/

Now recompile the kernel following the guide in the previous section.

As another option the Linux kernel logo can be disabled completely with "logo.nologo" in the kernel cmdline.

10 Production Mechanism

On startup if the "U Boot" jumper is on when power is applied then TS-7990's U-boot will look in a USB drive for a file called /tsinit.ub. If found it will copy this to ${loadaddr} and "source ${loadaddr}" to run this u-boot script. This is intended for the initial production of boards and allows mass programming boards with a USB thumbdrive.

The USB blasting image can be downloaded here. This includes a basic linux kernel, and a small initramfs that will mount the usb drive at /mnt/usb/, and execute /mnt/usb/blast.sh.

The blast image/scripts requires 20MB, and the thumbdrive needs to just be sized to your disk image. The thumbdrive can use vfat or fat32. To create this on your workstation:

# This assumes your thumbdrive is /dev/sdc:
sudo mkfs.ext3 /dev/sdc1
sudo mkdir /mnt/sd/
sudo mount /dev/sdc1 /mnt/sd/
sudo tar --numeric-owner -xf /path/to/tsimx6_usb_blaster-latest.tar.bz2 -C /mnt/sd/
 
# Now you would create your images on the /mnt/sd/, but for
# an example these steps would write our latest debian image:
sudo wget -O /mnt/sd/emmcimage.tar.bz2 http://ftp.embeddedarm.com/ftp/ts-socket-macrocontrollers/ts-4900-linux/distributions/debian/debian-armhf-jessie-latest.tar.bz2
# You can use a symlink to write the same image to sd
sudo ln -s /mnt/sd/emmcimage.tar.bz2 /mnt/sd/sdimage.tar.bz2
sudo umount /mnt/sd
sync

The USB drive boots into a small buildroot initramfs environment with filesystem and partitioning tools. This can be used to format SD, eMMC, SATA, or even rewrite u-boot and its environment. The buildroot starts up and calls /blast.sh on the USB which by default includes code to reprogram the board. When it is finished it will blink green or red to indicate pass or fail. This script can be used without modification to write images from USB with these filenames:

SD Card sdimage.tar.bz2 Tar of the filesystem. This will repartition the SD card to 1 ext4 partition and extract this tar to the filesystem. If present, a /md5sums.txt will be checked and every file can be verified on the filesystem. This md5sums file is optional and can be omitted, but it must not be blank if present.
sdimage.dd.bz2 Disk image of the card. This will be written to mmcblk0 directly. If present a sdimage.dd.md5 will cause the written data on the SD card to be read back and verified against this checksum.
eMMC emmcimage.tar.bz2 Tar of the filesystem. This will repartition the eMMC to 1 ext4 partition and extract this tar to the filesystem. If present, a /md5sums.txt will be checked and every file can be verified on the filesystem. This md5sums file is optional and can be omitted, but it must not be blank if present.
emmcimage.dd.bz2 Disk image of the card. This will be written to mmcblk1 directly. If present a emmcimage.dd.md5 will cause the written data on the eMMC to be read back and verified against this checksum.
SATA [1] sataimage.tar.bz2 Tar of the filesystem. This will repartition the SATA drive to 1 ext4 partition and extract this tar to the filesystem. If present, a /md5sums.txt will be checked and every file can be verified on the filesystem. This md5sums file is optional and can be omitted, but it must not be blank if present.
sataimage.dd.bz2 Disk image of the card. This will be written to sda directly. If present a sataimage.dd.md5 will cause the written data on the SATA to be read back and verified against this checksum.
SPI u-boot.imx This will rewrite u-boot on the SPI flash. This will also verify the imx_type variables match before allowing it to be rewritten to make sure the RAM configs match. If u-boot.imx.md5 is present the SPI flash will be read back and verified.
  1. SATA is only present on the Dual/Quad CPUs

Most users should be able to use the above script without modification, but our buildroot sources are included here. The .config in this directory includes our config already. Format the USB drive to have one ext2/3/4 or fat32 partition and then run:

# Assuming /dev/sdc1 is your usb drive's first partition
make && sudo make_usb_prog.sh /dev/sdc1

11 Features

11.1 Accelerometer

This SBC contains an NXP MMA8451 3-axis accelerometer. It is connected to the kernel as an input device and can be accessed through the input event layers. The kernel driver is only polling and the accelerometer's IRQs are not supported. The accelerometer supports a ±2, ±4, and ±8 g dynamically selectable scale.

On a stock system with no other peripherals attached, the accelerometer will show up as

 /dev/input/event0

If other peripherals, such as mice, keyboards, or other HID devices are attached at boot, then this device may change.

In order to read from the accelerometer it must first be enabled:

echo 1 > /sys/devices/virtual/input/input0/enable

The scale mode can be changed by writing a 0 (±2 g), 1 (±4 g), or 2 (±8 g) to the scalemode sys file:

#Set the scale mode to 8 g
echo 2 > /sys/devices/virtual/input/input0/scalemode

Note that the input0 above may change if other input devices are present in the system.


From here, a tool such as 'evtest' can be installed and run to verify output:

apt-get update
apt-get install evtest
evtest /dev/input/event0

The 'evtest' command will have output similar to the following:

 Event: time 1466445467.909559, -------------- EV_SYN ------------
 Event: time 1466445468.029557, type 3 (EV_ABS), code 0 (ABS_X), value -123
 Event: time 1466445468.029557, type 3 (EV_ABS), code 1 (ABS_Y), value -35
 Event: time 1466445468.029557, type 3 (EV_ABS), code 2 (ABS_Z), value 16294
 Event: time 1466445468.029557, -------------- EV_SYN ------------
 Event: time 1466445468.149557, type 3 (EV_ABS), code 1 (ABS_Y), value -17
 Event: time 1466445468.149557, type 3 (EV_ABS), code 2 (ABS_Z), value 16224
 Event: time 1466445468.149557, -------------- EV_SYN ------------
 Event: time 1466445468.269598, type 3 (EV_ABS), code 0 (ABS_X), value -149
 Event: time 1466445468.269598, -------------- EV_SYN ------------
 Event: time 1466445468.389560, type 3 (EV_ABS), code 1 (ABS_Y), value -48
 Event: time 1466445468.389560, type 3 (EV_ABS), code 2 (ABS_Z), value 16416
 

Readings from the accelerometer are read from the kernel input event interface. The linux documentation for the input system as well as event types are the best resource for creating an application to read from the device:

https://www.kernel.org/doc/Documentation/input/input.txt

https://www.kernel.org/doc/Documentation/input/event-codes.txt

Additionally, the Openmoko documentation has a great breakdown of the input event data:

http://wiki.openmoko.org/wiki/Accelerometer_data_retrieval#Data_structure

11.2 Backlight

The backlight is controlled through the sysfs in /sys/class/backlight/backlight0/brightness. This allows brightness to be specified from 0 (off), to 8 (max brightness).

# Turn off backlight
echo 0 > /sys/class/backlight/backlight0/brightness
 
# Backlight on low intensity
echo 1 > /sys/class/backlight/backlight0/brightness
 
# Backlight on medium intensity
echo 4 > /sys/class/backlight/backlight0/brightness
 
# Backlight on full intensity
echo 8 > /sys/class/backlight/backlight0/brightness

11.3 Bluetooth

The WIFI option on the board also includes a bluetooth 4.0 LE module. This is supported in Linux using the Bluez stack.

# First bring up wifi.  This loads the firwmare for
# both WIFI and Bluetooth
modprobe wilc3000
ifconfig wlan0 up
# WIFI can optionally be brought back down
# ifconfig wlan0 down
 
hciattach /dev/ttymxc1 any 115200 noflow
hciconfig hci0 up
hcitool cmd 0x3F 0x0053 00 10 0E 00 01
stty -F /dev/ttymxc1 921600 crtscts
 
# If your board is REV A use this setup instead:
echo 237 > /sys/class/gpio/export
echo low > /sys/class/gpio/gpio237/direction
echo high > /sys/class/gpio/gpio237/direction
sleep .1
hciattach /dev/ttymxc1 texas 3000000
hciconfig hci0 up

Now you may scan for available devices with:

hcitool scan

This will return a list of devices such as:

14:74:11:AB:12:34	SAMSUNG-SM-G900A

You may request more information from a detected device like so:

hcitool info 14:74:11:AB:12:34

This will produce lots of details about the device, for example:

Requesting information ...                                                      
        BD Address:  14:74:11:AB:12:34                                          
        OUI Company: Samsung Electronics Co.,Ltd (4C-A5-6D)                     
        Device Name: SAMSUNG-SM-G900A                                           
        LMP Version: 4.1 (0x7) LMP Subversion: 0x610c                           
        Manufacturer: Broadcom Corporation (15)                                 
        Features page 0: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87        
        .
        .
        .

Bluez has support for many different profiles for HID, A2DP, and many more. Refer to the Bluez documentation for more information.

11.4 CAN

The TS-7990 CAN bus is located on #COM2 and #COM3 headers.

The i.MX6 includes 2 CAN controllers which support the SocketCAN interface. Before proceeding with the examples, see the Kernel's CAN documentation here.

This board comes preinstalled with can-utils. These can be used to communicate over a CAN network without writing any code. The candump utility can be used to dump all data on the network

## First, set the baud rate and bring up the device:
ip link set can0 type can bitrate 250000
ip link set can0 up
 
## Dump data & errors:
candump can0 &
 
## Send the packet with:
#can_id = 0x7df
#data 0 = 0x3
#data 1 = 0x1
#data 2 = 0x0c
cansend can0 -i 0x7Df 0x3 0x1 0x0c
## Some versions of cansend use a different syntax.  If the above
## commands gives an error, try this instead:
#cansend can0 7DF#03010C

The above example packet is designed to work with the Ozen Elektronik myOByDic 1610 ECU simulator to read the RPM speed. In this case, the ECU simulator would return data from candump with:

 <0x7e8> [8] 04 41 0c 60 40 00 00 00 
 <0x7e9> [8] 04 41 0c 60 40 00 00 00 

In the output above, columns 6 and 7 are the current RPM value. This shows a simple way to prove out the communication before moving to another language.

The following example sends the same packet and parses the same response in C:

#include <stdio.h>
#include <pthread.h>
#include <net/if.h>
#include <string.h>
#include <unistd.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <assert.h>
#include <linux/can.h>
#include <linux/can/raw.h>
 
int main(void)
{
	int s;
	int nbytes;
	struct sockaddr_can addr;
	struct can_frame frame;
	struct ifreq ifr;
	struct iovec iov;
	struct msghdr msg;
	char ctrlmsg[CMSG_SPACE(sizeof(struct timeval)) + CMSG_SPACE(sizeof(__u32))];
	char *ifname = "can0";
 
	if((s = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) {
		perror("Error while opening socket");
		return -1;
	}
 
	strcpy(ifr.ifr_name, ifname);
	ioctl(s, SIOCGIFINDEX, &ifr);
	addr.can_family  = AF_CAN;
	addr.can_ifindex = ifr.ifr_ifindex;
 
	if(bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
		perror("socket");
		return -2;
	}
 
 	/* For the ozen myOByDic 1610 this requests the RPM guage */
	frame.can_id  = 0x7df;
	frame.can_dlc = 3;
	frame.data[0] = 3;
	frame.data[1] = 1;
	frame.data[2] = 0x0c;
 
	nbytes = write(s, &frame, sizeof(struct can_frame));
	if(nbytes < 0) {
		perror("write");
		return -3;
	}
 
	iov.iov_base = &frame;
	msg.msg_name = &addr;
	msg.msg_iov = &iov;
	msg.msg_iovlen = 1;
	msg.msg_control = &ctrlmsg;
	iov.iov_len = sizeof(frame);
	msg.msg_namelen = sizeof(struct sockaddr_can);
	msg.msg_controllen = sizeof(ctrlmsg);  
	msg.msg_flags = 0;
 
	do {
		nbytes = recvmsg(s, &msg, 0);
		if (nbytes < 0) {
			perror("read");
			return -4;
		}
 
		if (nbytes < (int)sizeof(struct can_frame)) {
			fprintf(stderr, "read: incomplete CAN frame\n");
		}
	} while(nbytes == 0);
 
	if(frame.data[0] == 0x4)
		printf("RPM at %d of 255\n", frame.data[3]);
 
	return 0;
}

See the Kernel's CAN documentation here. Other languages have bindings to access CAN such as Python using C-types, Java using JNI.

11.5 COM Ports

This board uses UARTs from both the CPU and the FPGA. The CPU uart 0 (/dev/ttymxc0) is dedicated to console for Linux and U-boot and not suggested to be reused. The other CPU UARTs for ttymxc1-4 are usable for end applications. These support up to 5Mb/s UART data with DMA.

The FPGA also emulates a MAX3100 UART interface accessible at /dev/ttyMAX0-2. These UARTs support a total throughput of about 115200[1]. These UARTs include hardware that makes implementing RS-485 half duplex software very simple. If higher throughput is needed, the FPGA crossbar can be adjusted to use a CPU UART with TXEN support instead.

Note: Our SPI interface matches the max3100 almost entirely, except optionally a single 8-bit transaction can be sent to act as a chip select between the three uarts supported on our interface. The default FPGA supports 3 UARTs on this interface. This is handled automatically by our driver (max3100-ts).

RS-485 half duplex's direction control is built into the ttyMAX UARTs. By default they are connected to the RS-485 ports and no code is required for the transmit enable to toggle. The CPU UARTs however do not have transmit enable built in. The FPGA however includes a core that will toggle transmit enable for ttymxc1/ttymxc3, but it needs to know the baud rate, and symbol size (data bits, parity, stop bits).

For example:

# Configure mxc1 and mxc3 as 115200, 8n1
 
stty -F /dev/ttymxc1 115200 cs8 -cstopb
tshwctl --autotxen 1
 
stty -F /dev/ttymxc3 115200 cs8 -cstopb
tshwctl --autotxen 3

The tshwctl tool will read the UART settings from the moment when it is run and it sets up the FPGA's timing for TXEN. Your baud rate and mode settings should be set before running this.

Using the FPGA for either the ttyMAX uarts, or the CPU uarts, the TXEN timing will happen well under a single bit time [2] of any baud rate possible by the hardware.

All of these UARTs are accessed using the standard /dev/ interfaces. See these resources for information on programming with UARTs in Linux.

  1. Idle periods do not count towards the total throughput limitation.
  2. This is a requirement for half duplex MODBUS

All of the CPU uarts go through the FPGA Crossbar to select where UARTs are routed, or to bring out flow control instead of UARTs. These mappings can be chagned by adjusting the crossbar, but these are the default mappings:

UART Type TX (or 485 +) RX (or 485 -) CTS RTS
ttymxc0 USB [1] Onboard Silabs Onboard Silabs N/A N/A
ttymxc1 TTL 1.8 Onboard Bluetooth Onboard Bluetooth Onboard Bluetooth Onboard Bluetooth
ttymxc2 RS232 COM3_TXD_232_3V / COM3 header pin 3 COM3_RXD_232_3V / COM3 header pin 2 N/A N/A
ttymxc3 RS485 TXD3_485_3V / COM3 header pin 1 RXD3_485_3V / COM3 header pin 6 N/A N/A
ttymxc4 RS232 COM2_TXD_232_3V / COM2 header pin 3 COM2_RXD_232_3V / COM2 header pin 2 N/A N/A
ttyMAX0 RS485 TXD2_485_3V / COM2 header pin 1 RXD2_485_3V / COM2 header pin 6 N/A N/A
ttyMAX1 RS485 TXD1_485_3V / COM1 header pin 1 RXD1_485_3V / COM1 header pin 6 N/A N/A
ttyMAX2 RS232 COM1_TXD_232_3V / COM1 header pin 3 COM1_RXD_232_3V / COM1 header pin 2 N/A COM1_RTS_232_3V / COM1 header pin 7
  1. This is connected to the onboard microcontroller which presents the USB as a cp210x usb serial device on P2. This is not intended for application use.

11.6 CPU

The i.MX6 is an armv7a Cortex-A9 by NXP. The CPU itself is available in 792MHz, 996MHz, and 1.2GHz with a solo, dual, or quad core processor.

Refer to NXP's documentation for in depth documentation on these CPU cores:

11.7 eMMC

This board includes a Micron eMMC. Our off the shelf builds are 4GiB, but up to 64GiB are available for larger builds. The eMMC flash appears to Linux as an SD card at /dev/mmcblk2. Our default programming will include one partition programmed with our Yocto image.

The eMMC are like SD cards in that they should not be powered down during a write/erase cycle. This eMMC module includes support for setting a fuse for a "Write Reliability" mode, and a "psuedo SLC" mode. With both of these enabled then any writes will be atomic to 512B. If a sector is being written during a power loss, a block is guaranteed to have either the old or new data. This scheme is far more resilient to power loss than more traditional flash media. In cases of old 512B data fsck will still be able to recover a mountable filesystem. In cases where the corrupted file is a database it can still need a mechanism for recovery.

When this pSLC mode is turned on it will reduce the available space to under half, and reduce the write speed.

See our post on preventing filesystem corruption.

The mmc-utils package is used to enable these modes. First determine the exact size of the flash you're using:

mmc extcsd read /dev/mmcblk2 | grep MAX_ENH_SIZE_MULT -A 1
Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x0001cd
 i.e. 1888256 KiB

So in this case, 1888256 KiB is the max size of the enhanced partition. This number should be used for the enh_area command:

mmc write_reliability set -n 0 /dev/mmcblk2
mmc enh_area set -y 0 1888256 /dev/mmcblk2
WARNING: Setting either of those modes is permanent. Using the wrong value it is possible to brick eMMC which will not be covered by the warranty. Evaluation units with fuses set will not be accepted through returns.

After this is run, reboot the board. On all future boots the eMMC will be detected at the smaller size. Changing the enhanced area will erase the drive. After these mmc commands the disk will need to be rewritten.

11.8 Ethernet Port

The i.MX6 includes a 10/100/1000 Ethernet (near the speaker). In Linux this is the eth0 interface. The TS-TPC-7990 includes second Ethernet next to the USB based on the SMSC LAN9514 chipset. This is a 10/100 Ethernet port.

The MAC address uses the Technologic Systems 00:d0:69:00:00:00, and the last 3 octets are assigned from our pool. The MAC address is burned into the CPU's fuses during production, and will be read back automatically by software in Linux or U-Boot. The eth1 port will use the next mac address after eth0.

Note: Freescale has a published erratum regarding the maximum Ethernet speed. The default kernel can achieve about 400 Mb/s.

11.9 FPGA

The Lattice MachXO2 FPGA provides auto TX enable for RS-485 half duplex, a few more DIO, a crossbar, and it can generate a few preset clocks. Most of these registers are controlled using tshwctl in the ts4900-utils repository. The DIO can be accessed using the sysfs GPIOs 224 to 255 using the "tsgpio" driver. See the #GPIO section for more information on the recommended GPIO access.

Usage: tshwctl [OPTIONS] ...
Technologic Systems i.mx6 FPGA Utility
     -m, --addr <address>   Sets up the address for a peek/poke
     -v, --poke <value>     Writes the value to the specified address
     -t, --peek             Reads from the specified address
     -i, --mode <8n1>       Used with -a, sets mode like '8n1', '7e2', etc
     -x, --baud <speed>     Used with -a, sets baud rate for auto485
     -a, --autotxen <uart>  Enables autotxen for supported CPU UARTs
                              Uses baud/mode if set or reads the current
                              configuration of that uart
     -c, --dump             Prints out the crossbar configuration
     -g, --get              Print crossbar for use in eval
     -s, --set              Read environment for crossbar changes
     -q, --showall          Print all possible FPGA inputs and outputs.
     -h, --help             This message

The GPIO registers below include a crossbar, output enable, and data bit. The crossbar picks between GPIO (with crossbar value 31), and all other modes described in the next table. While the crossbar is set to GPIO, bit 0 is used as an output enable. When bit 0 is set to 0, bit 1 reflects the input value. When bit 0 is set to 1, bit 1 reflects the value that will be output.

Addr Bits Function
00 7:2 TTYMXC2_RXD Crossbar
1 TTYMXC2_RXD Output Data
0 Reserved (Output only)
01 7:2 TTYMXC4_RXD Crossbar
1 TTYMXC4_RXD Output Data
0 Reserved (Output only)
02 7:2 TTYMXC2_CTS Crossbar
1 TTYMXC2_CTS Data
0 TTYMXC2_CTS Output Enable
03 7:2 TTYMXC3_RXD Crossbar
1 TTYMXC3_RXD Output Data
0 Reserved (Output Only)
04 7:2 TTYMXC1_CTS Crossbar
1 TTYMXC1_CTS Output Data
0 Reserved (Output Only)
05 7:2 TTYMXC2_RTS Crossbar
1 TTYMXC2_RTS Data
0 TTYMXC2_RTS Output Enable
06 7:2 DIO_8 Crossbar
1 DIO_8 Data
0 DIO_8 Output Enable
07 7:2 DIO_9 Crossbar
1 DIO_9 Data
0 DIO_9 Output Enable
08 7:2 TXD1_485 Crossbar
1 TXD1_485 Output Data
0 Reserved (Output Only)
09 7:2 TXD2_485 Crossbar
1 TXD2_485 Output Data
0 Reserved (Output Only)
10 7:2 TXD3_485 Crossbar
1 TXD3_485 Output Data
0 Reserved (Output Only)
11 7:2 TXEN1_485 (ttymxc1) Crossbar
1 TXEN1_485 (ttymxc1) Output Data
0 Reserved (Output Only)
12 7:2 TXEN2_485 (ttymxc3) Crossbar
1 TXEN2_485 (ttymxc3) Output Data
0 Reserved (Output Only)
13 7:2 Reserved
1 BT_EN Output data
0 Reserved
14 7:2 Reserved
1 WL_EN Output data
0 Reserved
15 7:2 BT_RTS Crossbar
1 BT_RTS Data
0 BT_RTS Output Enable
16 7:2 BT_CTS Crossbar
1 BT_CTS Data
0 BT_CTS Output Enable
17 7:2 BT_TXD Crossbar
1 BT_TXD Output Data
0 Reserved (Output Only)
18 7:2 TTYMXC1_RXD Crossbar
1 Reserved
0 Reserved (Output Only)
19 7:2 DIO_0 Crossbar
1 DIO_0 Data
0 DIO_0 Output Enable
20 7:2 DIO_1 Crossbar
1 DIO_1 Data
0 DIO_1 Output Enable
21 7:2 DIO_2 Crossbar
1 DIO_2 Data
0 DIO_2 Output Enable
22 7:2 DIO_3 Crossbar
1 DIO_3 Data
0 DIO_3 Output Enable
23 7:2 DIO_4 Crossbar
1 DIO_4 Data
0 DIO_4 Output Enable
24 7:2 DIO_5 Crossbar
1 DIO_5 Data
0 DIO_5 Output Enable
25 7:2 DIO_6 Crossbar
1 DIO_6 Data
0 DIO_6 Output Enable
26 7:2 DIO_7 Crossbar
1 DIO_7 Data
0 DIO_7 Output Enable
27 7:2 FPGA_IRQ_1 Crossbar Value
1 FGPA_IRQ_1 Output Data
0 Reserved (Output Only)
28 7:0 Reserved
29 7:0 Reserved
30 7:2 Reserved
1 Reboot (on 1) [1]
0 Reserved
31 7:0 Reserved
32 7:0 RS485_CNT0 [23:16]
33 7:0 RS485_CNT0 [15:8]
34 7:0 RS485_CNT0 [7:0]
35 7:0 RS485_CNT1 [23:16]
36 7:0 RS485_CNT1 [15:8]
37 7:0 RS485_CNT1 [7:0]
38 7:0 RS485_CNT2 [23:16]
39 7:0 RS485_CNT2 [15:8]
40 7:0 RS485_CNT2 [7:0]
41 7:0 RS485_CNT3 [23:16]
42 7:0 RS485_CNT3 [15:8]
43 7:0 RS485_CNT3 [7:0]
44 7:2 TTYMAX0_RXD Crossbar
1 TTYMAX0_RXD Output Data
0 Reserved (Output Only)
45 7:2 TTYMAX1_RXD Crossbar
1 TTYMAX1_RXD Output Data
0 Reserved (Output Only)
46 7:2 TTYMAX2_RXD Crossbar
1 TTYMAX2_RXD Output Data
0 Reserved (Output Only)
47 7:2 TXEN3_485 Crossbar
1 TXEN3_485 Output Data
0 Reserved (Output Only)
48 7:2 COM1_TXD_232_3V Crossbar
1 COM1_TXD_232_3V
0 Reserved (Output Only)
49 7:2 COM2_TXD_232_3V Crossbar
1 COM2_TXD_232_3V Output Data
0 Reserved (Output Only)
50 7:2 COM3_TXD_232_3V Crossbar
1 COM3_TXD_232_3V Output Data
0 Reserved (Output Only)
51 7:4 FPGA Revision
3 P13 Input Value
2 L14 Input Value
1 G12 Input Value
0 H12 Input Value
52 7:2 COM1_RTS_3V Crossbar
1 COM1_RTS_3V Output Data
0 Reserved (Output Only)
53 7:2 TTYMAX0_CTS Crossbar
1 TTYMAX0_CTS Output Data
0 Reserved (Output Only)
54 7:2 TTYMAX1_CTS Crossbar
1 TTYMAX1_CTS Output Data
0 Reserved (Output Only)
55 7:2 TTYMAX2_CTS Crossbar
1 TTYMAX2_CTS Output Data
0 Reserved (Output Only)
56 7:0 DIO 7:0 Input Data
57 7:5 Reserved
4 LXD_PRESENT
3 OKAYA_PRESENT
2:1 DIO 9:8 Input Data
0 CN99_BOOT_SEL_PAD [2]
58 7:2 Reserved
1 XBEE Power Enable (1 = on)
0 XBEE Power select (3.3V = 0, 4V = 1) [3]
59 7:6 Reserved
5 XBEE_RESET#
4 EN_LCD_POWER
3 LCD_RESET#
2 EN_LCD_11V#
1 EN_LCD_NEG_7V
0 EN_LCD_20V
60 7:2 Reserved
1 MT_LCD_PRESENT
0 Reserved
61 7:2 Reserved
1 EN_SPKR Output Data
0 Reserved
62 7:2 XBEE_TXD Crossbar
1 XBEE_TXD Output Data
0 Reserved (Output Only)
  1. This power cycles all rails rather than a CPU watchdog reset
  2. This is used to select the offboard SPI primarily just used for production purposes.
  3. The XBEE requires 3.3V, and the Nimbelink requires 4V.

11.9.1 FPGA Crossbar

The FPGA crossbar allows almost any of the FPGA pins to be rerouted. All of the FPGA registers that have a crossbar mux value can be written with these values to change the output value. When using the crossbar pins that are outputs, bit 1 should also be set to allow output enables.

Crossbar Value Selected Function
0 Do not change
1 BT_RTS
2 BT_RXD
3 TTYMXC4_TXD
4 TTYMXC2_TXD
5 TTYMXC2_CTS
6 TTYMXC1_RTS
7 TTYMXC2_RTS
8 RXD1_485_3V
9 RXD2_485_3V
10 RXD3_485_3V
11 COM1_RXD_232_3V
12 COM2_RXD_232_3V
13 COM3_RXD_232_3V
14 TTYMXC3_TXD
15 TTYMXC1_TXD
16 TTYMAX0_TXD
17 TTYMAX0_TXEN
18 TTYMAX0_RTS
19 TTYMAX1_TXD
20 TTYMAX1_TXEN
21 TTYMAX1_RTS
22 TTYMAX2_TXD
23 TTYMAX2_TXEN
24 TTYMAX2_RTS
25 TTYMXC1_TXEN
26 TTYMXC3_TXEN
27 CLK_12MHZ
28 CLK_14MHZ
29 FPGA_24MHZ_CLK
30 CLK_28MHZ
31 GPIO [1]
32 DIO_0
33 DIO_1
34 DIO_2
35 DIO_3
36 DIO_4
37 DIO_5
38 DIO_6
39 DIO_7
40 DIO_8
41 DIO_9
42 XBEE_RXD
  1. This mode enables the use of the GPIO bits in the register, Data and Output Enable

For example, we can remap three ttyMAX ports to the HD1 GPIO.

Pin Function
HD1_DIO_1 ttyMAX0 txd
HD1_DIO_2 ttyMAX0 rxd
HD1_DIO_3 ttyMAX1 txd
HD1_DIO_4 ttyMAX1 rxd
HD1_DIO_5 ttyMAX2 txd
HD1_DIO_6 ttyMAX2 rxd
tshwctl --dump

This will return the mapping of all of the pins as they are currently set. These are the relevant pins:

     FPGA Pad (DIR) (VAL) FPGA Output
       MB_TXD ( in) (  0) TTYMAX1_TXD
  STC_TXD_485 ( in) (  0) TTYMAX0_TXD
  RTS_232_COM ( in) (  0) TTYMAX2_TXD
    HD1_DIO_1 ( in) (  0) GPIO
    HD1_DIO_2 ( in) (  0) GPIO
    HD1_DIO_3 ( in) (  0) GPIO
    HD1_DIO_4 ( in) (  0) GPIO
    HD1_DIO_5 ( in) (  0) GPIO
    HD1_DIO_6 ( in) (  0) GPIO
  TTYMAX0_RXD ( in) (  0) STC_RXD_485_3V
  TTYMAX1_RXD ( in) (  0) MB_RXD_485
  TTYMAX2_RXD ( in) (  0) CTS_232_COM

...

The tshwctl tool uses the bash environment to set/get pin status. To remap these pins:

eval $(tshwctl --get)
export HD1_DIO_1=TTYMAX0_TXD
export HD1_DIO_3=TTYMAX1_TXD
export HD1_DIO_5=TTYMAX2_TXD
export TTYMAX0_RXD=HD1_DIO_2
export TTYMAX1_RXD=HD1_DIO_4
export TTYMAX2_RXD=HD1_DIO_6
 
# These last 3 aren't required, but this will disable ttyMAX pins on
# their default locations.  Without this, writes to /dev/ttyMAX0 
# would go to both STC_TXD_485 and to HD1_DIO_1.
export MB_TXD=GPIO
export STC_TXD_485=GPIO
export RTS_232_COM=GPIO
 
# This will read the environment and look for the PAD names 
# for any changes and apply them.
tshwctl --set
 
# The TTY_MAX*_TXD lines will only output data
# if they pins are outputs, so set these pins 
echo 243 > /sys/class/gpio/export # HD1_DIO_1
echo high > /sys/class/gpio/gpio243/direction
echo 245 > /sys/class/gpio/export # HD1_DIO_3
echo high > /sys/class/gpio/gpio245/direction
echo 247 > /sys/class/gpio/export # HD1_DIO_5
echo high > /sys/class/gpio/gpio247/direction

11.10 Graphics

11.10.1 Rotate the Display

Under Yocto you can use xrandr to rotate the screen at any time:

export DISPLAY=:0 
xrandr --rotate left
xrandr --rotate right
xrandr --rotate normal
xrandr --rotate inverted

Under Debian or Ubuntu you can rotate the screen in the Xorg.conf. Edit the file /etc/X11/xorg.conf and append this to the end:

Section "Device"
    Identifier      "fbdev display"
    Driver          "fbdev"
    Option "Rotate" "CCW"
EndSection

After the display is rotated you will also need to rotate the touchscreen. This example matches the CCW rotation, but swapaxes or the invertx/y options will need to be adjusted for other rotations.

Section "InputClass"
       Identifier "axis inversion"
       MatchIsTouchscreen "true"
       # swap x/y axes on the device. i.e. rotate by 90 degrees
       Option "SwapAxes" "on"
       # Invert the respective axis.
       Option "InvertX" "on"
       Option "InvertY" "off"
EndSection

11.11 GPIO

The i.MX6 and FPGA GPIO are accessed using the kernel's sysfs GPIO interface. See the kernel's documentation here for more detail. This interface provides a set of files and directories for interacting with GPIO which can be used from any language that can write files.

To interact with a pin, first export it to userspace:

echo "48" > /sys/class/gpio/export

If you receive a permission denied on a pin that means it is claimed by another kernel driver. In this case, you can "cat /sys/kernel/debug/gpio" to see what driver has claimed it. If it succeeds you will have a /sys/class/gpio/gpio48/ directory. The relevant files in this directory are:

 direction - "in", "out" (out = low), "low", "high"
 value - write "1" or "0", or read "1" or "0" if direction is in
 edge - write with "rising", "falling", or "none"

With direction you can set it as an output and set the direction at the same time with high/low. If you just specify out this is the same as low.

# Set as a low output
echo "out" > /sys/class/gpio/gpio48/direction
# Set GPIO 48 high
echo "1" > /sys/class/gpio/gpio48/value
# Set GPIO 48 low
echo "0" > /sys/class/gpio/gpio48/value
 
# Read the value of GPIO 48
echo "in" > /sys/class/gpio/gpio48/direction
cat /sys/class/gpio/gpio48/value
 
# You can set it as a high output by setting the direction:
echo "high" > /sys/class/gpio/gpio48/direction

As an output, the in can be written to 0 for low (GND), or 1 for high (3.3V). The GPIO pins directly off of the i.MX6 processor support an absolute maximum of -0.5 to 3.6V. It is also possible to use any processor GPIO as an interrupt by writing the edge value, and then using select() or poll() on the value file for changes.

11.11.1 CPU GPIO Table

The GPIO numbers in the table below are relevant to how the Linux references these numbers. The CPU documentation refers to bank and IO while Linux flattens this out to one number space.

Schematic Name CPU PAD [1] GPIO Number Common Functions [2] Location
SD1_CMD SD1_CMD 18 #WIFI Onboard WIFI
SD1_CLK SD1_CLK 20 #WIFI Onboard WIFI
SD1_D0 SD1_DAT0 16 #WIFI Onboard WIFI
SD1_D1 SD1_DAT1 17 #WIFI Onboard WIFI
SD1_D2 SD1_DAT2 19 #WIFI Onboard WIFI
SD1_D3 SD1_DAT3 21 #WIFI Onboard WIFI
SD2_CMD SD2_CMD 11 #SD Card MicroSD socket
SD2_CLK SD2_CLK 10 #SD Card MicroSD socket
SD2_D0 SD2_DAT0 15 #SD Card MicroSD socket
SD2_D1 SD2_DAT1 14 #SD Card MicroSD socket
SD2_D2 SD2_DAT2 13 #SD Card MicroSD socket
SD2_D3 SD2_DAT3 12 #SD Card MicroSD socket
SD3_CMD SD3_CMD 194 #eMMC Onboard eMMC
SD3_CLK SD3_CLK 195 #eMMC Onboard eMMC
SD3_D0 SD3_DAT0 196 #eMMC Onboard eMMC
SD3_D1 SD3_DAT1 197 #eMMC Onboard eMMC
SD3_D2 SD3_DAT2 198 #eMMC Onboard eMMC
SD3_D3 SD3_DAT3 199 #eMMC Onboard eMMC
UART1_RXD SD3_DAT6 178 #Getting a Console Onboard Silabs
UART1_TXD SD3_DAT7 117 #Getting a Console Onboard Silabs
SPI_REM_CS# SD3_RST 200 #SPI HD6 pin 10
PWM_LOCAL_LCD SD4_DAT1 41 #Backlight Onboard backlight regulator
USB_HUB_RESET# SD4_DAT3 43 #USB Onboard USB hub
UART2_RTS# SD4_DAT5 45 ttymxc1 RTS #FPGA Crossbar
UART2_CTS# SD4_DAT6 46 ttymxc1 CTS #FPGA Crossbar
SPI_REM_MOSI SD4_DAT7 47 #SPI HD6 pin 6
WIFI_IRQ ENET_RXD1 26 #WIFI Onboard WIFI
UART4_TXD KEY_COL0 102 ttymxc3 TXD #FPGA Crossbar
UART4_RXD KEY_ROW0 103 ttymxc3 RXD #FPGA Crossbar
UART5_TXD KEY_COL1 104 ttymxc4 TXD #FPGA Crossbar
UART5_RXD KEY_ROW1 105 ttymxc4 RXD #FPGA Crossbar
TXD_CAN1 KEY_COL2 106 #CAN Onboard xceiver, COM2 header pins 4(h) and 9(l)
RXD_CAN1_3V KEY_ROW2 107 #CAN Onboard xceiver, COM2 header pins 4(h) and 9(l)
DC_I2C_CLK KEY_COL3 108 #I2C HD8 pin 1
DC_I2C_DAT KEY_ROW3 109 #I2C HD8 pin 1
TXD_CAN0 KEY_COL4 110 #CAN Onboard xceiver, COM3 header pins 4(h) and 9(l)
RXD_CAN0_3V KEY_ROW4 111 #CAN Onboard xceiver, COM3 header pins 4(h) and 9(l)
AUD_MCLK GPIO_0 0 #Audio Onboard SGTL5000
USB_OTG_ID GPIO_1 1 #USB OTG Onboard pullup only
RED_LED GPIO_2 2 #LEDs Onboard RED LED
FPGA_24MHZ_CLK GPIO_3 3 #FPGA Onboard FPGA Clock
FPGA_IRQ_1 GPIO_4 4 #Interrupts #FPGA Crossbar
JTAG_FPGA_TMS GPIO_5 5 #FPGA Onboard FPGA JTAG
FPGA_SPI_CS1# GPIO_6 6 #SPI Onboard FPGA (Unused)
UART2_TXD GPIO_7 7 ttymxc1 TXD #FPGA Crossbar
UART2_RXD GPIO_8 8 ttymxc1 RXD #FPGA Crossbar
PWM_REM_LCD GPIO_9 9 #PWM HD6 pin 14
JTAG_FPGA_TCK GPIO_16 203 #FPGA Onboard FPGA JTAG
JTAG_FPGA_TDI GPIO_17 204 #FPGA Onboard FPGA JTAG
JTAG_FPGA_TDO CSI0_MCLK 147 #FPGA Onboard FPGA JTAG
DC_SPI_CS# CSI0_PIXCLK 146 #SPI HD8 pin 15, #FPGA Crossbar
GREEN_LED CSI0_VSYNC 149 #LEDs Onboard Green LED
FPGA_IRQ_0 CSI0_DATA_EN 148 FPGA MAX3100 IRQ Onboard FPGA
AUD_CLK CSI0_DAT4 150 #Audio Onboard SGTL5000
AUD_TXD CSI0_DAT5 151 #Audio Onboard SGTL5000
AUD_FRM CSI0_DAT6 152 #Audio Onboard SGTL5000
AUD_RXD CSI0_DAT7 153 #Audio Onboard SGTL5000
FPGA_SPI_CLK CSI0_DAT8 154 FPGA MAX3100 UART Onboard FPGA
FPGA_SPI_MOSI CSI0_DAT9 155 FPGA MAX3100 UART Onboard FPGA
FPGA_SPI_MISO CSI0_DAT10 FPGA MAX3100 UART Onboard FPGA
FPGA_SPI_CS0# CSI0_DAT13 156 FPGA MAX3100 UART Onboard FPGA
LCD_PIX_CLK DI0_DISP_CLK 112 #LCD Interface CN4 pin 38, CN8 pin 37
EN_232_TRANS DI0_PIN2 114 Onboard 232 enable Onboard RS232 transceiver
ETH_PHY_RESET DI0_PIN4 116 Ethernet PHY reset Onboard Ethernet PHY
LCD_DE DI0_PIN15 113 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D02 DISP0_DAT2 119 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D03 DISP0_DAT3 120 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D04 DISP0_DAT4 121 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D05 DISP0_DAT5 122 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D06 DISP0_DAT6 123 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D07 DISP0_DAT7 124 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D10 DISP0_DAT10 127 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D11 DISP0_DAT11 133 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D12 DISP0_DAT12 134 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D13 DISP0_DAT13 135 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D14 DISP0_DAT14 136 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D15 DISP0_DAT15 137 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D18 DISP0_DAT18 140 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D19 DISP0_DAT19 141 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D20 DISP0_DAT20 142 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D21 DISP0_DAT21 143 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D22 DISP0_DAT22 144 #LCD Interface CN4 and CN8 LCD FPCs
LCD_D23 DISP0_DAT23 145 #LCD Interface CN4 and CN8 LCD FPCs
JP_OPTION# EIM_OE 57 Jumper, GPIO HD8 pin 23
JP_SD_BOOT# EIM_RW 58 Boot jumper HD8 pin 25
ACCEL_INT EIM_CS0 55 #Accelerometer Accelerometer IRQ
EN_USB_5V EIM_A16 54 #USB Onboard USB power FET
TOUCH_SPI_CLK EIM_A18 52 #Touch Controller Onboard Resistive Touch Controller
TOUCH_SPI_CS# EIM_A19 51 #Touch Controller Onboard Resistive Touch Controller
TOUCH_SPI_MOSI EIM_A20 50 #Touch Controller Onboard Resistive Touch Controller
TOUCH_SPI_MISO EIM_A21 49 #Touch Controller Onboard Resistive Touch Controller
BOOT_SPI_1_CLK EIM_D16 80 #SPI Flash Onboard SPI flash
BOOT_SPI_1_MISO EIM_D17 81 #SPI Flash Onboard SPI flash
BOOT_SPI_1_MOSI EIM_D18 82 #SPI Flash Onboard SPI flash
BOOT_SPI_1_CS1# EIM_D19 83 #SPI Flash Onboard SPI flash
I2C_1_CLK EIM_D21 85 #I2C Onboard I2C Peripherals
UART3_TXD EIM_D24 88 ttymxc2 TXD #FPGA Crossbar
UART3_RXD EIM_D25 89 ttymxc2 RXD #FPGA Crossbar
I2C_1_DAT EIM_D28 92 #I2C Onboard I2C Peripherals
UART3_HS2 EIM_D30 94 ttymxc2 RTS #FPGA Crossbar
UART3_HS1 EIM_D31 95 ttymxc2 CTS #FPGA Crossbar
EN_CAN# EIM_BCLK 191 CAN Xceiver enable Onboard CAN transceivers
FPGA_RESET EIM_EB0 60 #FPGA reset pin Onboard FPGA
TOUCH_REM_IRQ EIM_DA0 64 GPIO HD6 pin 12
SPI_REM_CLK EIM_DA2 66 #SPI HD6 pin 4
5V_REG_PWM_MODE EIM_DA4 68 Onboard Regulator Option [3] Onboard Regulator
EN_HUB_3.3V EIM_DA5 69 #USB Onboard USB HUB
PUSH_SW_1# EIM_DA9 73 Button SW1 Home Button
PUSH_SW_2# EIM_DA10 74 Button SW2 Back Button
SPI_REM_MISO EIM_DA11 75 #SPI HD6 pin 8
TOUCH_LOCAL_IRQ EIM_DA12 76 Touch Interrupt Onboard Touch controllers
ACCEL_2_INT EIM_DA15 79 #Accelerometer Accelerometer IRQ
  1. The pad name does not often correspond with the functionality of the IO we use, but can be used to reference the pad in the CPU manual.
  2. This does not contain all of the functions possible for a pin, but the common functions as they are used on our off the shelf basebords. Consult the i.MX6 CPU Reference manual for a complete list.
  3. Can change to PWM mode on the onboard regulator. This will lower efficiency of the regulator raising power consumption, but it reduces the audible noise heard on lower current consumption.

11.11.2 FPGA GPIO Table

The FPGA GPIO can also be accessed through the sysfs API. These are available at GPIOs 224 to 255. Not all of the reserved pins are used on this design, but they will be reserved by the kernel.

Name GPIO Number Default Crossbar Mode Location
UART3_RXD (TTYMXC2_RXD) 224 COM3_RXD_232_3V (13) CPU pin EIM_D25 (89)
UART5_RXD (TTYMXC4_RXD) 225 COM3_RXD_232_3V (12) CPU pin KEY_ROW1 (105)
UART3_CTS (TTYMXC2_CTS) 226 GPIO (31) CPU pin EIM_D31 (95)
UART4_RXD (TTYMXC3_RXD) 227 RXD3_485_3V (10) CPU pin KEY_ROW0 (103)
UART2_CTS (TTYMXC1_CTS) 228 BT_RTS (1) CPU pin SD4_DAT6 (46)
UART3_RTS (TTYMXC2_RTS) 229 GPIO (31) CPU pin EIM_D30 (94)
DIO_8 230 GPIO (31) HD8 pin 25
DIO_9 231 GPIO (31) HD8 pin 23
TXD1_485 232 TTYMAX1_TXD (19) HD1 pin 1/6 (RS485+-)
TXD2_485 233 TTYMAX0_TXD (16) HD2 pin 1/6 (RS485+-)
TXD3_485 234 TTYMXC3_TXD (14) HD3 pin 1/6 (RS485+-)
TXEN1_485 235 TTYMAX1_TXEN (20) HD1 RS485 TX enable
TXEN2_485 236 TTYMAX0_TXEN (17) HD2 RS485 TX enable
BT_EN 237 GPIO Only Register
WL_EN 238 GPIO Only Register
BT_CTS 240 TTYMXC1_RTS (6) Onboard Bluetooth CTS
BT_RXD 241 TTYMXC1_TXD (15) Onboard Bluetooth RXD
UART2_RXD (TTYMXC1_RXD) 242 BT_TXD (2) Onboard Bluetooth TXD
DIO_0 243 GPIO (31) HD8 pin 5
DIO_1 244 GPIO (31) HD8 pin 7
DIO_2 245 GPIO (31) HD8 pin 9
DIO_3 246 GPIO (31) HD8 pin 11
DIO_4 247 GPIO (31) HD8 pin 10
DIO_5 248 GPIO (31) HD8 pin 12
DIO_6 249 GPIO (31) HD8 pin 14
DIO_7 250 GPIO (31) HD8 pin 16
FPGA_IRQ_1 251 GPIO (31) CPU pin GPIO_4 (4)
Reboot 254 N/A (GPIO only) Register
TTYMAX0_RXD 268 RXD2_485_3V (9) FPGA Generated UART
TTYMAX1_RXD 269 RXD1_485_3V (8) FPGA Generated UART
TTYMAX2_RXD 270 COM1_RXD_232_3V (11) FPGA Generated UART
TXEN3_485 271 TTYMXC3_TXEN (26) HD3 RS485 TX enable
COM1_TXD_232_3V 272 TTYMAX2_TXD (22) HD1 pin 3
COM2_TXD_232_3V 273 TTYMXC4_TXD (3) HD2 pin 3
COM3_TXD_232_3V 274 TTYMXC2_TXD (4) HD3 pin 3
COM1_RTS_3V 276 TTYMAX2_RTS (24) HD1 pin 8
TTYMAX0_CTS 277 GPIO (29) FPGA Generated UART
TTYMAX1_CTS 278 GPIO (29) FPGA Generated UART
TTYMAX2_CTS 279 GPIO (29) FPGA Generated UART
MT_LCD_PRESENT 284 GPIO Only Register
EN_SPKR 285 GPIO Only Regulator AMP enable

11.12 Interrupts

The i.MX6 CPU GPIO are also able to function as interrupts on rising and falling edges. This is accessible from the kernel as well as userspace. Userspace IRQs are exposed through the sysfs gpio mechanism. This example will trigger on a falling edge for GPIO 48:

echo "48" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio48/direction
echo "falling" > /sys/class/gpio/gpio48/edge

From here, you would need to use a lower level language to poll() or select() on /sys/class/gpio/gpio48/value.

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <unistd.h>
 
int main(int argc, char **argv)
{
	char gpio_irq[64];
	int ret, irqfd = 0, i = 0;
	fd_set fds;
	FD_ZERO(&fds);
	int buf;
 
	if(argc < 2) {
		printf("Usage: %s <gpio number>\n", argv[0]);
		return 1;
	}
 
	snprintf(gpio_irq, sizeof(gpio_irq), "/sys/class/gpio/gpio%d/value", atoi(argv[1]));
	irqfd = open(gpio_irq, O_RDONLY, S_IREAD);
 
	if(irqfd == -1) {
		printf("Could not open IRQ %s\n", argv[1]);
		printf("Make sure the GPIO is already exported", argv[1]);
		return 1;
	}
 
	// Read first since there is always an initial status
	ret = read(irqfd, &buf, sizeof(buf));
 
	while(1) {
		FD_SET(irqfd, &fds);
		// See if the IRQ has any data available to read
		ret = select(irqfd + 1, NULL, NULL, &fds, NULL);
 
		if(FD_ISSET(irqfd, &fds))
		{
			FD_CLR(irqfd, &fds);  //Remove the filedes from set
			printf("IRQ detected %d\n", i);
			fflush(stdout);
			i++;
 
			/* The return value includes the actual GPIO register value */
			read(irqfd, &buf, sizeof(buf));
			lseek(irqfd, 0, SEEK_SET);
		}
 
		//Sleep, or do any other processing here
		usleep(100000);
	}
 
	return 0;
}

This example can be run as "./irqtest 48" which will echo every time the pin changes, but will otherwise take no cpu time.

11.13 LEDs

The kernel provides access to control the LEDs using the sysfs:

# Set Red led on
echo 1 > /sys/class/leds/red-led/brightness
# Set Red led off
echo 0 > /sys/class/leds/red-led/brightness
 
# Set Green led on
echo 1 > /sys/class/leds/green-led/brightness
# Set Green led off
echo 0 > /sys/class/leds/green-led/brightness

The kernel provides various triggers that can be useful for debugging purposes. The trigger for a given LED is in its directory:

echo "heartbeat" > /sys/class/leds/red-led/trigger
Trigger value LED toggles on
none Default, no action
mmc0 MicroSD card activity
mmc1 eMMC activity
mmc2 WIFI SDIO activity
timer 2hz blink
oneshot Blinks after delay. [1]
heartbeat Similar to timer, but varies the period based on system load
backlight Toggles on FB_BLANK
gpio Toggle based on a specified gpio. [2]
cpu0 Blink on CPU core 0 activity
cpu1 Blink on CPU core 1 activity
cpu2 Blink on CPU core 2 activity
cpu3 Blink on CPU core 3 activity
default-on Only turns on by default. Only useful for device tree.
transient Specify on/off with time to turn off. [3]
flash/torch Toggle on Camera activation. Not currently used.
  1. See the Kernel documentation for more details
  2. When this trigger is set, a "gpio" file appears in the same directory which can be used to specify what GPIO to follow when it blinks
  3. See the Kernel documentation for more details

11.14 MicroSD Card Interface

The i.MX6 SDHCI driver supports MicroSD (0-2GB), MicroSDHC (4-32GB), and MicroSDXC(64GB-2TB). The cards available on our website on average support up to 16MB/s read, and 22MB/s write using this interface. The linux driver provides access to this socket at /dev/mmcblk1 as a standard Linux block device.

This graph shows our SD write endurance test for 40x TS-7553 boards. These boards are running a doublestore stress test on 4GB Sandisk MicroSD cards. A failure is marked on the graph for a card once a single bit of corruption is found.

See chapter 67 of the IMX6 reference manual for more information on this mmc controller.

We have performed compatibility testing on the Sandisk MicroSD cards we provide. We do not suggest switching brands/models without your own qualification testing. While SD cards specifications are standardized, in practice cards behave very differently. We do not recommend ATP or Transcend MicroSD cards due to known compatibility issues.

Our testing has shown that on average microSD cards will last between 6-12TB. After this cards can begin to experience corruption, or stop being recognized by the host pc. This may be enough storage for many applications to write for years without problems. For more reliable storage consider using the eMMC. Our endurance testing showed a write lifetime on average of about 123TiB.

MicroSD cards should not have power removed during a write or they will have disk corruption. Keep the filesystem mounted read only if this is a possibility. It is not always possible for fsck to recover from the types of failures that will be seen with SD power loss. Consider using the eMMC for storage instead which is far more resilient to power loss.

11.15 RTC

This board uses a M41T00S STMicro Battery Backed RTC using an external and replaceable coin cell battery. This RTC is connected to the CPU via I2C and is handled by the kernel and is presented as a standard RTC device in linux.

With the provided battery this is expected to last 6 years. The RTCs are tested by the manufacturer to +-35ppm at 25C, which is about 1.53 minutes per month.

11.16 USB

11.16.1 USB OTG

The TS-7990 brings out a USB device port on P1 which can allow the board to act as a USB device. Several gadget device drivers are compiled into the default kernel. Additional devices can be compiled into the kernel by following the section here.

USB Serial

modprobe g_serial use_acm=1

This will create a /dev/ttyGS0 immediately after this modprobe is run. When this USB is connected to another Linux system this will show up as /dev/ttyACM0. See the kernel documentation for more information:

USB Ethernet

modprobe g_ether

This provides a usb0 network interface which simulates an ethernet network connection between the host pc and the i.MX6. This uses the Ethernet CDC driver on the host system where it is connected. Under Windows the inf file will be needed:

11.16.2 USB Host

The TS-7990 provides 4 standard USB 2.0 host supporting 480Mb/s. Two are on the Type A connector format, one is on the XBEE module for use with cell modems, and one is on the mini pcie header. Most commonly USB drivers built into Linux handle the USB communication but low level USB communication is possible using libusb.

A GPIO is available to toggle power to USB devices. This can be used to save power, or to reset USB devices that get stuck in a bad state.

# Power disabled
echo 0 > /sys/class/leds/en-usb-5v/brightness
sleep 2 # let any devices reset
# Enable power
echo 1 > /sys/class/leds/en-usb-5v/brightness

11.17 SATA

Note: SATA does not work on REV A boards

SATA is located on the mini PCIe header on the TS-7990. This is intended to be used with mSATA style drives to provide fast embedded storage.

The i.MX6 Quad and Dual include integrated SATA II support. This interface has been tested to provide 135MiB/s write, and 170MiB/s read in sequential accesses. In linux this is accessed through the /dev/sda device:

[    1.768036] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    1.785377] ata1.00: ATA-8: MKNSSDAT30GB-DX, 507ABBF0, max UDMA/133
[    1.791716] ata1.00: 58626288 sectors, multi 16: LBA48 NCQ (depth 31/32)
[    1.805380] ata1.00: configured for UDMA/133
[    1.810320] scsi 0:0:0:0: Direct-Access     ATA      MKNSSDAT30GB-DX  507A PQ: 0 ANSI: 5
[    1.819459] sd 0:0:0:0: [sda] 58626288 512-byte logical blocks: (30.0 GB/27.9 GiB)
[    1.827427] sd 0:0:0:0: [sda] Write Protect is off
[    1.832812] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.843621]  sda: sda1
[    1.847381] sd 0:0:0:0: [sda] Attached SCSI dis

U-boot includes a script to boot off of a SATA drive. The SATA drive should be formatted just like the SD card examples. In u-boot run:

env set bootcmd 'run sataboot;'
env save

This will ignore the SD boot jumper and just boot directly to SATA.

11.18 Sleep Mode

The TS-TPC-7990 implements a very low power sleep mode using the onboard supervisory microcontroller. This allows powering off the i.MX6 CPU entirely. While in this mode the entire board will use about 6mW for resistive or 26mW for capacitive touch screens.

The board can be woken 2 ways:

  • Timer - sleep mode requires specifying an amount of seconds to sleep (up to 16777215).
  • Touch - The touch controllers are kept powered on while in sleep mode.

The sleep mode can be entered at a low level calling "tshwctl --sleep 60" to sleep for 60 seconds, but this typically should not be called directly. This would be equivalent to disconnecting power while booted which can cause data loss.

The Yocto, Debian, or Ubuntu distributions use systemd to manage shutdown. When systemd shuts down it will call all executables in /lib/systemd/system-shutdown/. Create a script silabs-sleep in this directory with these contents:

#!/bin/bash
 
tsmicroctl --sleep 60

And make it executable:

chmod a+x /lib/systemd/system-shutdown/silabs-sleep

Now the board will sleep immediately following a shutdown. It is safe during the sleep mode to disconnect power.

11.19 SPI

SPI is located on the #DIO Header through /dev/spidev1.2.

This board includes one SPI interface which is accessible through either kernel drivers, or userspace using the /dev/spi interface.

The kernel development which would be needed to use other kernel space SPI drivers is beyond the scope of this document, but the build environment is described in the kernel compile guide here.

The /dev/spidev1.2 interface can be accessed using the userspace API. For more information see the documentation and sample code:

11.20 Onboard SPI Flash

This board includes 8MiB of SPI flash using a Micron N25Q064A13ESE40F. The CPU uses this for the initial boot to load u-boot, as well as the u-boot environment. In Linux this is accessed with the /dev/mtdblock devices.

Bytes Size Description
0-0x3ff 1KB Unused
0x400-0xfffff 0.999MiB U-boot
0x100000-0x101fff 8KiB U-boot environment #1
0x102000-0x17ffff 504KiB Unused
0x180000-0x181fff 8KiB U-boot environment #2
0x182000-0x1fffff 504KiB Unused
0x200000-0x201DE7 7655B Splash Screen
0x201DE8 - 0x700000 4.993MiB Unused

11.21 TWI

The i.MX6 supports standard I2C at 100khz, or using fast mode for 400khz operation. The CPU has 2 I2C buses used on the TS-7990.

I2C 0 is used for many onboard peripherals only, but I2C 1 is unused and brought out to the DIO header pins 1/3.

/dev/i2c-0
Address Device
0x0a SGTL5000 audio codec
0x1c #Accelerometer
0x28-0x2f #FPGA
0x4a #Silabs
0x5c [1] Capacitive Touch Controller
0x68 #RTC
  1. LXD option only

The kernel makes the I2C available at /dev/i2c-#. You can use the i2c-tools (i2cdetect, i2cget, i2cset), or you can write your own client.

11.22 Watchdog

The kernel provides an interface to the watchdog driver at /dev/watchdog. Refer to the kernel documentation for more information:

11.23 WIFI

This board includes a TiWi-BLE SDIO module that uses the Texas Instruments WL1271L Transceiver. Linux provides support for this using the wl12xx driver. See the LSR site for detailed product information.

Summary Features:

  • IEEE 802.11 b/g/n
  • 2.4GHz
  • Linux drivers include support for client and AP mode
  • Industrial temp, -40 to 85C
  • Certifications
    • FCC Bluetooth® Grant
    • FCC WLAN Grant
    • IC
    • CE
    • SAR Testing
    • SAR Testing EU

Linux uses the "wireless-tools", "wpa-supplicant", and "hostapd" packages to support most of the functionality in this module. Refer to the distribution support for #Yocto, #Debian, or #Android for more information.

12 External Interfaces

12.1 Buttons

The back of the board includes two buttons for general use. These can be sampled with:

echo 73 > /sys/class/gpio/export # Home
echo 74 > /sys/class/gpio/export # Back
 
echo in > /sys/class/gpio/gpio73/direction
echo in > /sys/class/gpio/gpio74/direction
 
# These will read 1 when not pressed, and 0 when pressed
cat /sys/class/gpio/gpio73/value
cat /sys/class/gpio/gpio74/value

12.2 Displays

The TS-TPC-7990 includes support for three different displays. U-boot will print out the detected display during startup:

 Display: LXD-WSVGA (1024x600)

12.2.1 LXD Display

The LXD is a 1024x600 7" 800 nit display with capacitive touch. The capacitive touch is using a pixcir tango c series controller providing 5 points of touch simultaneously.

12.2.2 Okaya Display

The Okaya is a 800x480 7" 800 nit display with resistive touch. This uses the onboard resistive touch controller the TSC2046. This provides one point of touch.

12.2.3 Microtips Display

The Microtips display is a 800x480 7" 400 nit display with resistive touch. This uses the onboard resistive touch controller the TSC2046. This provides one point of touch.

12.3 Audio

The board provides audio from the AC97 audio header, and the piezo speaker. You can disable the onboard piezo speaker to just have output from the external interface with:

echo 0 > /sys/class/leds/en-speaker/brightness

As a simple example to test audio you can use "aplay" to play .wav files, and arecord to use the mic input to create a wav file

arecord -d 5 recording.wav
aplay recording.wav

12.3.1 Audio Header

The TS-TPC-7990 includes a 2x5 0.1" pitch header including the speaker, microphone, and headphones. This header is compatible with AC97 which is commonly found on desktop motherboards. Third party cabling can bring this into 3.5mm headers.

Pin Description
1 MIC
2 GND
3 MIC Bias
4 GND
5 HP_R
6 NC
7 SPKR+
8 SPKR-
9 HP_L
10 NC

TS-7990-Audio.png

12.3.2 Speaker

Audio Frequency Response

The TS-TPC-7990 includes an onboard piezo speaker for basic audio. It can produce 81 dB of sound pressure with a 4khz square wave. This speaker is ideal for implementing alarm and siren type of noises.

amixer sset 'PCM' 100%
amixer sset 'Headphone' 100%
 
# This will produce a 1 second 4khz beep from the speaker at full volume.
timeout 1s speaker-test -f 4000 --test=sine
 
# 2khz
timeout 1s speaker-test -f 2000 --test=sine

12.4 COM Headers

The COM ports all use 0.1" pitch 2x5 headers. You can use the RC-DB9 cable in the accessories section to bring this to a DB9 cable.

COM1 Header
Pin Description
1 COM1_485+ (/dev/ttyMAX1)
2 COM1_232_RXD (dev/ttyMAX2)
3 COM1_232_TXD (/dev/ttyMAX2)
4 NC
5 GND
6 COM1_485- (/dev/ttyMAX1)
7 COM1_232_RTS (/dev/ttyMAX2)
8 COM1_232_CTS (/dev/ttyMAX2)
9 NC
10 NC
COM2 Header
Pin Description
1 COM2_485+ (/dev/ttyMAX0)
2 COM2_232_RXD (/dev/ttymxc4)
3 COM2_232_TXD (/dev/ttymxc4)
4 CAN_2_H (can1 interface)
5 GND
6 COM2_485-
7 NC
8 NC
9 CAN_2_L (can1 interface)
10 NC
COM3 Header
Pin Description
1 COM3_485+ (/dev/ttymxc3) [1]
2 COM3_232_RXD (/dev/ttymxc2)
3 COM3_232_TXD (/dev/ttymxc2)
4 CAN_3_H (can0 interface)
5 GND
6 COM3_485- (/dev/ttymxc3) [1]
7 NC
8 NC
9 CAN_3_L (can0 interface)
10 NC
TS-7990-COM.png
  1. 1.0 1.1 This uart must be set up before RS485 will work. See the #COM Ports section for more information.

12.5 Mini PCIe

The Mini PCIe socket provides USB, mSATA, and a PCIe lane. This Mini PCIe socket supports the SIM socket, but it is not populated by default on our boards. Contact us for more information on supporting this header.

12.6 Power Connector

This board includes removable terminal blocks which accept 8-28, or 5V for the power input. A typical power supply for this board should provide 25W, though see the #Power Consumption section for more information on the actual power requirements based on your CPU module and peripherals.

TS-7990 Power Connector.jpg

WARNING: Connecting both 8-28V and 5V inputs can damage the board.

12.7 DIO Header

The DIO header includes I2C, SPI, GPIO, and a few jumpers. The TS-DC799-SILO daughter card is also supported on this header. If pin 7 is held low on startup during u-boot, all of the DIO will be used for managing the supercap board. After startup any of these pins, including pin 7 can be used as normal DIO.

Pin Description
1 DC_I2C_DAT (/dev/i2c-1)
2 VIN
3 DC_I2C_CLK (/dev/i2c-1)
4 VIN
5 SUP_CAP_ANALOG
6 SW_5V [1]
7 GPIO 244 (FPGA DIO_1_SEL0)
8 3.3V rail
9 GPIO 245 (FPGA DIO_2_SEL1)
10 GPIO 247 (FPGA DIO_4_PWM)
11 GPIO 246 (FPGA DIO_3_SEL2)
12 GPIO 248 (FPGA DIO_5_SILAB_DATA)
13 DC_SPI_MISO #SPI
14 GPIO 249 (FPGA DIO_6_POWER_FAIL)
15 SUP_CAP_4.6V
16 GPIO 250 (FPGA DIO_7)[2]
17 DC_SPI_MOSI #SPI
18 USB_OTG_M
19 DC_SPI_CLK #SPI
20 USB_OTG_P
21 CAN_3_L (can0 interface)
22 CAN_TERM_3
23 JP_OPTION# [3], GPIO 231 (FPGA DIO_9)
24 Ground
25 JP_SDBOOT [4], GPIO 230 (FPGA DIO_8)
26 Ground

TS-7990-DIO.png

  1. This 5V rail is switched on/off with power.
  2. This pin defaults to an RTS signal. To use this as DIO run:
    DIO_7=GPIO tshwctl --set
  3. If this pin reads low on startup it will stop in u-boot. After the initial read this pin can be reused as a GPIO.
  4. This pin is latched on startup and sets the "jpsdboot" value. This decides if the default scripts boot to SD or eMMC.

12.8 XBEE Header

For using this header as XBEE, contact us here. By default the board only directly supports Nimblelink radios.

To use this header for XBEE and use ttymxc3 for the UART:

# Connect CPU ttymxc3 to XBEE
export TTYMXC3_RXD=XBEE_RXD
export XBEE_TXD=TTYMXC3_TXD
tshwctl --set
 
# Enable 3.3V to XBEE:
tshwctl --addr 58 --poke 0x2
 
# Take XBEE out of reset:
eval $(tshwctl --addr 59 --peek)
tshwctl --addr 59 --poke $(($addr59 | 0x20))

The Nimbelink modem can use the USB on this header, but still needs power enabled:

# Enable 4V to Nimbelink
tshwctl --addr 58 --poke 0x3
 
# The Nimbelink needs to be taken out of reset after being turned on:
eval $(tshwctl --addr 59 --peek)
tshwctl --addr 59 --poke $(($addr59 | 0x20))
# The nimblelink can take ~ 10-15 seconds to show up on USB.
Pin Description
1 VIN (3.3V or 4V based on FPGA reg 58)
2 XBEE_RXD
3 XBEE_TXD
4 GND
5 Not connected
6 VIN
7 USB_DN4_P
8 USB_DN4_M
9 GND (DTR)
10 GND
11 GND
12 (CTS) Not connected
13 Not connected
14 3.3V (VREF)
15 GND
16 GND (RTS)
17 Not connected
18 Not connected
19 Not connected
20 GND (POWER_ON)

TS-7990-XBEEHeader.png

12.9 USB Ports

The TS-7990 includes 2 standard type 'A' USB ports on J8. Two more ports are avaialble on other interfaces such as the Mini-PCIe header, and the XBEE header for supporting nimblelink cell modems.

13 Peripherals

13.1 TS-DC799-SILO

TS-DC799-SILO

The TS-TPC-7990 supports TS-SILO which provides support to keep the board alive for up to 60 seconds. This can be used to keep operating as normal through power supply glitches, and to provide a safe shutdown allowing the filesystem to close as expected.

A power failure will typically go through these steps:

  • The TS-TPC-7990 will detect the DC-799-SILO board on startup, and enable charging the super caps.
  • U-boot will load the kernel, device tree, and optionally fpga
  • It will load the capacitors and verify we have a valid VIN, and then jump in the the kernel and boot Linux.
  • In Linux a daemon will monitor a GPIO to detect a power failure and start monitoring the supercap charge levels.
  • Once the supercap charge levels have reached a low threshold the board will reboot.
  • The board will reboot to u-boot without power and wait until caps are charged and VIN has returned.
    • If power does not return, the supervisory microcontroller will remove power from the i.MX6 and slowly allow the caps to fully drain
    • If power does return then the caps will be recharged and the board will be booted back up as normal.

On startup u-boot will look at pin 7 on the DIO header. If this is low, it will assume presence of the super capacitor daughter card. Pins 9, 10, 11, and 14 will also be claimed by the silabs to communicate with the charging circuit on the daughter card.

U-boot will also check the "No Charge" jumper on startup and will skip the charging sequence before boot.

If charging is started it will run in u-boot:

tsmicroctl b ${silochargpct}

This will block until the TS-DC799-SILO is charged until the percent specified in silochargpct. The percent is linear between 0 and 12VDC. By default the supercaps will charge to 90%. This number can be changed with:

env set silochargpct 80
env save

The caps should include enough charge to fully boot the system, and fully shutdown before boot is started. If it is started too early there will not be enough charge to guarantee a safe shutdown.

The supercaps will charge up to 12VDC, and will be usable to power the system above 6VDC. Charging will take approximately 2 minutes on the first startup to charge from 0-12VDC. Subsequent boots with the caps partially charged at 6VDC will take about 1 minute.

Charging Graph

The supercap discharge will vary depending on #Power Consumption of the board in use. The graph below shows a fast charge of a loaded cpu/gpu on the TS-TPC-7990-QMW3E quad core with the PCAP display. The slow discharge shows a TS-TPC-7990-SMN2E solo with the resistive which is using the powersaving cpu governor, LCD off, and a mostly idle CPU.

Discharge Graph

Once booted to Linux the tssilomon service is started. This script monitors for power fail and if it detects a power failure, it begins to sample the ADC on the supercaps to determine charge. If supercaps fall below 90% charge which provides up to 10 seconds of running off supercap power, then it begins to reboot.

Once in u-boot it will block again until the supercaps have finished charging again, or the power runs out and the power rails will collapse. The onboard supervisory microcontroller will power down the main power rails and ARM CPU so onboard and power rails available on headers will collapse once cleanly rather than fluctuating as the power runs out.

13.2 TS-DC799-POE

This daughterboard provides PoE+ support for the TS-TPC-7990. This allows the board to be fully powered by J1, the Ethernet connector near the RTC battery and mini pcie connector.

ts-dc799-poe-a1.gif

This board can be detected by the POE_DETECT# signal which can be read on the EIM_DA11 GPIO.

14 Specifications

14.1 Power Specifications

The TS-TPC-7990 includes 2 methods for powering the board. There is a 5V input, and a 8-28V input. Only one of these should be provided to the board.

Input Min voltage Max voltage
5V input 4.75 5.25
8-28V Input 8.00 28.00

14.2 Power Consumption

The i.MX6 power consumption can vary a lot depending on the build and activity of the board. Most of the power savings happens automatically when the cpu and gpu are idle, but it is also possible to disable the Ethernet PHY for additional savings. The backlight can be changed for significant power savings.

# Put ETH PHY in reset
echo 116 > /sys/class/gpio/export
echo high > /sys/class/gpio/gpio116/direction
 
# Put USB HUB in reset
echo 43 > /sys/class/gpio/export
echo low > /sys/class/gpio/gpio43/direction
 
# Lower backlight to 50%
echo 4 > /sys/class/backlight/backlight_local_lcd/brightness
 
# Disable backlight
echo 0 > /sys/class/backlight/backlight_local_lcd/brightness

Ethernet is not connected unless otherwise specified, and serial is disconnected during the measurement. The CPU test is 5x processes of "openssl speed", and the GPU test is Qt5CinematicExperience in the Yocto image.

These tests are performed powering the board through 5V.

TS-7990 solo without WIFI
Test Max Watts Average Watts
CPU 100% + GPU loaded (LCD 100%) + IO + Ethernet 12.00 (2.40 A) 8.95 (1.79 A)
CPU 100% (LCD 100%) 8.90 (1.78 A) 7.80 (1.56 A)
CPU Idle (LCD 100%) 8.35 (1.67 A) 7.20 (1.44 A)
CPU Idle (LCD 50%) 8.60 (1.72 A) 6.10 (1.22 A)
CPU Idle (LCD 0%) 4.75 (0.95 A) 3.90 (0.78 A)
CPU Idle (LCD 0%), USB HUB off 4.10 (0.82 A) 3.35 (0.67 A)
CPU Idle (LCD 0%), USB HUB off, Ethernet PHY in reset 4.05 (0.81 A) 2.95 (0.59 A)
CPU Idle (LCD 100%) + CPU Ethernet 9.20 (1.84 A) 5.70 (1.14 A)
CPU Idle (LCD 100%) + USB Ethernet 5.85 (1.70 A) 5.70 (1.14 A)
TS-7990 quad core with WIFI
Test Max Watts Average Watts
CPU 100% + GPU loaded (LCD 100%) + IO + Ethernet 18.85 (3.77 A) 11.25 (2.25 A)
CPU 100% (LCD 100%) 12.20 (2.44 A) 8.65 (1.73 A)
CPU Idle (LCD 100%) 11.50 (2.30 A) 9.70 (1.94 A)
CPU Idle (LCD 50%) 11.40 (2.28 A) 7.90 (1.58 A)
CPU Idle (LCD 0%) 4.65 (0.93 A) 3.90 (0.78 A)
CPU Idle (LCD 0%), USB HUB off 5.55 (1.11 A) 3.50 (0.70 A)
CPU Idle (LCD 0%), USB HUB off, Ethernet PHY in reset 4.90 (0.98 A) 3.05 (0.61 A)
CPU Idle (LCD 100%) + CPU Ethernet 11.20 (2.24 A) 6.60 (1.32 A)
CPU Idle (LCD 100%) + USB Ethernet 11.60 (2.32 A) 6.70 (1.34 A)

The onboard microcontroller is able to disable power to the rest of the board and wake up on a specified number of seconds, or if the touchscreen receives a touch. The CPU variants will draw the same amount during the sleep mode, but what does make a difference is if the touchscreen is resistive touch or capacitive touch. These tests are both at 5V.

Sleep modes
Test Max Average
Resistive touch (Okaya or microtips) 90mW 6mW
Capacitive touch (LXD) 125mW 26mW

14.3 Temperature Specifications

The i.MX6 CPUs we provide off the shelf are either a solo industrial, or quad core extended temperature. The TS-7990 is designed using industrial components that will support -40C to 85C operation, but on this system the LCD will be the limiting factor for temperature.

Model Number Operating Min Operating Max Storage Min Storage Max
TS-TPC-7990-SMN2E -20C 70C -30C 80C
TS-TPC-7990-SMN3E -20C 60C -30C 70C
TS-TPC-7990-QMW2E -20C 70C -30C 80C
TS-TPC-7990-QMW3E -20C 60C -30C 70C

The default Linux includes a thermal driver to help manage temperatures where the CPU may overheat. When heating up it will throttle itself at the passive temperature until it reaches the cooling temperature, or it if it continues to heat up to the critical temperature the system will reboot and wait in u-boot until

Model Number Cooling Temp [1] Passive Temp [2] Critical/Max Junction Temp [3]
TS-TPC-7990-S**** 75C 85C 105C
TS-TPC-7990-Q**** 75C 85C 100C
  1. CPU stops all throttling below this temperature
  2. CPU begins throttling until the cooling temperature
  3. CPU Max temperature. Linux will shut down to cool in u-boot at this temperature.

For custom builds with different CPUs these are also exposed in /sys/:

# Passive
cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp
# Critical
cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp

The current CPU die temp can be read with:

cat /sys/devices/virtual/thermal/thermal_zone0/temp


Our test data can be used to estimate the temperature rise of the CPU over the ambient temperature. These are tested without an enclosure in open air. The temp ranges show the CPU at idle at the low end, to a very high system load at the high end.

Configuration Temp rise over ambient
Solo No Heatsink 21-27C
Solo with HS-50x53x13 18-20C
Quad No Heatsink 16-50C
Quad with HS-50x53x13 10-23C

When the CPU heats up past the cooling temp on a first boot, it will take no action. Heating up past the passive temperature the kernel will cool down the CPU by reducing clocks. This will show a kernel message:

[  158.454693] System is too hot. GPU3D will work at 1/64 clock.

If it cools back down below the cooling temperature it will spin back up the clocks.

[  394.082161] Hot alarm is canceled. GPU3D clock will return to 64/64

If it continues heating to the critical temperature it will overheat and reboot. Booting back up u-boot will block the boot until the temperature has been reduced to the Cooling Temp+5C. This will be shown on boot with:

U-Boot 2015.04-07857-g486fa69 (Jun 03 2016 - 12:04:30)

CPU:   Freescale i.MX6SOLO rev1.1 at 792 MHz
CPU Temperature is 105 C, too hot to boot, waiting...
CPU Temperature is 102 C, too hot to boot, waiting...
CPU Temperature is 99 C, too hot to boot, waiting...
CPU Temperature is 90 C, too hot to boot, waiting...
CPU Temperature is 86 C, too hot to boot, waiting...
CPU Temperature is 84 C, too hot to boot, waiting...
CPU Temperature is 80 C, too hot to boot, waiting...
CPU Temperature is 80 C, too hot to boot, waiting...
CPU Temperature is 80 C, too hot to boot, waiting...
CPU:   Temperature 78 C
Reset cause: WDOG
Board: TS-7990

The i.MX6 will draw significantly more power depending on its load.

Stress Test

14.4 IO Specifications

The GPIO external to the board are all nominally 3.3V, but will vary depending on if they are CPU/FPGA pins.

The CPU pins can be adjusted in software and will have initial values in the device tree. This lets you adjust the drive strength, and pull strength of the IO. See the device tree for your kernel for further details on a specific IO.

The FPGA IO cannot be adjusted further in software.

IO Typical Range Absolute Range Logic Low Logic high Drive strength
External CPU GPIO 0-3.3V -0.5V to 3.3V Rail + 0.3V 0.3 * 3.3V Rail 0.7 * 3.3V Rail 27.5mA
External FPGA GPIO 0.3.3V -0.5-3.75V 0.8 2.0 12mA


Refer to the MachXO Family Datasheet for more detail on the FPGA IO. Refer to the CPU quad or solo datasheet for further details on the CPU IO.

WARNING: Do not drive any IO from an external supply until 3.3V is up on the board. Doing so can violate the power sequencing of the board causing failures.

14.5 Rail Specifications

The TS-TPC-7990 generates all rails from either the 8-28VDC input, or the 5V input. This table does not document every rail. This will only cover those that can provide power to an external header for use in an application.

Rail Current Available Location
3.3V 1A mPCIE/mSATA, HD8 pin 8
5V Quad core 0.5A, Solo 1.5A [1] HD8 pin 2/4, USB, mPCIE/mSATA
  1. These limitations are only relevant if 8-28V is supplied into the board.

15 Revisions and Changes

15.1 TS-TPC-7990 PCB Revisions

Revision Changes
A
  • Initial Release
B
  • Changed to Marvell PHY
  • Changed speaker to Piezo to save space, and it is louder for alarm implementations.
  • Added Nimblelink Socket
  • Fixed touch controller to have correct IRQ polarity for sleep mode
  • Changed 5V regulator to provide higher current (2.5 A to 5 A)
  • Fixed SW_5V FET from being held off by offboard RS-232
  • Auto select LCD voltage rails with no specific strapping resistors differentiating build
  • Changed WIFI from TIWI-BLE to equivalent Atmel/Microchip WILC3000 module with 12 year availability.
    • WIFI DOES NOT WORK ON THIS BOARD REVISION
  • Micro USB ports both moved a few mm in to fix interference with daughter cards
  • CN26 modified to support our daughtercards
  • Backlight regulator has GPIO enable allowing backlight to be entirely turned off besides PWM.
  • Removed SIM socket
  • Changed scan on Microtips LCD to rotate 180 degrees to match other LCDs
  • Added SATA/PCIe MUX. Mode is selected in u-boot.
  • Changed 11V regulator
  • Grounded CPU DIO (Ball L21) to identify REV B builds.
  • Additional minor changes for internal production
C
  • WIFI moved to SPI to avoid SDIO bug in wifi chip. WIFI works now with latest kernel.
  • R198 removed means REV C board.
  • Added PCIe reset GPIO. Fixed some devices not working after a software reboot.
  • XBEE_RESET# moved to FPGA GPIO
  • TOUCH_RESET# moved to CPU GPIO so rare i2c bus lockups can be recovered with a reboot.
  • Minor layout fixes
  • Minor changes to CN99 for production

15.2 U-Boot Changelog

May-09-2016
  • Initial Release
Nov-16-2016
  • Added support for supercap daughtercard
  • Implemented sleep mode (if silabs rev >= 1)
  • Implemented redundant env
  • Fixed environment being reset when usb initialized on startup
Jan-13-2017
  • Added REV B support
  • Added Marvell Ethernet support
Feb-03-2017
  • Added DC-799-SILO daughtercard support
Feb-17-2017
  • Added check for 64bit ext4 filesystem.
Mar-06-2017
  • Fixed loading correct device tree for REV A boards.
Apr-12-2017
  • Improved supercap support.
    • Draw splash screen before blocking
    • Improved boot time while charging
    • nfsboot/sataboot now support supercap blocking
    • Supercaps are automatically detected and honor the "No Charge" jumper
Jun-07-2017
  • Fixed REV A boards erroneously detecting silo boards
Jul-28-2017
  • Added support for detecting REV C boards
Aug-03-2017
  • Fixed regression in TS-SILO support

15.3 FPGA Changelog

Check the FPGA rev with:

echo $(($(tshwctl --peek --addr 51)>>4))
Rev Changes
1
  • Initial Release
2
  • Added TOUCH_RESET gpio
3
  • Changed FPGA_IRQ_2 into FPGA_RESET
4
  • tristate DC_SPI_CS#
  • ttyMAX uarts use IRQ 0
  • Fixed WIFI clock
  • Fixed default crossbar so all uarts work without regisiter write fixes
  • Fixed DIO_1
5
  • Changed onboard pullup to fix production process.
6
  • Added support for REV B boards.
7
  • Added support for reprogramming Silabs in the field
8
  • Routes DC_SPI_MISO to FPGA_SPI_MISO when the chip select is not asserted. Used to detect silo board automatically.
9
  • Added XBEE_TXD to crossbar at address fpga register 62

You can reload the FPGA during startup for custom FPGAs. If /boot/ts7990-fpga.vme is present during startup you will see u-boot reload this file:

Bytes transferred = 56341 (dc15 hex)
VME file checked: starting downloading to FPGA
Diamond Deployment Tool 3.5
CREATION DATE: Wed Oct 07 11:38:24 2015


Downloading FPGA 53248/56341 completed
FPGA downloaded successfully

15.4 Silabs Changelog

Revision Changes
0
  • Initial Release
1
  • Added Sleep mode
  • Blinks Silabs LED in low power modes. Sleep mode does this, as well as USB device connected with no power on the main VIN.
6
  • Include support for DC799-SILO daughtercard providing up to 60 seconds of charge when power is lost.

15.5 Software Images

15.5.1 Yocto Changelog

Quad/Dual Image Solo/Duallite Image Changes
ts-x11-image-ts4900-quad-20140905235640.rootfs.tar.bz2 ts-x11-image-ts4900-solo-20140908160116.rootfs.tar.bz2
  • Initial Release
ts-x11-image-ts4900-quad-20141119190447.rootfs.tar.bz2 ts-x11-image-ts4900-solo-20141119204157.rootfs.tar.bz2
  • Systemd default
  • Added /usr/lib/openssh/sftp-server (Fixes QtCreator/Eclipse deploy)
  • Added QtQuick
  • Added Sqlite to QT
  • Added early TS-7970 support.
  • Updated kernel with significant fixes, see github for more information.
ts-x11-image-ts4900-quad-20141224171440.rootfs.tar.bz2 ts-x11-image-ts4900-solo-20141224175107.rootfs.tar.bz2
  • Updated Kernel
    • Fixed ISL RTC errors hardware builds that omit the RTC
    • Fixed I2C bus for 8390 ADC
    • Added small pop fix for sgtl5000 on the 8390
  • Updated ts4900-utils
    • New util 8390adc for reading the low speed MCP ADC
    • Fixed tshwctl to support auto TX-EN RS485 on ttymxc1
ts-x11-image-ts4900-quad-20150331224909.rootfs.tar.bz2 ts-x11-image-ts4900-solo-20150401003538.rootfs.tar.bz2
  • Updated to 3.10.53 kernel
    • Significant fixes to GPU, UARTs, CAN and more.
    • Added TS-TPC-8950 support
    • Fixed 7" twinkling pixels on TS-8390 w/solo
    • Included splash screen
  • Updated to Yocto Dizzy for new freescale GPU support
  • Added Chromium to default image (google-chrome)
  • Updated toolchain to match dizzy image
  • Included gstreamer in the image
  • Updated FPGA with crossbar, max3100 based spi uart, bluetooth fixes (REV C only)
ts-x11-image-ts4900-quad-20150527173205.rootfs.tar.bz2 ts-x11-image-ts4900-solo-20150528210615.rootfs.tar.bz2
  • Fixed networkd
  • Enabled PCIe in default kernel
    • Added I210 support for TS-7970
ts-x11-image-ts4900-quad-20150620060219.rootfs.tar.bz2 ts-x11-image-ts4900-solo-20150622150127.rootfs.tar.bz2
  • Added TS-7970 support
ts-x11-image-tsimx6-20150821190815.rootfs.tar.bz2
  • Updated to Yocto Fido
    • Removed GTK3 packages to reduce image size (GTK2 still available)
    • Removed distcc from default environment
    • Includes QT 5.4.3
    • Included qtmultimedia, xcursor-transparent theme
  • Updated Kernel
    • Includes fix for rare screen flip issues
ts-x11-image-tsimx6-20150821190815.rootfs.tar.bz2
  • Included significantly fixed support for the TS-7970
    • I210 support is fixed, but some prototype boards will need to be RMA'd to get MACs assigned.
    • All UARTs are now working
    • Included tsmicroctl for reading the silabs ADC (p10-12 4-20mA included)
    • Included load_fpga for software reloading fpgas later after boot
  • Updated TS-4900 FPGA to have CTS/RTS fixed for bluetooth, and corrected CTS/RTS polarity on the max3100s
ts-x11-image-tsimx6-20151014183028.rootfs.tar.bz2
  • Corrected defconfig used in kernel
    • Fixed WIFI and other modules
  • If used with the u-boot release from 10-14-2015 this fixes the mac address for the smsc95xx
ts-x11-image-tsimx6-20151221232637.rootfs.tar.bz2
  • Fixed MAC address to use device tree as well as parameter for the latest u-boot support.
  • Fixed tsgpio driver which was causing some incorrect DIO sets.
    • The WIFI driver uses tsgpio for toggling the enable which also corrects the behavior of ifdown/ifup wlan0.
  • Added rsync and lighttpd-cgi support
ts-x11-image-tsimx6-20160512161729.rootfs.tar.bz2
  • Added 100kohm pullups to the onboard/offboard SPI chip selects.
ts-x11-image-tsimx6-20161116215413.rootfs.tar.bz2
  • Updated to Yocto Jethro
  • Updates to QT 5.5
  • Updated to 4.1.15 based on Freescale/NXP's imx_4.1.15_1.0.0_ga.
  • Added improved support for TS-TPC-7990
  • New tshwctl with crossbar support.
ts-x11-image-tsimx6-20170301225516.rootfs.tar.bz2
  • Updated to Yocto Morty 2.2.1 with the same imx_4.1.15_1.0.0_ga kernel
  • Includes QT 5.7.1
  • Included additional alsa utilities
ts-x11-image-tsimx6-20170731205110.rootfs.tar.bz2
  • Updated to Morty 2.2.2
  • Included QT Quick 1.x/2.x support
  • Added support for TS-TPC-7990 REV C in kernel and ts4900-utils
  • Updated kernel
    • Fixed issue with ttyMAX* UARTs losing data or requiring the user to transmit before it continues to receive again
    • Fixed issue with ttyMAX* loopbacks dropping the first character
    • Added wilc3000 support for TS-TPC-7990 REV C WIFI

15.5.2 Debian Changelog

Image Changes
debian-armhf-wheezy-20140929.tar.bz2
  • Initial Release
debian-armhf-wheezy-20141125.tar.bz2
  • Updated kernel with significant fixes, see github for more information.
  • Included first TS-7970 FPGA
debian-armhf-jessie-20160825.tar.bz2
  • New kernel - 3.10.53 (from freescale's 3.10.53_1.1.0_ga) instead of 3.10.17.
    • Fixed CAN dropped frames (just under 1% of frames were dropped on 3.10.17)
    • Fixed reported UART RX fifo overflows
    • GPU fixes
    • Kernel includes compiled in splash screen for quick graphical response on boot
  • TS-TPC-8950 support added
  • New FPGA (crossbar added, bluetooth fixed, and max3100 implemented)
  • Added bluez, wireless-tools, usbutils, nfs-common, and pciutils into the image.
  • Added Openssh server (generates on first boot)
debian-armhf-jessie-20150526.tar.bz2
  • First update to Debian Jessie
debian-armhf-jessie-20151008.tar.bz2
  • Included kernel support for TS-7970 REV A
  • Updated to latest TS-4900 FPGA (20150603)
  • Included openssh, generates keys on first boot. Remove /etc/ssh/*key* to regenerate.
  • Included latest ts4900-utils with TS-7970 support.
debian-armhf-jessie-20160512.tar.bz2
  • Fixed TS-7970 ttyMAX uarts (requires FPGA update)
  • Fixed resolv.conf symlink to use resolvd
  • Updated to 3.14.52 kernel
  • Corrected TS-TPC-8950 calibration
debian-armhf-jessie-20160512.tar.bz2
  • Moved to 4.1.15 kernel
  • Updated Debian to latest Jessie changes
  • Added latest ts4900-utils with improved TS-TPC-7990 support.
debian-armhf-jessie-20170123.tar.bz2
  • Added support for TS-7970 REV D hardware
  • Added support for TS-7990 REV B hardware
debian-armhf-jessie-20170306.tar.bz2
  • Fixed resolv.conf symlink
  • Added nfs-common
  • Cleaned up old temporary files
debian-armhf-jessie-20170327.tar.bz2
  • Fixed regression in TS-TPC-8950 support
  • Adds root.version to list image date
debian-armhf-jessie-20170419.tar.bz2
  • Fixed issue of missing U-boot splash screen disabling the backlight on REV B boards.
  • Fixed potential issue with WIFI not being recognized.
  • Added support for #TS-DC799-SILO board.
debian-armhf-jessie-20170731.tar.bz2
  • Added support for TS-TPC-7990 REV C in kernel and ts4900-utils
  • Updated kernel
    • Fixed issue with ttyMAX* UARTs losing data or requiring the user to transmit before it continues to receive again
    • Fixed issue with ttyMAX* loopbacks dropping the first character
    • Added wilc3000 support for TS-TPC-7990 REV C WIFI

15.5.3 Arch Linux Changelog

Image Changes
arch-armhf-20140929.tar.gz Initial Release

15.5.4 Ubuntu Linux Changelog

Image Changes
ubuntu-armhf-16.04-20160407.tar.bz2
  • Initial Release
ubuntu-armhf-16.04-20160818.tar.bz2
  • Bumped from 3.14.52 to 4.1.15 kernel. This adds support for the TS-TPC-7990.
  • Added more common packages, mmc, can-utils, etc.
ubuntu-armhf-16.04-20170306.tar.bz2
  • Updated ts4900-utils for final TS-7970/TS-TPC-7990
  • Added TS-TPC-7990 REV B support

16 Product Notes

16.1 FCC Advisory

This equipment generates, uses, and can radiate radio frequency energy and if not installed and used properly (that is, in strict accordance with the manufacturer's instructions), may cause interference to radio and television reception. It has been type tested and found to comply with the limits for a Class A digital device in accordance with the specifications in Part 15 of FCC Rules, which are designed to provide reasonable protection against such interference when operated in a commercial environment. Operation of this equipment in a residential area is likely to cause interference, in which case the owner will be required to correct the interference at his own expense.

If this equipment does cause interference, which can be determined by turning the unit on and off, the user is encouraged to try the following measures to correct the interference:

Reorient the receiving antenna. Relocate the unit with respect to the receiver. Plug the unit into a different outlet so that the unit and receiver are on different branch circuits. Ensure that mounting screws and connector attachment screws are tightly secured. Ensure that good quality, shielded, and grounded cables are used for all data communications. If necessary, the user should consult the dealer or an experienced radio/television technician for additional suggestions. The following booklets prepared by the Federal Communications Commission (FCC) may also prove helpful:

How to Identify and Resolve Radio-TV Interference Problems (Stock No. 004-000-000345-4) Interface Handbook (Stock No. 004-000-004505-7) These booklets may be purchased from the Superintendent of Documents, U.S. Government Printing Office, Washington, DC 20402.

16.2 Limited Warranty

Technologic Systems warrants this product to be free of defects in material and workmanship for a period of one year from date of purchase. During this warranty period Technologic Systems will repair or replace the defective unit in accordance with the following process:

A copy of the original invoice must be included when returning the defective unit to Technologic Systems, Inc. This limited warranty does not cover damages resulting from lightning or other power surges, misuse, abuse, abnormal conditions of operation, or attempts to alter or modify the function of the product.

This warranty is limited to the repair or replacement of the defective unit. In no event shall Technologic Systems be liable or responsible for any loss or damages, including but not limited to any lost profits, incidental or consequential damages, loss of business, or anticipatory profits arising from the use or inability to use this product.

Repairs made after the expiration of the warranty period are subject to a repair charge and the cost of return shipping. Please, contact Technologic Systems to arrange for any repair service and to obtain repair charge information.