How to Build Applications with QTCreator and Yocto SDK

This application note will guide you through the steps needed, to integrate a Yocto SDK to QTDesigner.
The QTDesigner can be used to cross-compile QTApplications, deploy and debug directly on the target platform.
The used platform is the NXP i.MX8M Mini based Trizeps VIII Mini or Myon II.

Build Yocto Image an SDK

First, you have to build a Yocto Image with QT and sftp-server (needed by QTDesigner to deploy applications).
You need to build the project fsl-image-qt5-validation-imx, but before you have to add the sftp feature.
Create project:

DISTRO=fsl-imx-wayland MACHINE=imx8mm_trizeps8mini source fsl-setup-release.sh -b build-wayland

After creating the project folder please edit the conf/local.conf:

EXTRA_IMAGE_FEATURES ?= "debug-tweaks openssh-sftp-server"

Now you can start the Image compilation with bitbake:

bitbake fsl-image-qt5-validation-imx

The first build process depending on the build machine takes a long time.

When the process finish you can also build the SDK you will need:

You will find the image at <build-dir>/tmp/deploy/images and the
SDK at <build-dir>/tmp/deploy/sdk/<image-name>-<host-arch>-<distro-version>-toolchain.sh

Deploy Image

The detailed deploy process you can find here: deploy_image After first boot you have to change the /etc/ssh/sshd_config. Please modify the following line and restart service or device:

Install SDK

You can easily install the SDK with root permissions:

Also you can find a prebuilt SDK: Software-Development-Kit

Install QTCreator

On Ubuntu or similar you can install the QTCreator with the packet manager (This application note is based on 18.04.1-Ubuntu) :

Configure QTCreator

  1. Setup a device for ssh connection and sftp download

You can use the wizard and the the device.

  1. Add the cross-compiler

Add cross-compiler:

  1. Add GDP debugger:

  1. Add QMake:

  1. Add Kit:

Create Sample Project

  1. create a new project using the „Qt Widgets Application“ template

  2. use the just created „Yocto Cross-compile x86 64bit“ Kit

  3. add the deploy settings to *.pro file

How to Build Applikations with QTCreator and Yocto SDK for Debian 10

To use the configuration for Debian 10 (buster) DEBIAN 10 (buster) you have also follow the next steps:

  1. Install Debian 10

Follow the steps to install Debian DEBIAN 10 (buster).

  1. Install QT5

Add qt5 to Debian

  1. Modify Project

Modify the configuration of QTCreator. Projects→Run→Run Environment

To Run and Build you have to change the settings in *.pro