...
...
...
simple Qt Widget application debugging session.
Make sure that all Qt Creator setup steps are already done up to [I 7.5.1 Developing with Qt Creator]
...
What is the QT Creator
The Qt Creator is a cross-platform IDE to develop and debug Qt Applications. It can be used to directly deploy and debug applications on a SECO device.
https://www.qt.io/product/development-tools
Install Linux
If you are not already working on a linux system, you have to set up such a system. You could do this via Virtual Box or via WSL (Windows Subsystem for Linux) for example. The installation is described in the following links:
By default, the installed Linux distribution in wsl will be Ubuntu. To list all available distributions you can use the command wsl --list --online
or wsl -l -o
. To install additional Linux distributions after the initial installation the command wsl --install -d <Distribution Name>
is used. You can switch between installed distributions with wsl --setdefault <Distribution Name>
.
This document was written using Ubuntu 24.04.
Info |
---|
When using wsl commands inside a Linux/bash instead of a powershell/command prompt use wsl.exe instead of wsl. |
You may also install build-essentials for providing gcc and make.
Code Block | ||
---|---|---|
| ||
$ sudo apt install build-essential |
Be sure that ssh is installed. Otherwise install it:
Code Block |
---|
$ sudo apt install ssh |
Install Qt Creator
Use following command to install Qt Creator:
Code Block |
---|
$ sudo apt install qtcreator |
Get and source the Yocto SDK
To build and debug qt applications on seco devices you have to install the appropriate SDK on your linux system. The SDK is available for download with every release, see Kirkstone
To install the SDK use following command:
Code Block |
---|
$ sh <SDK location>/seconorth-wayland-glibc-x86_64-seconorth-image-cortexa9t2hf-neon-seco-mx6-toolchain-kirkstone-21.1-14-g09e947c.sh |
The installer will ask you if you want to install the SDK into a subfolder in /opt. Supposed this is what you want press the y key. Example output:
Code Block |
---|
SECO Northern Europe Wayland Distro SDK installer version kirkstone-21.1-14-g09e947c
====================================================================================
Enter target directory for SDK (default: /opt/seconorth-wayland/kirkstone-21.1-14-g09e947c):
The directory "/opt/seconorth-wayland/kirkstone-21.1-14-g09e947c" already contains a SDK for this architecture.
If you continue, existing files will be overwritten! Proceed [y/N]? |
After installing you have to source the SDK envirement like in the following example:
Code Block |
---|
$ source /opt/gufseconorth-wayland/GUF-Yocto-rocko-12.5-0-IMX6GUF-sdkkirkstone-21.1-14-g09e947c/environment-setup-imx6gufcortexa9t2hf-neon-gufseconorth-linux-gnueabi $ make |
...
Create a new project through File->New file or project... as shown in Qt creator new project creation image.
...
Select Qt Widgets Application as shown in Qt Creator Qt Widget Application project type selection image.
...
Name the project myqtapp as shown in Qt Creator project naming image.
...
Select the cross development kit that was created and configured in [I 7.5.1 Developing with Qt Creator] as shown in Qt Creator kit selection image.
...
Leave the default widget class creation setup as shown in Qt Creator project main class information.
...
Info |
---|
For all the following steps the SDK environment has to be sourced. |
Start Qt Creator
After the installation of the qt creator, a startup script that is part of the SDK can be used to start the qtcreator development session.
Code Block |
---|
$ sh /opt/seconorth-wayland/kirkstone-21.1-14-g09e947c/start-qtcreator.sh |
When started in this way, only the IP address should need to be set .
Check Qt Creator settings
Open Edit → Preferences
...
The Kits tab should lock similar to following screenshot:
...
Get the ip address of your device and add the ip address to the Host name in the Devices tab. It is also important to set the checkmark Source /etc/profile and $HOME/.profile
.
...
If you want to use the debugger open the Debugger tab. In the GDB section add the following into the Additional Startup Commands box:
Code Block |
---|
handle SIGILL nostop |
...
6. New Qt Creator project
Follow the following pictures to create a new Qt project.
...
Do not setup any version control system as shown in Qt Creator project version control setup image.
...
...
Code Block |
---|
...
linux-* {
target.path = /tmp INSTALLS += target
}
... |
as shown in Qt Creator target installation path setup image. We select /tmp here.
...
Select Projects->Build & Run->Run>Add Deploy Step
and select Run custom remote command as shown in Qt Creator custom remote command insertion image.
...
7. Run and Debug
To run your application on the device press the green arrow. Be sure target.path is /tmp/ in the .pro file.
...
If you use the debugger you may receive an error message. Add following lines to Projects → Run → Environment:
Code Block |
---|
XDG_RUNTIME_DIR=/run/user/1000
WAYLAND_DISPLAY=/run/wayland-0
QT_QPA_PLATFORM=wayland |
...
For more information about Qt Creator debugging consult the debugging part of the reference manual
If you want to stop the SECO demo application, select Projects → Build & Run → Run → Add Deploy Step and select Run custom remote command as shown in the image above.
...
Add command as shown as in the image above:
Code Block |
---|
systemctl stop seco-show-demo |
as shown in [I Figure 35] to make sure that the automatically Seco NE demo is stopped if it’s running.
From [I Figure 35] we can further see, that the remote installation directory we set up previously is now known under Files to Deploy:.
...
Now, set up a breakpoints shown in Qt Creator breakpoint setup image by right clicking the desired line through the context menu.
...
Finally, debugging can be started as shown in the above image.
...