Table of Contents

Embedded module TQMa8Xx - YOCTO Linux BSP documentation

Generate QSPI bootstream

By default only the SD bootstream will be generated

SSH connection on STKa8Xx

Please keep in mind that the following instructions focus on simplicity, not on security.

For the sake of simplicity password authentification can be used for SSH.

Setup Yocto build environment

The OpenSSH sftp server is not installed into the image by default, add the following to your local.conf to install it.

IMAGE_INSTALL_append = “openssh-sftp-server”

Setup on Target

To setup a password for the default user root, execute the command passwd root and set your password.

Modify SSH configuration

Uncomment the following options in /etc/ssh/sshd_config to allow that the user root can authenticate with a password on the STKa8Xx.

PermitRootLogin yes
PasswordAuthentication yes


Setup Qt Creator with Yocto build environment

Building Yocto SDK

Building the toolchain requires a Yocto build environment configured for meta-tq or ci-meta-tq The setup of the build environment is described on the corresponding Yocto quickstart of the module.

The meta-qt5 Yocto layer has to be added to the Yocto build environment when using meta-tq

After the Yocto build environment the SDK can be built by the following command:

bitbake meta-toolchain-qt5


Building meta-toolchain-qt5 may take several hours, depending on your hardware configuration

Installing Yocto SDK

After building meta-toolchain-qt5 the SDK file is located in the following path of the build directory tmp/deploy/sdk/fsl-imx-wayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh

Execute the *sh file to install the SDK, the default path is set to /opt/fsl-imx-wayland/4.14-sumo

Set Up Qt Creator

Download Qt Opensource 5.10.1
After downloading make the Qt installer file executable and run the Qt installer. Follow the installation wizard instructions.

The next step is to add the environment setup of the Yocto SDK to the first line (above the shebang) of the file qtcreator.sh script.
If the install location has not been changed the qtcreator.sh is located in ~/Qt5.10.1/Tools/QtCreator/bin/qtcreator.sh

source /opt/fsl-imx-wayland/4.14-sumo/environment-setup-aarch64-poky-linux

Run Qt Creator

change to the directory where the qtcreator.sh file is located and execute the following command:

sudo sh qtcreator.sh

If qtcreator.sh returns source: not found, before sudo sh qtcreator.sh, enter sudo dpkg-reconfigure dash and choose no.

Configure Qt creator

Setup SSH connection

  1. Go to Tools > Options > Devices
  2. Click Add > Generic Linux Device > Start Wizard
  3. Change the name to “STKa8Xx” and set up the connection.

Click Test to test the network connection of the target device.

Add compiler

  1. Go to Tools > Options > Build & Run> click Compilers
  2. Click Add and select GCC
  3. Change Name to TQMa8Xx
  4. Set Compiler path to /opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
  5. Set the following values for ABI from the dropdwon menus:
processor architecture operating system OS flavor binary format system architecture
arm linux generic elf 64bit

Add new Cross Compiled Qt Version

  1. Click Qt Versions on the Build & Run panel
  2. Click Add
  3. Locate the qmake file in /opt/fsl-imx-wayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake

If the qmake file has been auto-detected by Qt Creator qmake has not to be added manually.

Add new Kit

  1. Click on Kits in the Build & Run panel
  2. Click Add and set the following:

Name STKa8Xx
Device Type Generic Linux Device
Device STKaXx (default for Generic Linux)
Sysroot /opt/fsl-wayland/4.14-sumo/sysroots/aarch64-poky-linux
Compiler STKa8Xx
Qt version Qt 5.10.1

Hello World Application

  • Open File menu and click New Project
  • Select Qt Console Application
  • Specify the location for the project and name it hello_world
  • Select the Kit STKa8Xx
  • Edit main.cpp
#include <QCoreApplication>
#include <iostream>
#include <stdlib.h>

using namespace std;
int main(int argc, char *argv[])
{
    QCoreApplication a(argc,argv);
    cout<<"Hello World"<<endl;
    return a.exec();
}

Starterkit Interfaces and Functions

Audio

Audio Connector Overview

Connector Function
X8 Microphone
X9 Line In
X10 Line Out

Audio Connector Location

Play Audio on

A simple test sound can be played with the commandline tool speaker-test.
Headphones or active speakers have to be connected to X10 on .

speaker-test --channels 2 --test wav -D sysdefault:CARD=tqtlv320aic32x

You can also play your own audio files using aplay

aplay <file>

e.g.

aplay test.wav 
Please notice that no audio test files are available in the default image.

Record Audio via Line-In on

arecord -f cd test.wav
The audio settings can be altered using amixer or alsamixer

Buttons

GPIO Button Overview

