TS-4900 QT5 IDE Setup: Difference between revisions

From embeddedTS Manuals
No edit summary
(Grammar and style cleanup)
Line 1: Line 1:
{{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.}}
{{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 qtcreator.  The version from a recent Linux distribution should be fineIn a debian/Ubuntu desktop, run:
 
Install the qtcreator tool on a host Linux PCAny recent version from a modern Linux distribution should be sufficient and work without issueOn a Debian/Ubuntu desktop, run:
<source lang=bash>
<source lang=bash>
sudo apt-get update && sudo apt-get install qtcreator -y
sudo apt-get update && sudo apt-get install qtcreator -y
</source>
</source>


You will also need to download the SDK which includes the QT support (Right click and save as):
You will also need to download the SDK which includes the Qt support (Right click and save as):
* [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/morty/toolchain/poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.2.1.sh x86_64]
* [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/morty/toolchain/poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.2.1.sh x86_64]
* [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/morty/toolchain/poky-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.2.1.sh i686]
* [ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/distributions/yocto/morty/toolchain/poky-glibc-i686-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.2.1.sh i686]
Line 17: Line 18:
These instructions assume the path will be default at "/opt/poky/2.2.1/".
These instructions assume the path will be default at "/opt/poky/2.2.1/".


An environment script has to be sourced ***every time*** before launching qtcreator.  Without this builds will fail.
 
{{Note|An environment script has to be sourced before ''every'' execution of qtcreator.  Without this, builds will fail.}}
<source lang=bash>
<source lang=bash>
source /opt/poky/2.2.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
source /opt/poky/2.2.1/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
Line 23: Line 25:
</source>
</source>


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 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".
{|  
{|  
| [[File:qtdeviceconfiguration.png|300px|right|QT Device Configuration]]  
| [[File:qtdeviceconfiguration.png|300px|right|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 TSIMX6.
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.


{|  
{|  
| [[File:qtnewdevice.png|300px|right|QT Device Configuration]]  
| [[File:qtnewdevice.png|300px|right|Qt Device Configuration]]  
|}
|}
It will then verify connectivity.  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 43:
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.}}
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}}
{{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.  If this is detected add in the string "TSIMX6" to the title, or add the path below.  This will allow it to be recognized when setting the right binary for the kit.
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
| i686
Line 52: Line 56:


{|  
{|  
| [[File:qtversions.png|300px|right|QT Versions tab]]  
| [[File:qtversions.png|300px|right|Qt Versions tab]]  
|}
|}




Next go to the "Compilers" tab, and click "Add", and select "GCC".  Set the Name to "TSIMX6 GCC".  For the "Compiler Path":
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
| i686
Line 66: Line 70:


{|
{|
| [[File:qtcompiler.png|300px|right|QT Compiler tab]]  
| [[File:qtcompiler.png|300px|right|Qt Compiler tab]]  
|}
|}


Next, go to the Debuggers tab, and click "Add".  For name, specify "TSIMX6 GDB".  For the paths, specify the location of gdb:
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
| i686
Line 79: Line 83:


{|
{|
| [[File:qtdebugger.png|300px|right|QT Debugger tab]]  
| [[File:qtdebugger.png|300px|right|Qt Debugger tab]]  
|}
|}


Next, go to the "Kits" tab and click add.  For Name, enter "TSIMX6".  Set device type to "Generic Linux Device".  Set the device to "TSIMX6 (default for Generic Linux)".  Set the sysroot to:
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:
Set QT mkspec to:
<source lang=bash>/opt/poky/2.2.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++</source>
<source lang=bash>/opt/poky/2.2.1/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++</source>
Make sure there is no space at the end.
Make sure there is no space at the end.


Set the compiler to "TSIMX6 GCC".  Set Debugger to "TSIMX6 GDB".  Set the QT version to "TSIMX6 QT 5.7.1".  Finally, click Apply.
Set "Compiler" to "TSIMX6 GCC".  Set "Debugger" to "TSIMX6 GDB".  Set the "Qt version" to "TSIMX6 QT 5.7.1".  Finally, click Apply.
{|
{|
| [[File:qtkit.png|300px|right|QT Kit tab]]  
| [[File:qtkit.png|300px|right|Qt Kit tab]]  
|}
|}


{{Note|If you have a red exclamation point over the kits icon that indicates the compiler abi does not match, then you will need to go back through the compiler, gdb, and qmake and browse for the file manually rather than just pasting in the text from this wiki.  This is a bug in Ubuntu 16.04's QT Creator, and may be in later versions as well.}}
{{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.
At this point Qt Creator is set up to begin a hello world project.

Revision as of 12:32, 25 July 2017

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.1/".


Note: An environment script has to be sourced before every execution of qtcreator. Without this, builds will fail.
source /opt/poky/2.2.1/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.1/sysroots/x86-pokysdk-linux/usr/bin/qt5/qmake
x86_64
/opt/poky/2.2.1/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.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
x86_64
/opt/poky/2.2.1/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.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
x86_64
/opt/poky/2.2.1/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.1/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.