Images SDKs Wiki


Installing SDK

Host recommendations

This Wiki page PC Host Installation is written for Ubuntu 16.04 LTS (64-bit) Linux distribution (recommended with LinRT BSP), for other Linux distributions, see Yocto Project 2.4 documentation

  • 4 CPUs cores minimum
  • RAM 4GB minimum, 8GB recommended
  • 1 GB minimum free Hard Disk space for LinRT SDK install

SDK Installer script

SDK installer script is located into folder <YOCTO_BSP_DIR>/<BUILD_DIR>//tmp/deploy/sdk/

For example with Helium KMS BSP for linrt-tiny-video-capture-qt5 image :

PC-HOST$ cd ~/yocto/build/tmp/deploy/sdk/
PC-HOST$ ls *.sh
helium-kms-glibc-x86_64-linrt-tiny-video-capture-qt5-image-armv7at2hf-neon-toolchain-2.4.2.sh

If you have downloaded the SDK installer script, make it executable :

PC-HOST$ cd ~/Downloads
Download$ chmod +x helium-kms-glibc-x86_64-linrt-tiny-video-capture-qt5-image-armv7at2hf-neon-toolchain-2.4.2.sh

Install the SDK by running the script and accepting the defaults :

PC-HOST$ ./helium-kms-glibc-x86_64-linrt-tiny-video-capture-qt5-image-armv7at2hf-neon-toolchain-2.4.2.sh 
Helium KMS SDK installer version 2.4.2
======================================
Enter target directory for SDK (default: /opt/helium-kms/2.4.2): 
You are about to install the SDK to "/opt/helium-kms/2.4.2". Proceed[Y/n]? 
Extracting SDK..............................................................................................................................................
...........................................................................................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /opt/helium-kms/2.4.2/environment-setup-armv7at2hf-neon-linrt-linux-gnueabi

Using SDK 

Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

PC-HOST$ . /opt/helium-kms/2.4.2/environment-setup-armv7at2hf-neon-linrt-linux-gnueabi

When you run the setup script, many environment variables are defined:

SDKTARGETSYSROOT – The path to the sysroot used for cross-compilation
PKG_CONFIG_PATH – The path to the target pkg-config files
CONFIG_SITE – A GNU autoconf site file preconfigured for the target
CC – The minimal command and arguments to run the C compiler
CXX – The minimal command and arguments to run the C++ compiler
CPP – The minimal command and arguments to run the C preprocessor
AS – The minimal command and arguments to run the assembler
LD – The minimal command and arguments to run the linker
GDB – The minimal command and arguments to run the GNU Debugger
STRIP – The minimal command and arguments to run ‘strip’, which strips symbols
RANLIB – The minimal command and arguments to run ‘ranlib’
OBJCOPY – The minimal command and arguments to run ‘objcopy’
OBJDUMP – The minimal command and arguments to run ‘objdump’
AR – The minimal command and arguments to run ‘ar’
NM – The minimal command and arguments to run ‘nm’
TARGET_PREFIX – The toolchain binary prefix for the target tools
CROSS_COMPILE – The toolchain binary prefix for the target tools
CONFIGURE_FLAGS – The minimal arguments for GNU configure
CFLAGS – Suggested C flags
CXXFLAGS – Suggested C++ flags
LDFLAGS – Suggested linker flags when you use CC to link
CPPFLAGS – Suggested preprocessor flags

To verify if your shell session is set with SDK environment setup script :

PC-HOST$ echo $CC
arm-linrt-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/opt/helium-kms/2.4.2/sysroots/armv7at2hf-neon-linrt-linux-gnueabi

SDK setup for external kernel modules building (optional)

LinRT SDK provides build Linux Kernel Headers for the target platform. To set up the exported Linux kernel tool scripts to build external kernel modules, you need to finalize SDL install as :

PC-HOST$ sudo -s
PC-HOST# apt-get install libssl-dev
PC-HOST# . /opt/helium-kms/2.4.2/environment-setup-armv7at2hf-neon-linrt-linux-gnueabi 
PC-HOST# make -C/opt/helium-kms/2.4.2/sysroots/armv7at2hf-neon-linrt-linux-gnueabi/usr/src/kernel/ silentoldconfig scripts
...
 
