TS-4900 QT5 IDE Setup

From embeddedTS Manuals
Revision as of 17:42, 31 July 2017 by Mark (talk | contribs)
Note: This guide is intended for our stock Yocto image using systemd. On custom images the directions should apply if a toolchain is compiled. "bitbake meta-toolchain-qt5", and update the paths if you are using a different distribution.


Install the qtcreator tool on a host Linux PC. Any recent version from a modern Linux distribution should be sufficient and work without issue. On a Debian/Ubuntu desktop, run:

sudo apt-get update && sudo apt-get install qtcreator -y

You will also need to download the SDK which includes the Qt support (Right click and save as):

You can install these with:

sudo bash ./poky-*.sh

These instructions assume the path will be default at "/opt/poky/2.2.2/".


Note: An environment script has to be sourced before every execution of qtcreator. Without this, builds will fail.
source /opt/poky/2.2.2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
qtcreator


Qt Creator needs to be configured to build using this toolchain. Once Qt Creator is launched, select Tools->Options->Devices. Click "Add," select "Generic Linux Device," and then click "Start Wizard".

Qt Device Configuration

On the next page specify the IP address or hostname of the device running Yocto. In this example, the unit has an IP address of 192.168.2.45 obtained by DHCP. The default Yocto image will use "root" with no password to connect. Set the name to TSIMX6.

Qt Device Configuration

It will then verify connectivity. Click close and continue.

Qt Device Test
Note: If this returns an error: "SSH connection failure: SSH Protocol error: Server and client capabilities don't match. Client list was: aes128-cbc,3des-cbc.

Server list was chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com.". If this happens connect to the board's console and edit /etc/ssh/sshd_config and append the line "Ciphers +aes128-cbc". Reset sshd, or reboot the board and try again. Upgrading Qt Creator may also resolve this issue.

Note: The paths given in the images may not match the latest toolchain, but are meant to show where these values would go. Follow the text appropriate to the architecture of your host PC for the correct values


In the left column of the Options menu, select "Build & Run". On the "Qt Versions" tab, click "Add" in the upper right to configure the TS Kit. Qt Creator may see the "qmake" binary added to your path from the sourced environment script. If this is detected add in the string "TSIMX6" to the title. If not, add the full path and ensure the version name is set to "TSIMX6 QT 5.7.1". This will allow it to be recognized when setting the right binary for the kit.

i686
/opt/poky/2.2.2/sysroots/x86-pokysdk-linux/usr/bin/qt5/qmake
x86_64
/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
Qt Versions tab


On the "Compilers" tab click "Add", and select "GCC". Set the Name to "TSIMX6 GCC". For the "Compiler Path" use one of the following:

i686
/opt/poky/2.2.2/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
x86_64
/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
Qt Compiler tab

On the "Debuggers" tab click "Add". For name, specify "TSIMX6 GDB". For the paths, specify the location of gdb with one of the following:

i686
/opt/poky/2.2.2/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
x86_64
/opt/poky/2.2.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
Qt Debugger tab

On the "Kits" tab click "Add". For "Name", enter "TSIMX6". Set device type to "Generic Linux Device". Set the device to "TSIMX6 (default for Generic Linux)". Set Qt mkspec to:

/opt/poky/2.2.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++

Make sure there is no space at the end.

Set "Compiler" to "TSIMX6 GCC". Set "Debugger" to "TSIMX6 GDB". Set the "Qt version" to "TSIMX6 QT 5.7.1". Finally, click Apply.

Qt Kit tab
Note: If there is a red exclamation point over the kits icon, it indicates that the compiler ABI does not match. In this case, you will need to revisit the "Compiler", "Debugger", and "Qt Versions" tabs, and browse the host PC for these files manually rather than copy/pasting the paths from these instructions. This is a bug in Ubuntu 16.04's Qt Creator, and may be in later versions as well.

At this point Qt Creator is set up to begin a hello world project.