Difference between revisions of "RK ALL toolchain Qt 5.11.3"

From ESS-WIKI
Jump to: navigation, search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<h1>Prerequisites</h1>
 
  
<p><span style="color:#FF0000;">Debian10(buster) is highly recommended OS to develop.</span></p>
+
= Prerequisites =
  
<h2>Installing required packages</h2>
+
<span style="color:#FF0000;">Debian10(buster) is highly recommended OS to develop.</span>
  
<p>Please login and perform the following commands:</p>
+
== Installing required packages ==
  
<pre>
+
Please login and perform the following commands:
$ sudo apt-get install -y build-essential  
+
<pre>$ sudo apt-get install -y build-essential  
 
$ sudo apt-get install -y qtcreator  
 
$ sudo apt-get install -y qtcreator  
 
$ sudo apt-get install -y qt5-default  
 
$ sudo apt-get install -y qt5-default  
Line 20: Line 19:
 
</pre>
 
</pre>
  
<p>Link arm-linux-gnu*-8 to arm-linux-gnu* and aarch64-linux-gnu*-8 to aarch64-linux-gnu*:</p>
+
Link arm-linux-gnu*-8 to arm-linux-gnu* and aarch64-linux-gnu*-8 to aarch64-linux-gnu*:
 
+
<pre>$ sudo su
<pre>
 
$ sudo su
 
 
$ cd /usr/bin
 