Reference Button

GPIO Button Location

The buttons are available in the sysfs via the device and can be tested with the evtest tool.


“|device=”/dev/input/event1“|test=“evtest /dev/input/event1”}}

CAN

CAN configuration

DIP switches SW1 and SW2 are used to configure the CAN interfaces CAN0 and CAN1.

Function SWx-1 SWx-2
CAN-Bus not terminated OFF OFF
not defined (illegal state) OFF ON
not defined (illegal state) ON OFF
CAN-Bus terminated with 120 Ohm ON ON

CAN Loopback

Loopback Test CAN Interface

CAN0 -> CAN1

candump can0&
cansend can1 5A1#11.2233.44556677.88

CAN1 -> CAN0

candump can1&
cansend can0 5A1#11.2233.44556677.88

”}}

— Template dvfs not found.

Ethernet

U-Boot

In U-Boot eth0 is configured as default interface. The IP configuration can be done statically or by a DHCP server in the network.

IP configuration via DHCP

For a configuration via a DHCP server, use the dhcp command in U-Boot.

Static IP configuration For a static IP configuration the following, U-Boot environment variables must be set:

setenv ipaddr <ipaddr> 
(e.g.: setenv ipaddr 192.168.100.111)
setenv netmask <netmask> 
(e.g.: setenv netmask 255.255.255.0)

Linux

Both Ethernet interfaces are activated and configured by systemd-network. The configuration files for the interfaces are located in /lib/systemd/network/ these configuration files can be altered to customize the default interface configuration. A documentation of the configuration files can be found here.

For a temporary static configuration the ip command can be used, below some useful ip commands are listed:

Activate a specific interface
e.g. eth0

ip link set eth0 up


Disable a specific interace
e.g. eth0

ip link set eth0 down


Show ip address for a specific interface
e.g. eth0

ip addr show eth0


Show statistic for a specific interface
e.g. eth0

 
ip -s link show eth0 


Set ip address for a specific interface
e.g. eth0

ip addr add 192.168.1.100/24 dev eth0


Show statistic of all interfaces

ip -s link


Set default gateway for a specific interfaces
e.g. set gateway ip 192.168.1.1 for eth0

ip route add default via 192.168.1.1 dev eth0

If a DHCP server is available in the network environment the ip configuration can be received from it. To do so execute the udhcpc command, by default eth0 is used.
To configure another interface via dhcp the parameter -i followed by the interface name e.g. eth1 must be given.
e.g. eth1

udhcpc -i eth1 

GPU

Run GPU benchmark with connected display and loaded device tree in fullscreen mode:

glmark2-es2-wayland --fullscreen

I2C

An overview of the onboard i2c devices is available here

U-Boot

Select i2c bus device

i2c dev 1

Show all devices connected to the i2c bus currently selected:

i2c probe

Linux

Detect all devices connected to a i2c bus:

i2cdetect 16

LVDS

TQ offers an optional LVDS Display kit for the . Each Display can be used on its own by using the corresponding device tree. To allow reusage, the support for each display is separated in a dtsi fragment.

To bring up the display the U-Boot environment has to be adapted accordingly.

  1. Interrupt boot process in U-boot
  2. Set U-Boot environment variable fdt_file with the command setenv fdt_file - Save the envrionment by executing the saveenv'' command

RTC

To set the hardware clock to the actual time and date use the following commands:

date -s [YYYY.]MM.DD-hh:mm[:ss]
hwclock -w

SPI

The has three SPI interfaces. They can be found on the extension headers and can be tested with a loopback test.

SPI Overview

Interface linux filesystem

Loopback Test SPI Interface

For the loopback test you need a bridge between SPI_MOSI and SPI_MISO:

echo -n -e "\x01\x0F" | spi-pipe -d <spi interface> -s 10000000 | hexdump
(e.g. echo -n -e "\x01\x0F" | spi-pipe -d /dev/spidev1.0 -s 10000000 | hexdump)

Temperature Sensors

USB

With lsusb you can see all connected usb devices. To mount a partition of an usb stick you can excute mount /dev/<partition> <mount dir> (e.g. mount /dev/sdb1 /mnt). This will mount the first partition of sdb to /mnt. To unmount the device execute umount <mount dir> (e.g. umount /mnt).

User LED

User LED Overview

Reference LED name color linux filesystem

User LED Location

The user LED's are located in .
To change the behaviour a specific LED, the value in the file trigger must be overwritten.

The following values are valid:

For example set the trigger of to heartbeat

echo heartbeat > 

“|location=”/sys/devices/platform/gpio-leds/leds/“|example=”/sys/class/leds/ledb/trigger“}}