Changes

Jump to: navigation, search

DESK-MX6UL-AN-0002: Getting started with Qt Creator

5,931 bytes added, 10:42, 29 June 2021
Created page with "{{InfoBoxTop}} {{AppliesToAXEL ULite AN}} {{InfoBoxBottom}} {{ImportantMessage|text=This application note has been validated using the '''kit version''' in the History table...."
{{InfoBoxTop}}
{{AppliesToAXEL ULite AN}}
{{InfoBoxBottom}}

{{ImportantMessage|text=This application note has been validated using the '''kit version''' in the History table.}}
==History==

{| class="wikitable" border="1"
!Version
!Date
!Development Kit version
|-
| 1.0.1
| Jun 2021
|[[AXEL_ULite_SOM/DESK-MX6UL-L/General/Release_Notes#DESK-MX6UL-L_1.0.1|DESK-MX6UL-L 1.0.1]]
|-
|}

==Introduction==

This application note details QT Creator setup and configuration in [[AXEL_ULite_SOM/DESK-MX6UL-L|DESK]] [[AXEL_ULite_SOM/DESK-MX6UL-L/General/DVDK_Virtual_Machine|MVM]]

== Setting up Qt Creator to build for DESKK ==
{{ImportantMessage|text=Note: The version of Qt Creator may differ from images below. The version provided from DESK 1.0.1 release is Qt 5.12.7 with Qt Creator 4.11.0}}

=== Qt Creator Installation ===

To install Qt Creator inside your toolchain launch a terminal emulator and run

<pre>
dvdk@vagrant:~$ cd desk-mx-l/
</pre>
<pre>
dvdk@vagrant:~/desk-mx-l$ ./qt-opensource-linux-x64.run
</pre>

An installation wizard will appear. Clik '''Next''' to proced with the installation.

[[File:QtCreator XELK 3 0 0 01.png|400px|border|center]]

Fill the form with ''your information'' and properly activate your account on Qt web site.

[[File:Qt5.12.7_creat_account.png|400px|border|center]]

Select '''Next'''.

[[File:Qt5.12.7_setup.png|400px|border|center]]

Select the install directory or click '''Next'''.

[[File:Qt5.12.7_install_directory.png|400px|border|center]]

Select '''Next'''.

[[File:Qt5.12.7_install_components.png|400px|border|center]]

After carefully reading the ''License Agreement'', ''if you agree'', accept it and then press '''Next''' again.

[[File:Qt5.12.7_install_license_agreement.png|400px|border|center]]

And then click '''Install''' and complete the installation.

[[File:Qt5.12.7_installation.png|400px|border|center]]

Then '''Finish''' to exit the setup wizard.

[[File:Qt5.12.7_finish.png|400px|border|center]]

=== Manual configuration ===

In this section we details all the step required for configuring the SDK toolchain.

==== Devices ====

Go to <code>Tools -> Options</code> menu

[[File:QtCreator_tools_options.png|800px|border|center]]

Select <code>Devices</code> and click '''Add'''

[[File:QtCreator_devices_add.png|600px|border|center]]

Choose the ''Generic Linux device''

[[File:QtCreator_generic_linux_device.png|400px|border|center]]

Insert the IP address of your device, ''root'' as username and leave password empty (this is the default configuration of DESK root file systems). Make sure that the device is connected to the network and your virtual machine networking is correctly configured (see [[VirtualBox Network Configuration|this]] article for more details).

Then click '''Next'''.

[[File:QtCreator_connection.png|400px|border|center]]

QtCreator asks you to create a deployment key for the target connection:

[[File:QtCreator_deployment_key.png|400px|border|center]]

If the target data was inserted correctly (IP address, login username) then the key will be correctly deployed into the target:

[[File:QtCreator_deployment_key_finished.png |400px|border|center]]

If everything went ok pressing ''Finish'' button you should see a dialog like the image below.

[[File:QtCreator_device_connected.png|400px|border|center]]

And finally this is how the <code>Devices</code> window should look like.

[[File:QtCreator_device.png|700px|border|center]]

=== GCC & Cross Compilation ===

Next you need to configure the cross compilation tool inside <code>Kits -> Compiler</code>.

[[File:QtCreator_kits_compiler.png|400px|border|center]]

Click <code>Add -> GCC</code>, add the compiler path and set (for example) the DESK-MX-GCC compiler name.

<pre>
/home/dvdk/desk-mx-l/sdk/latest_desk-mx6ul-l/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
</pre>

And click '''Apply'''.

[[File:QtCreator_kits_compiler_GCC.png|400px|border|center]]

Do the same for the C++ cross compilation tool (DESK-MX-GCC+)

<pre>
/home/dvdk/desk-mx-l/sdk/latest_desk-mx6ul-l/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
</pre>

[[File:QtCreator_kits_compiler_GCC+.png|400px|border|center]]

=== Debugger GDB ===

Now it is necessary to add a debugger. In order to do this go to the <code>Debuggers</code> tab and click '''Add'''.

And then select the GDB debugger at the location

<pre>
/home/dvdk/desk-mx-l/sdk/latest_desk-mx6ul-l/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
</pre>

and click '''Apply'''.

[[File:QtCreator_kits_debugger_GDB.png|400px|border|center]]

=== Qt Version ===

Next you need to add the Qt Version installed on your device. Go to <code>Qt Version</code> click '''Add''' and select the following qmake file.

<pre>
home/dvdk/desk-mx-l/sdk/latest_desk-mx6ul-l/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
</pre>

[[File:QtCreator_qtversions_qmake.png|400px|border|center]]

=== Kits ===

The last step is to add a new kit. Go to <code>Kits</code> and click '''Add''' and complete the information as shown below.

[[File:QtCreator_qtversions_kit.png|400px|border|center]]

Pay attention that in <code>Qt mkspec</code> you need to write

<pre>
linux-oe-g++
</pre>

After this your setup is complete and you can proceed and create your Qt applications.

== Qt application example ==

Now that the setup is finished, you can create your first application

Open a new terminal and source the environment variables with the command.

<pre>
dvdk@vagrant:~/desk-mx-l$ source desk-mx6ul-l-1.0.1_env.sh
</pre>

In the same terminal type the following command (we assume you didn't change the default installation directory)

<pre>
dvdk@vagrant:~/desk-mx-l$ /home/dvdk/Qt5.12.7/Tools/QtCreator/bin/qtcreator
</pre>

{{ImportantMessage|text=It is important to repeat the previous two step every time you start QTCreator}}
8,286
edits

Navigation menu