$ cd /usr/bin
$ for f in $(ls arm-linux-gnu*-8);do ln -sf $f $(echo $f|sed &quot;s/-8//&quot;);done  
+
$ for f in $(ls arm-linux-gnu*-8);do ln -sf $f $(echo $f|sed "s/-8//");done  
$ for f in $(ls aarch64-linux-gnu*-8);do ln -sf $f $(echo $f|sed &quot;s/-8//&quot;);done
+
$ for f in $(ls aarch64-linux-gnu*-8);do ln -sf $f $(echo $f|sed "s/-8//");done
 
$ exit
 
$ exit
 +
 
</pre>
 
</pre>
  
<p>&nbsp;</p>
+
&nbsp;
  
<h2>Installing cross toolchain</h2>
+
== Installing cross toolchain ==
  
<p>Please download <a alt="https://pan.baidu.com/s/1JnXJ_X_HRDWoB14VBIq9fA" href="https://pan.baidu.com/s/1JnXJ_X_HRDWoB14VBIq9fA" title="https://pan.baidu.com/s/1JnXJ_X_HRDWoB14VBIq9fA">RK3288</a>(Password: gm9i) 、&nbsp;<a alt="https://pan.baidu.com/s/1OEzbJsgBSo3n5DdwRY2Rag" href="https://pan.baidu.com/s/1OEzbJsgBSo3n5DdwRY2Rag" title="https://pan.baidu.com/s/1OEzbJsgBSo3n5DdwRY2Rag">RK3399</a>(Password: 0kkn)和(Password: ) cross compiler toolchain first. Then execute the following command to unzip the cross compiler tool to the /opt directory</p>
+
Please download [https://pan.baidu.com/s/1JnXJ_X_HRDWoB14VBIq9fA RK3288](Password: gm9i) 、&nbsp;[https://pan.baidu.com/s/1OEzbJsgBSo3n5DdwRY2Rag RK3399](Password: 0kkn) and [https://pan.baidu.com/s/17hCuIcORYDPOSAqVoyPPrg RK3568](Password: a887)cross compiler toolchain first. Then execute the following command to unzip the cross compiler tool to the /opt directory
  
<p>For RK3288</p>
+
For RK3288
 
+
<pre>$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3288/
<pre>
 
$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3288/
 
 
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3288/
 
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3288/
 
$ sudo tar -zxf rk3288_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3288/
 
$ sudo tar -zxf rk3288_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3288/
 
</pre>
 
</pre>
  
<p>For RK3399</p>
+
For RK3399
 
+
<pre>$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3399/  
<pre>
 
$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3399/  
 
 
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3399/  
 
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3399/  
 
$ sudo tar -zxvf rk3399_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3399/
 
$ sudo tar -zxvf rk3399_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3399/
 
</pre>
 
</pre>
  
<p>For RK3568</p>
+
For RK3568
 +
<pre>$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3568/
 +
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3568/
 +
$ sudo tar -zxf rk3568_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3568/</pre>
 +
 
 +
= Working within QtCreator =
 +
 
 +
Use qtcreator to configure a complete build kit.
 +
 
 +
<span style="color:#FF0000;">'''RK3568 & RK3399&nbsp;&&nbsp;RK3288'''</span>
 +
 
 +
== Config QtCreator ---- Qt Versions ==
 +
 
 +
1. Select Tools --> options -->&nbsp;
 +
 
 +
[[File:QtDNK5.png|RTENOTITLE]]
  
<pre>
+
2. Select Qt versions --> Manual -->Add -->
$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3568/  
+
 
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3568/
+
&nbsp; &nbsp; Path:/opt/toolchain_Qt_V5.11.3/<span style="color:#FF0000;">'''RK3568 or&nbsp;RK3399 or RK3288/'''</span><span style="color:#000000;">sysroot/qmake</span>
$ sudo tar -zxvf rk3568_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3568/
+
 
</pre>
+
[[File:QtICMN.png|RTENOTITLE]]
 +
 
 +
[[File:QtLZHW4.png]]
 +
 
 +
== Config QtCreator ---- Qt Complers ==
 +
 
 +
1. Select compilers -->
 +
 
 +
2. Because Gcc and G++ has been installed earlier, the compiler will generally detect it automatically.
 +
 
 +
&nbsp; &nbsp; If no Auto-detected, just Add it.
 +
 
 +
<span style="color:#000000;">'''Path for'''</span><span style="color:#ff0000;">'''RK3568 (64)'''</span><span style="color:#000000;">:/usr/bin/arrch64-linux-gnu-gcc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span>
 +
 
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/bin/aarch64-linux-gnu-g++
 +
 
 +
&nbsp;
 +
 
 +
<span style="color:#000000;">'''Path for'''</span><span style="color:#FF0000;">'''RK3399 (64)'''</span><span style="color:#000000;">:/usr/bin/aarch64-linux-gnu-gcc</span>
 +
 
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/usr/bin/aarch64-linux-gnu-g++
 +
 
 +
&nbsp;
 +
 
 +
<span style="color:#000000;">'''Path for'''</span><span style="color:#FF0000;">'''RK3288(32)'''</span><span style="color:#000000;">:/usr/bin/arm-linux-gnueabihf-gcc</span>
 +
 
 +
<span style="color:#FF0000;">'''&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;'''</span><span style="color:#000000;">/usr/bin/arm-linux-gnueabihf-g++</span>
 +
 
 +
The following figure uses rk3568&nbsp; as an example :
 +
 
 +
[[File:QtIXDKY6.png|RTENOTITLE]]
 +
 
 +
== Config QtCreator ---- Qt Debuggers ==
 +
 
 +
1. Select Debuggers -->
 +
 
 +
2. The Debuggers selection system buildin,If no Auto-detected , just Add it:
 +
 
 +
&nbsp; &nbsp; Path: /usr/bin/gdb
 +
 
 +
[[File:QtGZ6D5.png|RTENOTITLE]]
 +
 
 +
== Config QtCreator ---- Qt Cmakes ==
 +
 
 +
1. Select Cmake -->
  
<h2>Config QtCreator ---- Qt Versions</h2>
+
2. Similarly,Cmake also uses the system Cmake , if no Auto-detected , just Add it&nbsp;:
  
<ol>
+
&nbsp; &nbsp; Path: /usr/bin/Cmake
<li>Bring up the options dialog using &quot;Tools&quot; -&gt; &quot;Options...&quot;</li>
 
<li>Select the &quot;Build &amp; Run&quot; page on the left, switch to &quot;Qt Versions&quot; tab, and click &quot;Add...&quot;</li>
 
<li>Select qmake file
 
<dl>
 
<dt>Select &quot;/opt/toolchain_Qt_V5.11.3/rk3288/sysroot/qmake-debian-buster-armhf&quot;.</dt>
 
<dt>or&nbsp;</dt>
 
<dt>RK3399 Select&nbsp;&quot;/opt/toolchain_Qt_V5.11.3/rk3399/sysroot/qmake&quot;.</dt>
 
<dt>or&nbsp;RK3399 Select&nbsp;&quot;/opt/toolchain_Qt_V5.11.3/rk3399/sysroot/qmake-debian-buster-armhf &quot;</dt>
 
</dl>
 
</li>
 
<li>Input Version name &quot;Qt 5.11.3 (RK3288 )&quot; or &quot;Qt 5.11.3 (RK3399&nbsp;)&quot;.</li>
 
</ol>
 
  
<p><img _fck_mw_filename="RK3288 Add Qt Verions.png" _fck_mw_origimgheight="597" _fck_mw_origimgwidth="1091" alt="RTENOTITLE" src="/wiki/images/0/0f/RK3288_Add_Qt_Verions.png" style="vertical-align:middle;" title="RTENOTITLE" /></p>
+
[[File:Qt8D.png|RTENOTITLE]]
  
<h2>Config QtCreator ---- Kits</h2>
+
== Config QtCreator ---- Qt kits ==
  
<ol>
+
1. Select Kits&nbsp;
<li>Bring up the options dialog using &quot;Tools&quot; -&gt; &quot;Options...&quot;</li>
 
<li>Select the &quot;Build &amp; Run&quot; page on the left, switch to &quot;Kits&quot; tab, and click &quot;Add...&quot;</li>
 
<li>Click &quot;Add&quot;.</li>
 
</ol>
 
  
<dl>
+
2. Configure "Qt version"、"Compilers""Debuggers"&nbsp;and "Cmake"&nbsp;configurations in Kits.
<dt><span style="color:#FF0000;"><b>RK3288</b></span></dt>
 
<dt>Name</dt>
 
<dd>input &quot;RK3288 toolchain&quot;</dd>
 
<dt>Device Tpye</dt>
 
<dd>Select &quot;Generic Linux Device&quot;</dd>
 
<dt>Device</dt>
 
<dd>Select &quot;RK3288&quot;</dd>
 
<dt>Compiler</dt>
 
<dd>Select &quot;GCC (C,arm <span style="color:#FF0000;">32</span>bit in /usr/bin)&quot; and &quot;GCC (C++,arm <span style="color:#FF0000;">32</span>bit in /usr/bin)&quot;</dd>
 
<dt>Qt version</dt>
 
<dd>Select &quot;Qt 5.11.3 (RK3288)&quot;</dd>
 
<dd>&nbsp;</dd>
 
<dd>&nbsp;</dd>
 
</dl>
 
  
<p><span style="color:#FF0000;"><b>RK3399</b></span></p>
+
&nbsp; &nbsp; &nbsp;The picture below uses rk3568&nbsp;as an example:
  
<dl>
+
[[File:T4KDS.png|RTENOTITLE]]
<dt>Name</dt>
 
<dd>input &quot;RK3399 toolchain&quot;</dd>
 
<dt>Device Tpye</dt>
 
<dd>Select &quot;Generic Linux Device&quot;</dd>
 
<dt>Device</dt>
 
<dd>Select &quot;RK3399&quot;</dd>
 
<dt>Compiler</dt>
 
<dd>Select &quot;GCC (C,arm <span style="color:#FF0000;">64</span>bit in /usr/bin)&quot; and &quot;GCC (C++,arm <span style="color:#FF0000;">64</span>bit in /usr/bin)&quot;</dd>
 
<dt>Qt version</dt>
 
<dd>Select &quot;Qt 5.11.3 (RK3399)&quot;</dd>
 
<dd>&nbsp;</dd>
 
<dd>&nbsp;</dd>
 
</dl>
 
  
<p><img _fck_mw_filename="RK3288 Add Kits.png" _fck_mw_origimgheight="597" _fck_mw_origimgwidth="1091" alt="RTENOTITLE" src="/wiki/images/b/b1/RK3288_Add_Kits.png" style="vertical-align:middle;" title="RTENOTITLE" /></p>
+
[[File:QtZ52.png|RTENOTITLE]]
  
<h2>Creating the Project</h2>
+
== Creating the Project ==
  
<ol>
+
#Bring up "New" dailog using "File" -> "New File or Project..."
<li>Bring up &quot;New&quot; dailog using &quot;File&quot; -&gt; &quot;New File or Project...&quot;</li>
+
#Select "Applications" -> 'Qt Widgets Application"
<li>Select &quot;Applications&quot; -&gt; &#39;Qt Widgets Application&quot;</li>
+
#Click "Choose..."
<li>Click &quot;Choose...&quot;
+
#;[[File:RK3399 Project 001.png|RTENOTITLE]] 
<dl>
+
#Use "Hello" as name  
<dt><img _fck_mw_filename="RK3399 Project 001.png" _fck_mw_origimgheight="733" _fck_mw_origimgwidth="1308" alt="RTENOTITLE" src="/wiki/images/4/4b/RK3399_Project_001.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#Create in "/mnt/sda1/work/qt/qt_PJ"
</dl>
+
#Click "Next"
</li>
+
#;[[File:RK3399 Qt Project local.png|RTENOTITLE]] 
<li>Use &quot;Hello&quot; as name</li>
+
#Check "RK toolchain"
<li>Create in &quot;/mnt/sda1/work/qt/qt_PJ&quot;</li>
+
#Click "Next".  
<li>Click &quot;Next&quot;
+
#;[[File:RK3399 Qt Project toolchain.png|RTENOTITLE]] 
<dl>
+
#Use default settings for "Class Information"
<dt><img _fck_mw_filename="RK3399 Qt Project local.png" _fck_mw_origimgheight="128" _fck_mw_origimgwidth="738" alt="RTENOTITLE" src="/wiki/images/7/7f/RK3399_Qt_Project_local.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#Click "Next"
</dl>
+
#;[[File:RK3399 QT Project last.png|RTENOTITLE]] 
</li>
+
#Use default settings for "Project Management"
<li>Check &quot;RK toolchain&quot;</li>
+
#Click "Finish"
<li>Click &quot;Next&quot;.
+
#;[[File:RK3399 Qt Project last2.png|RTENOTITLE]] 
<dl>
+
#Double click "Hello.pro" to switch to editor window  
<dt><img _fck_mw_filename="RK3399 Qt Project toolchain.png" _fck_mw_origimgheight="736" _fck_mw_origimgwidth="1305" alt="RTENOTITLE" src="/wiki/images/b/b2/RK3399_Qt_Project_toolchain.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#In new project it is necessary to add following two lines into qt project file.  
</dl>
+
#:<code>target.path = .<br/> INSTALLS += target</code>  
</li>
+
#;[[File:RK3399 Qt Project code002.png|RTENOTITLE]] 
<li>Use default settings for &quot;Class Information&quot;</li>
+
#Press "Ctrl+S" to save file.  
<li>Click &quot;Next&quot;
+
#Double click "mainwindow.ui" to switch to Design mode  
<dl>
+
#Drag & drop one Label widget on main form, use property editor on the right side to change text and font size  
<dt><img _fck_mw_filename="RK3399 QT Project last.png" _fck_mw_origimgheight="731" _fck_mw_origimgwidth="1304" alt="RTENOTITLE" src="/wiki/images/7/7c/RK3399_QT_Project_last.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#;[[File:2015-01-30 174418.png|RTENOTITLE]]
</dl>
+
#;[[File:RK3399 Qt Project code003.png|RTENOTITLE]] 
</li>
+
#Save all project files using "File" -> "Save All"
<li>Use default settings for &quot;Project Management&quot;</li>
 
<li>Click &quot;Finish&quot;
 
<dl>
 
<dt><img _fck_mw_filename="RK3399 Qt Project last2.png" _fck_mw_origimgheight="725" _fck_mw_origimgwidth="1305" alt="RTENOTITLE" src="/wiki/images/7/7c/RK3399_Qt_Project_last2.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>Double click &quot;Hello.pro&quot; to switch to editor window</li>
 
<li>In new project it is necessary to add following two lines into qt project file.
 
<dl>
 
<dd><code>target.path = .<br />
 
INSTALLS += target</code></dd>
 
<dt><img _fck_mw_filename="RK3399 Qt Project code002.png" _fck_mw_origimgheight="740" _fck_mw_origimgwidth="1400" alt="RTENOTITLE" src="/wiki/images/0/0b/RK3399_Qt_Project_code002.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>Press &quot;Ctrl+S&quot; to save file.</li>
 
<li>Double click &quot;mainwindow.ui&quot; to switch to Design mode</li>
 
<li>Drag &amp; drop one Label widget on main form, use property editor on the right side to change text and font size
 
<dl>
 
<dt><img _fck_mw_filename="2015-01-30 174418.png" _fck_mw_origimgheight="338" _fck_mw_origimgwidth="279" alt="RTENOTITLE" src="/wiki/images/3/31/2015-01-30_174418.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
<dt><img _fck_mw_filename="RK3399 Qt Project code003.png" _fck_mw_origimgheight="740" _fck_mw_origimgwidth="1400" alt="RTENOTITLE" src="/wiki/images/3/3c/RK3399_Qt_Project_code003.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>Save all project files using &quot;File&quot; -&gt; &quot;Save All&quot;</li>
 
</ol>
 
  
<h2>Building the Project</h2>
+
== Building the Project ==
  
<ol>
+
#Switch to "Projects" mode  
<li>Switch to &quot;Projects&quot; mode</li>
+
#Check if "build configuration" is set to "Debug".  
<li>Check if &quot;build configuration&quot; is set to &quot;Debug&quot;.
+
#;[[File:RK3399 Qt debug setting.png|RTENOTITLE]] 
<dl>
+
#Check if "Files to deploy" is correct  
<dt><img _fck_mw_filename="RK3399 Qt debug setting.png" _fck_mw_origimgheight="740" _fck_mw_origimgwidth="1400" alt="RTENOTITLE" src="/wiki/images/a/a8/RK3399_Qt_debug_setting.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#;[[File:RK3399 Qt run setting.png|RTENOTITLE]] 
</dl>
+
#Set environment variable DISPLAY in QtCreator -> Projects -> Run -> Run Environment. The value of DISPLAY is obtained from the rk3399. For example, execute instruction '''''echo $DISPLAY''''' on RK3399.  
</li>
+
#;[[File:RK3399 Qt ENV Display.png|RTENOTITLE]] 
<li>Check if &quot;Files to deploy&quot; is correct
+
#Switch to "Edit" mode  
<dl>
+
#Click "Build" using context menu of project "Hello"
<dt><img _fck_mw_filename="RK3399 Qt run setting.png" _fck_mw_origimgheight="740" _fck_mw_origimgwidth="1400" alt="RTENOTITLE" src="/wiki/images/8/8c/RK3399_Qt_run_setting.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#;[[File:RK3399 Qt build start.png|RTENOTITLE]] 
</dl>
+
#The green "Build" bar means no error occured.  
</li>
+
#;[[File:RK3399 Qt build status.png|RTENOTITLE]] 
<li>Set environment variable DISPLAY in QtCreator -&gt; Projects -&gt; Run -&gt; Run Environment. The value of DISPLAY is obtained from the rk3399. For example, execute instruction <i><b>echo $DISPLAY</b></i> on RK3399.
+
#Press "Alt+4" to show "Compile Output".&nbsp;[[File:RK3399 Qt build output.png|RTENOTITLE]]
<dl>
 
<dt><img _fck_mw_filename="RK3399 Qt ENV Display.png" _fck_mw_origimgheight="740" _fck_mw_origimgwidth="1400" alt="RTENOTITLE" src="/wiki/images/f/f4/RK3399_Qt_ENV_Display.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>Switch to &quot;Edit&quot; mode</li>
 
<li>Click &quot;Build&quot; using context menu of project &quot;Hello&quot;
 
<dl>
 
<dt><img _fck_mw_filename="RK3399 Qt build start.png" _fck_mw_origimgheight="640" _fck_mw_origimgwidth="1212" alt="RTENOTITLE" src="/wiki/images/d/d6/RK3399_Qt_build_start.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>The green &quot;Build&quot; bar means no error occured.
 
<dl>
 
<dt><img _fck_mw_filename="RK3399 Qt build status.png" _fck_mw_origimgheight="28" _fck_mw_origimgwidth="996" alt="RTENOTITLE" src="/wiki/images/5/5c/RK3399_Qt_build_status.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>Press &quot;Alt+4&quot; to show &quot;Compile Output&quot;.&nbsp;<img _fck_mw_filename="RK3399 Qt build output.png" _fck_mw_origimgheight="740" _fck_mw_origimgwidth="1400" alt="RTENOTITLE" src="/wiki/images/a/af/RK3399_Qt_build_output.png" style="vertical-align:middle;" title="RTENOTITLE" /></li>
 
</ol>
 
  
<h2>Deploying the Application</h2>
+
== Deploying the Application ==
  
<ol>
+
#Click "Deploy" using context menu of project Hello[[File:RK3399 Qt deploy start.PNG|RTENOTITLE]]
<li>Click &quot;Deploy&quot; using context menu of project Hello<img _fck_mw_filename="RK3399 Qt deploy start.PNG" _fck_mw_origimgheight="532" _fck_mw_origimgwidth="1008" alt="RTENOTITLE" src="/wiki/images/c/c1/RK3399_Qt_deploy_start.PNG" style="vertical-align:middle;" title="RTENOTITLE" /></li>
+
#The green "Deploy" bar indicates no error occured.[[File:RK3399 Qt deploy output.png|RTENOTITLE]]
<li>The green &quot;Deploy&quot; bar indicates no error occured.<img _fck_mw_filename="RK3399 Qt deploy output.png" _fck_mw_origimgheight="367" _fck_mw_origimgwidth="996" alt="RTENOTITLE" src="/wiki/images/3/35/RK3399_Qt_deploy_output.png" style="vertical-align:middle;" title="RTENOTITLE" /></li>
 
</ol>
 
  
<h2>Debugging the Application</h2>
+
== Debugging the Application ==
  
<ol>
+
#Click debug icon to start debugging.  
<li>Click debug icon to start debugging.
+
#;[[File:RK3399 Qt debug start.png|RTENOTITLE]] 
<dl>
+
#Press "Alt+3" to show "Application Output"[[File:RK3399 Qt debug output.png|RTENOTITLE]]
<dt><img _fck_mw_filename="RK3399 Qt debug start.png" _fck_mw_origimgheight="197" _fck_mw_origimgwidth="60" alt="RTENOTITLE" src="/wiki/images/1/17/RK3399_Qt_debug_start.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
+
#The "Hello" shows up on primary display.  
</dl>
+
#;[[File:RK3399 Qt result show.png|RTENOTITLE]] 
</li>
+
#Click "stop" to stop debugging.  
<li>Press &quot;Alt+3&quot; to show &quot;Application Output&quot;<img _fck_mw_filename="RK3399 Qt debug output.png" _fck_mw_origimgheight="366" _fck_mw_origimgwidth="994" alt="RTENOTITLE" src="/wiki/images/7/75/RK3399_Qt_debug_output.png" style="vertical-align:middle;" title="RTENOTITLE" /></li>
+
#;[[File:RK3399 Qt debug stop.png|RTENOTITLE]] 
<li>The &quot;Hello&quot; shows up on primary display.
+
#The default desktop returns back.[[File:RK3399 Qt default Desktop.png|RTENOTITLE]]
<dl>
 
<dt><img _fck_mw_filename="RK3399 Qt result show.png" _fck_mw_origimgheight="327" _fck_mw_origimgwidth="404" alt="RTENOTITLE" src="/wiki/images/a/ac/RK3399_Qt_result_show.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>Click &quot;stop&quot; to stop debugging.
 
<dl>
 
<dt><img _fck_mw_filename="RK3399 Qt debug stop.png" _fck_mw_origimgheight="55" _fck_mw_origimgwidth="346" alt="RTENOTITLE" src="/wiki/images/0/02/RK3399_Qt_debug_stop.png" style="vertical-align:middle;" title="RTENOTITLE" /></dt>
 
</dl>
 
</li>
 
<li>The deafult desktop returns back.<img _fck_mw_filename="RK3399 Qt default Desktop.png" _fck_mw_origimgheight="720" _fck_mw_origimgwidth="1280" alt="RTENOTITLE" src="/wiki/images/6/60/RK3399_Qt_default_Desktop.png" style="vertical-align:middle;" title="RTENOTITLE" /></li>
 
</ol>
 

Latest revision as of 12:15, 14 August 2023

Prerequisites

Debian10(buster) is highly recommended OS to develop.

Installing required packages

Please login and perform the following commands:

$ sudo apt-get install -y build-essential 
$ sudo apt-get install -y qtcreator 
$ sudo apt-get install -y qt5-default 
$ sudo apt-get install -y qt5-doc 
$ sudo apt-get install -y qt5-doc-html qtbase5-doc-html 
$ sudo apt-get install -y qtbase5-examples 
$ sudo apt-get install -y qt5-qmake 
$ sudo apt-get install -y rsync
$ sudo apt-get install -y gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf
$ sudo apt-get install -y gcc-8-aarch64-linux-gnu g++-8-aarch64-linux-gnu

Link arm-linux-gnu*-8 to arm-linux-gnu* and aarch64-linux-gnu*-8 to aarch64-linux-gnu*:

$ sudo su
$ cd /usr/bin
$ for f in $(ls arm-linux-gnu*-8);do ln -sf $f $(echo $f|sed "s/-8//");done 
$ for f in $(ls aarch64-linux-gnu*-8);do ln -sf $f $(echo $f|sed "s/-8//");done
$ exit

 

Installing cross toolchain

Please download RK3288(Password: gm9i) 、 RK3399(Password: 0kkn) and RK3568(Password: a887)cross compiler toolchain first. Then execute the following command to unzip the cross compiler tool to the /opt directory

For RK3288

$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3288/
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3288/
$ sudo tar -zxf rk3288_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3288/

For RK3399

$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3399/ 
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3399/ 
$ sudo tar -zxvf rk3399_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3399/

For RK3568

$ sudo rm -rf /opt/toolchain_Qt_V5.11.3/rk3568/
$ sudo mkdir -p /opt/toolchain_Qt_V5.11.3/rk3568/
$ sudo tar -zxf rk3568_toolchain_Qt_V5.11.3_*.tar.gz -C /opt/toolchain_Qt_V5.11.3/rk3568/

Working within QtCreator

Use qtcreator to configure a complete build kit.

RK3568 & RK3399 & RK3288

Config QtCreator ---- Qt Versions

1. Select Tools --> options --> 

RTENOTITLE

2. Select Qt versions --> Manual -->Add -->

    Path:/opt/toolchain_Qt_V5.11.3/RK3568 or RK3399 or RK3288/sysroot/qmake

RTENOTITLE

QtLZHW4.png

Config QtCreator ---- Qt Complers

1. Select compilers -->

2. Because Gcc and G++ has been installed earlier, the compiler will generally detect it automatically.

    If no Auto-detected, just Add it.

Path forRK3568 (64):/usr/bin/arrch64-linux-gnu-gcc         

                                   /usr/bin/aarch64-linux-gnu-g++

 

Path forRK3399 (64):/usr/bin/aarch64-linux-gnu-gcc

                                   /usr/bin/aarch64-linux-gnu-g++

 

Path forRK3288(32):/usr/bin/arm-linux-gnueabihf-gcc

                                  /usr/bin/arm-linux-gnueabihf-g++

The following figure uses rk3568  as an example :

RTENOTITLE

Config QtCreator ---- Qt Debuggers

1. Select Debuggers -->

2. The Debuggers selection system buildin,If no Auto-detected , just Add it:

    Path: /usr/bin/gdb

RTENOTITLE

Config QtCreator ---- Qt Cmakes

1. Select Cmake -->

2. Similarly,Cmake also uses the system Cmake , if no Auto-detected , just Add it :

    Path: /usr/bin/Cmake

RTENOTITLE

Config QtCreator ---- Qt kits

1. Select Kits 

2. Configure "Qt version"、"Compilers"、"Debuggers" and "Cmake" configurations in Kits.

     The picture below uses rk3568 as an example:

RTENOTITLE

RTENOTITLE

Creating the Project

  1. Bring up "New" dailog using "File" -> "New File or Project..."
  2. Select "Applications" -> 'Qt Widgets Application"
  3. Click "Choose..."
    RTENOTITLE
  4. Use "Hello" as name
  5. Create in "/mnt/sda1/work/qt/qt_PJ"
  6. Click "Next"
    RTENOTITLE
  7. Check "RK toolchain"
  8. Click "Next".
    RTENOTITLE
  9. Use default settings for "Class Information"
  10. Click "Next"
    RTENOTITLE
  11. Use default settings for "Project Management"
  12. Click "Finish"
    RTENOTITLE
  13. Double click "Hello.pro" to switch to editor window
  14. In new project it is necessary to add following two lines into qt project file.
    target.path = .
    INSTALLS += target
    RTENOTITLE
  15. Press "Ctrl+S" to save file.
  16. Double click "mainwindow.ui" to switch to Design mode
  17. Drag & drop one Label widget on main form, use property editor on the right side to change text and font size
    RTENOTITLE
    RTENOTITLE
  18. Save all project files using "File" -> "Save All"

Building the Project

  1. Switch to "Projects" mode
  2. Check if "build configuration" is set to "Debug".
    RTENOTITLE
  3. Check if "Files to deploy" is correct
    RTENOTITLE
  4. Set environment variable DISPLAY in QtCreator -> Projects -> Run -> Run Environment. The value of DISPLAY is obtained from the rk3399. For example, execute instruction echo $DISPLAY on RK3399.
    RTENOTITLE
  5. Switch to "Edit" mode
  6. Click "Build" using context menu of project "Hello"
    RTENOTITLE
  7. The green "Build" bar means no error occured.
    RTENOTITLE
  8. Press "Alt+4" to show "Compile Output". RTENOTITLE

Deploying the Application

  1. Click "Deploy" using context menu of project HelloRTENOTITLE
  2. The green "Deploy" bar indicates no error occured.RTENOTITLE

Debugging the Application

  1. Click debug icon to start debugging.
    RTENOTITLE
  2. Press "Alt+3" to show "Application Output"RTENOTITLE
  3. The "Hello" shows up on primary display.
    RTENOTITLE
  4. Click "stop" to stop debugging.
    RTENOTITLE
  5. The default desktop returns back.RTENOTITLE