PC-HOST# exit
PC-HOST$

Using Eclipse IDE

Installing Eclipse IDE

Check java JRE version at least 1.8 installed on the host, and install it if necessary :

PC-HOST$ java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Download Eclipse Oxygen for C/C++ developers and extract it on /opt folder

PC-HOST$ cd ~/Download
PC-HOST$ sudo tar -C /opt -xvf eclipse-cpp-oxygen-3a-linux-gtk-x86_64.tar.gz

Launch Eclipse IDE

Each time you wish to use Eclipse IDE with the SDK in a new shell session, you need to source the environment setup script e.g.

PC-HOST$ . /opt/helium-kms/2.4.2/environment-setup-armv7at2hf-neon-linrt-linux-gnueabi
PC-HOST$ /opt/eclipse/eclipse

Select a new workspace (you can just click OK).
From the “Help” menu, choose “Install New Software”

In the “Work with” area select “Oxygen – http://download.eclipse.org/releases/oxygen”.
⊗ Uncheck the “Hide items that are already installed”
⊕ Check the “Linux Tools” option
⊕ Expand the ” Performance, Profiling and Tracing Tools” option and select:

⊗ GDB Tracepoint Analysis
⊗ LTTng Kernel Analysis
⊗ LTTng Userspace Analysis

LinRT Eclipse IDE Setup for SDK

LinRT Eclipse IDE Setup for SDK

⊕ Expand the “Mobile and Device Development” option and select:

⊗ C/C++ Remote Launch
⊗ Remote System Explorer End-user Runtime
⊗ Remote System Explorer User Actions
⊗ TCF Remote System Explorer add-in
⊗ TCF Target Explorer
⊗ TM Terminal

LinRT Eclipse IDE Setup for SDK

LinRT Eclipse IDE Setup for SDK

⊕ Expand the “Programming Languages” option and select:

⊗ C/C++ Autotools Support
⊗ C/C++ Development Tools

LinRT Eclipse IDE Setup for SDK

LinRT Eclipse IDE Setup for SDK

Click Next twice, accept the necessary EULA and click Finish.
If asked if you trust the Eclipse certificates, make sure you select the certificates and click OK.
And click to restart Eclipse when asked to.

Work without Yocto Plug-in to the Eclipse IDE

Each time you wish to use Eclipse IDE with the SDK in a new shell session, you need to source the environment setup script e.g.

PC-HOST$ . /opt/helium-kms/2.4.2/environment-setup-armv7at2hf-neon-linrt-linux-gnueabi
PC-HOST$ /opt/eclipse/eclipse

Set a New Project with an existing Makefile :

PC-HOST$ cd ~/Download
PC-HOST$ sudo tar -C /opt -xvf eclipse-cpp-oxygen-3a-linux-gtk-x86_64.tar.gz

Adding the Yocto Plug-in to the Eclipse IDE

To use the Yocto Plug-in, append the following to the conf/local.conf file in your Yocto build directory:

PC-HOST$ nano yocto/build/conf/local.conf
 
...
EXTRA_IMAGE_FEATURES = " \
   debug-tweaks \
   tools-debug \
   eclipse-debug \
"
 
IMAGE_INSTALL_append = " \
   tcf-agent \
   openssh-sftp-server \
"

And bitbake your image.

In Eclipse, select “Install new Software” from the “Help” menu.
Click the “Add…” button to add a repository, enter the following and click OK.

Name: Yocto Rocko
Location: “http://downloads.yoctoproject.org/releases/eclipse-plugin/2.4.2/oxygen/”

LinRT Eclipse IDE Setup for SDK

LinRT Eclipse IDE Setup for SDK

Make sure the repository above is selected on the “Work with” drop-down menu and select the following plug-ins from the list:

⊗ Yocto Project SDK Plug-in
⊗ Yocto Project Documentation plug-in

LinRT Eclipse IDE Setup for SDK

LinRT Eclipse IDE Setup for SDK

Click Next twice, accept the necessary EULA and click Finish.
And click to restart Eclipse when asked to.

Configuring the Yocto Plug-in for Eclipse

