Building and running a user application (Kirkstone)

There are two general ways of building your own native application for the target: it can be built either manually, using the cross toolchain of the SDK, or integrated into the BSP, using Yocto and bitbake as a build system. Integrating the application into the BSP build process is the more complex way and useful only if you have modified the BSP and want to deploy a complete root file system image to the target anyway. For a single application, using the BSP in its original state as provided by SECO Northern Europe, the SDK is recommended to be used. The following sections describe how to build a simple Hello World! application using the SDK.

How to install our SDK


With each release, we also provide a compatible SDK. The SDK contains the cross-toolchain and several files like headers and libraries necessary to build software for SECO Northern Europe devices. It is available as download from the SECO Northern Europe support website.

The SDK can be found with each release in the corresponding folder that fit each of our device’s architecture.

Link to the releases on the support site can be found here.

The SDK file is a self-extracting archive that is supposed to run on Linux based machines. It is named likeseconorth-wayland-glibc-x86_64-seconorth-image-cortexa9t2hf-neon-seco-
mx6-toolchain-kirkstone-6.0.sh.

Run this file on your development PC:

$sh <SDK location>/seconorth-wayland-glibc-x86_64-seconorth-image-
cortexa9t2hf-neon-seco-mx6-toolchain-kirkstone-6.0.sh

The installer will ask you if you want to install the SDK into a subfolder in /opt. Press Y for yes.

For more in-depth information, refer to the official Yocto documentation here.

Simple command-line application


We will create a simple C++ "Hello World!" application that uses a Makefile and the supplied SDK. Create a directory in your home directory on the host system and change to it:

$ cd ~ $ mkdir myapp $ cd myapp

Create the empty files main.cpp and Makefile in this directory:

$ touch main.cpp Makefile

Edit the contents of the main.cpp file as follows:

#include <iostream> using namespace std; int main(int argc, char *argv[]) { cout << "Hello World!" << endl; return 0; }

Edit the contents of the Makefile as follows:

It is necessary to setup your build environment so that the compiler, headers and libraries can be found. This is done by "sourcing" a build environment configuration file. If the toolchain is installed in the default directory, this example compiles for the target system by typing

in the myapp directory. The first line configures the current shell and sets the necessary environment variables. This needs to be done when shell is opened. In a new shell/terminal window or after a reboot you need to execute it again.

After a successful build, the myapp executable is created in the myapp directory. You can transfer this application to the target system’s /usr/bin directory using one of the ways described in chapter [Accessing the target system] and execute it from the device shell. It might be necessary to change the access rights of the executable first, so that all users are able to execute it.

You can find further information about how to build applications for Yocto-based platforms here.

Qt-based GUI user application


Create a new directory in your home directory on the host system and change to it:

Create the empty files main.cpp and myqtapp.pro .

Edit the contents of the file main.cpp as follows:

Edit the contents of the file myqtapp.pro as follows:

After setting up the build environment, execute the following command to create a Makefile and build the binary in the myqtapp directory:

Now, there is the myqtapp executable in the myqtapp directory. You can transfer this application to the target system’s /usr/bin directory and run it from the device shell.