TS-4900 QT5 IDE Setup: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 1: Line 1:
{{Note|This guide is intended for our stock image using systemd, but you are using a custom images the directions should apply if you rebuild with your own yocto toolchain (meta-toolchain-qt5), and update the paths if you are using a different distribution.}}
{{Note|This guide is intended for our stock 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 qtcreator.  The version from a recent Linux distribution should be fine.  In a debian/Ubuntu desktop, run:
Install qtcreator.  The version from a recent Linux distribution should be fine.  In a debian/Ubuntu desktop, run:
Line 17: Line 17:
These instructions assume the path will be default at "/opt/poky/2.0.2/".
These instructions assume the path will be default at "/opt/poky/2.0.2/".


Once the SDK is installed, an environment script has to be sourced ***every time*** before launching qtcreator.
An environment script has to be sourced ***every time*** before launching qtcreator.  Without this builds will fail.
<source lang=bash>
<source lang=bash>
source /opt/poky/2.0.2/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
source /opt/poky/2.0.2/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
qtcreator
qtcreator
</source>
</source>
{{Note|QtCreator needs to be launched with this sourced every time the cross toolchain is used or it will fail with compile errors.}}


Next we need to configure QT Creator to build using this toolchain.  When QT creator launches and go to Tools->Options, and select Devices. Click "Add" and select "Generic Linux Device" and click "Start Wizard".
Next we need to configure QT Creator to build using this toolchain.  When QT creator launches and go to Tools->Options, and select Devices. Click "Add" and select "Generic Linux Device" and click "Start Wizard".
Line 29: Line 27:
| [[File:qtdeviceconfiguration.png|300px|right|QT Device Configuration]]  
| [[File:qtdeviceconfiguration.png|300px|right|QT Device Configuration]]  
|}
|}
On the next page you will need to specify the ip address or hostname to the system. This could potentially change depending on your network, so if it fails to deploy code later this may need to be updated to point at a new IP for your TS board.  In this example, my board has a dhcp address of 192.168.2.45.  The default Yocto image will use "root" with no password to connect.  Set the name to TS-IMX6.
On the next page specify the ip address or hostname to the system.   In this example, the board has a dhcp address of 192.168.2.45.  The default Yocto image will use "root" with no password to connect.  Set the name to TS-IMX6.


{|  
{|  
| [[File:qtnewdevice.png|300px|right|QT Device Configuration]]  
| [[File:qtnewdevice.png|300px|right|QT Device Configuration]]  
|}
|}
It will then verify connectivity.  You can click close and continue.
It will then verify connectivity.  Click close and continue.
{|  
{|  
| [[File:qtdevicetest.png|300px|right|QT Device Test]]  
| [[File:qtdevicetest.png|300px|right|QT Device Test]]  
Line 40: Line 38:


{{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.
{{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 manually may also resolve this issue.}}
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 your host pc for the correct values}}
{{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}}


Next, in the left column of the Options menu, select "Build & Run".  Start with the "QT Versions" tab, and click "Add" in the upper right to configure the TS Kit.  Some versions of QT creator will automatically see the "qmake" binary added to your path from the sourced environment script.  Either use this, or add it in manually, but change the version string to include "TS-IMX6" so it can be recognized when setting the right binary for the kit.
Next, in the left column of the Options menu, select "Build & Run".  Start with the "QT Versions" tab, and 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.  Either use this, or add it in, but change the version string to include "TS-IMX6".  This will allow it to be recognized when setting the right binary for the kit.
{|  
{|  
| i686
| i686
Line 90: Line 88:
|}
|}


At this point QT Creator is set up to begin your first project.
At this point QT Creator is set up to begin a hello world project.

Revision as of 16:19, 10 February 2017

Note: This guide is intended for our stock 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 qtcreator. The version from a recent Linux distribution should be fine. In 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.0.2/".

An environment script has to be sourced ***every time*** before launching qtcreator. Without this builds will fail.

source /opt/poky/2.0.2/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
qtcreator

Next we need to configure QT Creator to build using this toolchain. When QT creator launches and go to Tools->Options, and select Devices. Click "Add" and select "Generic Linux Device" and click "Start Wizard".

QT Device Configuration

On the next page specify the ip address or hostname to the system. In this example, the board has a dhcp address of 192.168.2.45. The default Yocto image will use "root" with no password to connect. Set the name to TS-IMX6.

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

Next, in the left column of the Options menu, select "Build & Run". Start with the "QT Versions" tab, and 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. Either use this, or add it in, but change the version string to include "TS-IMX6". This will allow it to be recognized when setting the right binary for the kit.

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

Next go to the "Compilers" tab, and click "Add", and select "GCC". Set the Name to "TS-IMX6 GCC". For the "Compiler Path":

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

Next, go to the Debuggers tab, and click "Add". For name, specify "TS-IMX6 GDB". For the paths, specify the location of gdb:

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

Next, go to the "Kits" tab and click add. For Name, enter "TS-IMX6". Set device type to "Generic Linux Device". Set the device to "TS-IMX6 (default for Generic Linux)". Set the sysroot to:

 /opt/poky/2.0.2/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi

Set the compiler to "TS-IMX6 GCC". Set Debugger to "TS-IMX6 GDB". Set the QT version to "Qt 5.4.3 (TS-IMX6)". Finally, click Apply.

QT Kit tab

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