In this section we will configure the Cross Compiler and the Target options. These will then be used as default for your projects from within your workspace.

Select “Preferences” from the “Window” menu.

⊗ Click on “Yocto Project SDK” from the left options
Under “Cross Compiler Options:” select the “Standalone pre-built toolchain” radio button.

⊗ Under “Toolchain Root Location:” enter “/opt/helium-kms/2.4.2” (for this example!)
⊗ Under “Sysroot Location:” enter “/opt/helium-kms/2.4.2/sysroots/armv7at2hf-neon-linrt-linux-gnueabi”
⊗ Under “Target Options:” make sure “External HW” is selected.

And click on OK button.

LinRT Eclipse IDE Setup for SDK

LinRT Eclipse IDE Setup for SDK

Note : In case of error message “Specified toolchain directory does not contain a toolchain generated with “bitbake meta-ide-support”, be sure that “Standalone pre-built toolchain” radio button is checked !

Work with Yocto Plug-in to the Eclipse IDE

Create a new Project

You can create two types of projects: Autotools-based, or Makefile-based. This section describes how to create Autotools-based projects from within the Eclipse IDE. To create a project based on a Yocto template and then display the source code, follow these steps:

File->New->C Project
Click “Yocto Project ADT Autotools Project”.
Select “Hello World ANSI C Autotools Project”. This is an Autotools-based project based on a Yocto template.

Enter a name for the project under the “Project name” field. Do not use hyphens as part of the name.
Click “Next”.
Add information in the Author field and make sure the License field is correct.
Click “Finish”.
Click on “Workbench”.

 

You should now be in the C/C++ perspective. The left-hand navigation pane shows your project. You can display your source by double clicking the project’s source file.
Hit Ctrl+B or click the hammer icon to build your project.

Create communication link

Using the console of your target set a password with “passwd” command. choose a simple one named “root”.
The target should be connected to the network via Ethernet or WIFI.
Use the “ifconfig” command on the target to get its IP address.
From Eclipse:

Window->Open Perspective->Other
Double click on Remote System Explorer

 

In the left bar right click and New->Connection
Choose TCF and click Next

Set the Host name to the target’s IP address and click Finish

On the left bar right click on the target IP and select connect
Set “User ID:” to root, “Password:” to root and check the “Save password”
Enter the root password again in the next poop up.
Once connected you can browse the target file system, browse target process and lunch a terminal to the target.

Remote debug

Follow the below steps to remotely debug your application on the TARGET.

Select “Debug Configurations…” from the “Run” menu.
In the left area, expand C/C++ Remote Application.
Locate your project and select it to pop up a new tabbed view in the Debug Configurations Dialog.
Enter the absolute path which you want to deploy the application to. Use the “Remote Absolute File Path for C/C++Application:” field. For example, enter /home/root/hello
Click on the “Debugger” tab to see the cross-tool debugger you are using.

 

Check the lower red rectangle contents and be sure that the selected launcher is the “Automatic Remote Debugger Launcher”
If any other launcher is selected:
copy to clipboard the contents of upper red rectangle
select “Automatic Remote Debugging Launcher” in the lower red rectangle
paste from the clipboard to reset the contents of the upper red rectangle
remember that the debugger path is expected to be something like /opt/helium-kms/2.4.2/sysroots/x86_64-linrtsdk-linux/usr/bin/arm-linrt-linux-gnueabi/arm-linrt-linux-gnueabi-gdb
Click on the “Main” tab.
Hit Debug
Accept the debug perspective.

 

 

You can now run and debug your program via eclipse. The actual program execution is done on the target, and the output is seen on the Remote Shell on Eclipse.

Using Qt Creator IDE

QtCreator installation

You can download and install a suitable version of QtCreator from :

PC-HOST$ wget http://download.qt.io/official_releases/qtcreator/4.5/4.5.2/qt-creator-opensource-linux-x86_64-4.5.2.run
PC-HOST$ chmod +x qt-creator-opensource-linux-x86_64-4.5.2.run
PC-HOST$ ./qt-creator-opensource-linux-x86_64-4.5.2.run

QtCreator configuration

Each time you wish to use QtCreator IDE with the SDK in a new shell session, you need to source the environment setup script e.g.

PC-HOST$ . /opt/helium-kms/2.4.2/environment-setup-armv7at2hf-neon-linrt-linux-gnueabi
PC-HOST$ qtcreator

Device configuration

Go to Tools => Options.
In the left panel, click on Devices
Add a new device representing the target (e.g. “Mira”) :
Press Add and choose Generic Linux Device
Specify a name (e.g. Mira)
Fill in the device’s IP address.
Please consider using fixed IP adresses: DHCP server lease timeout could lead to unreachable devices.
Authentication on our modules by default: Password, User “root”, empty password

Debugger configuration

Go to Tools => Options
In the left panel, click on Build&Run.
Click on the Debuggers tab
Press Add
Specify a name (e.g. Mira GDB)
Specify the path: /opt/helium-kms/2.4.2/sysroots/x86_64-linrtsdk-linux/usr/bin/arm-linrt-linux-gnueabi/arm-linrt-linux-gnueabi-gdb

GCC Compiler configuration

Go to Tools => Options
In the left panel, click on Build&Run.
Click on the Compilers tab
Press Add
Specify a name (e.g. Mira GCC)
Specify the path: /opt/helium-kms/2.4.2/sysroots/x86_64-linrtsdk-linux/usr/bin/arm-linrt-linux-gnueabi/arm-linrt-linux-gnueabi-gcc
ABI: select arm-linux-generic-elf-32bit

G++ Compiler configuration

Go to Tools => Options
In the left panel, click on Build&Run.
Click on the Compilers tab
Press Add
Specify a name (e.g. Mira G++)
Specify the path: /opt/helium-kms/2.4.2/sysroots/x86_64-linrtsdk-linux/usr/bin/arm-linrt-linux-gnueabi/arm-linrt-linux-gnueabi-g++
ABI: select arm-linux-generic-elf-32bit

CMAKE configuration

Go to Tools => Options
In the left panel, click on Build&Run.
Click on the CMake tab
Press Add
Specify a name (e.g. Mira CMake)
Specify the path: /opt/helium-kms/2.4.2/sysroots/x86_64-linrtsdk-linux/usr/bin/cmake

QT version configuration

Go to Tools => Options
In the left panel, click on Build&Run.
Click on the QT Version tab
Press Add
Specify a name (e.g. Mira QT 5.x)
Specify the path: /opt/helium-kms/2.4.2/sysroots/x86_64-linrtsdk-linux/usr/bin/qt5/qmake

Kit configuration

Go to Tools => Options
In the left panel, click on Build & Run.
Click on the Kits tab
Press Add
Name: Mira
Device: Mira
Sysroot: /opt/helium-kms/2.4.2/sysroots/armv7at2hf-neon-linrt-linux-gnueabi
Compiler: Mira GCC
Debugger: Mira GDB
Qt version: Mira QT 5.x
Qt mkspec: leave empty or set to linux-oe-g++ if cross-compilation fails

Application deploying

When you run the application, Qt Creator copies the necessary files to the device and starts the application on it.

Qt Project settings

In your .pro file, remember to add the following lines to allow QT creator knowing where executable will be deployed:

target.path = /home/root
INSTALLS += target
QT_QPA_PLATFORM configuration
By default, QT_QPA_PLATFORM is set to xcb => X11 backend.

If your build use a different backend, this environment variable must be set before running the binary.

In the left panel, click on Projects

Click on the Run button of your kit in the just opened window
Scroll down till the the “Run environment” section
Click on details and add the required environment variables.
For framebuffer, set QT_QPA_PLATFORM to linuxfb

Debugging problems

In case you experience debugging problems with messages as “Debugging has failed”, please try the following steps:

Go to Tools => Options
In the left panel, click on Build&Run.
Click on the Debuggers tab
Press Add
Specify a name (e.g. Multiarch GDB)
Specify the path: /usr/bin/gdb-multiarch
Click on the Kits tab
Select your device tab
Update the debugger with the new one.
If the file /usr/bin/gdb-multiarch is missing, you can install it running

PC-HOST$ sudo apt-get install gdb-multiarch
Help-Desk