Difference between revisions of "RK3288 qt5Creator"

Jump to: navigation, search
Line 24: Line 24:
<h2> Installing cross toolchain </h2>
== Installing cross toolchain ==
<p>Please download <a href="https://pan.baidu.com/s/1FmO1QK2W6-TKzMYw0pTkkw" alt="https://pan.baidu.com/s/1FmO1QK2W6-TKzMYw0pTkkw" title="https://pan.baidu.com/s/1FmO1QK2W6-TKzMYw0pTkkw">cross compiler toolchain</a>&#160;(Password: m47o)first. Then execute the following command to unzip the cross compiler tool to the /opt directory
Please download [https://pan.baidu.com/s/1FmO1QK2W6-TKzMYw0pTkkw cross compiler toolchain] (Password: m47o)first. Then execute the following command to unzip the cross compiler tool to the /opt directory
<h3> </h3>
<dl><dd><code>$ sudo tar -zxf rk3288_toolchain_Qt_V5.9.4.tar.gz -C /opt</code><br />
=== ===
:<code>$ sudo tar -zxf rk3288_toolchain_Qt_V5.9.4.tar.gz -C /opt</code><br/>
= Working within QtCreator =
= Working within QtCreator =

Revision as of 02:09, 9 November 2020


All operations in this guide are based on Ubuntu 18.04 LTS 64bit only.
First please install Ubuntu 18.04 LTS 64bit* with minimum 2GB memory.

Installing required packages

Please login and perform the following commands:

$ sudo apt-get install build-essential
$ sudo apt-get install qtcreator
$ sudo apt-get install qt5-default
$ sudo apt-get install qt5-doc
$ sudo apt-get install qt5-doc-html qtbase5-doc-html
$ sudo apt-get install qtbase5-examples

Installing cross toolchain

Please download cross compiler toolchain (Password: m47o)first. Then execute the following command to unzip the cross compiler tool to the /opt directory

$ sudo tar -zxf rk3288_toolchain_Qt_V5.9.4.tar.gz -C /opt

Working within QtCreator

Starting the QtCreator

$ qtcreator
  1. The QtCreator's main window shows up.
    RK3399 Qt start init.png
  2. Check QtCreator's version by using "Help" -> "About Qt Creator".

Configuring the Cross-Compiler Options

  1. Bring up the options dialog using "Tools" -> "Options..."
  2. Select the "Devices" page on the left, and click "Add..."
  3. Select "Generic Linux Device" and click "Start Wizard".
  4. Specify proper settings and click "Next>"
  5. Click "Finish"
  6. Device test finished successfully. Click "Close".

    If device test failed, please go back to specify proper settings.
    (It is necessary to set a blank password at least, null password does not work.)

    (It means device's IP is incorrect or some network issues occured.)
  7. Click "Apply"
  8. Select the "Build & Run" page on the left, switch to "Compilers" tab, drop down "Add" menu and choose "GCC-->C++".
  9. Name the compiler as "RK G++"
  10. Click "Browse..." to select "/opt/rk3288_risc/buildroot/output/rockchip_rk3288/host/bin/arm-buildroot-linux-gnueabihf-g++"
  11. Click "Apply"
  12. Switch to the "Debuggers" tab
  13. Click "Add"
  14. Name the debugger as "RK GDB"
  15. Click "Browse..." to select "/opt/rk3288_risc/buildroot/output/rockchip_rk3288/host/bin/arm-buildroot-linux-gnueabihf-gdb"
  16. Click "Apply"
  17. Switch to the "Qt Versions" tab.
  18. Check if the "Qt 5.9.4 (host)" is auto detected in "Manual" item ?
    If not, click "Add..." to choose the proper qmake.
  19. Click "Apply"
  20. Switch to the "Kits" tab.
  21. Click "Add".
  22. Name the kit as "RK toolchain"
  23. Specify the correct "Device Tpye", "Compiler", "Debugger" and "Qt version"
  24. Click "Browse..." to select "/opt/rk3288_risc/buildroot/output/rockchip_rk3288/host/arm-buildroot-linux-gnueabihf/sysroot" as sysroot
  25. Click Apply
  26. Click OK to finalize the configuration.
  27. Invoke the options dialog again to make sure the "iMX6 toolchain" is default kit.

Creating the Project

  1. Bring up "New" dailog using "File" -> "New File or Project..."
  2. Select "Applications" -> 'Qt Widgets Application"
  3. Click "Choose..."
  4. Use "hello_qt" as name
  5. Create in "/mnt/sda1/work/qt/PJ"
  6. Click "Next"
  7. Check "RK3288 toolchain"
  8. Click "Next".
  9. Use default settings for "Class Information"
  10. Click "Next"
  11. Use default settings for "Project Management"
  12. Click "Finish"
  13. Double click "hello_qt.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

  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
  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".
  3. Check if "Files to deploy" is correct
  4. Set environment variable DISPLAY in QtCreator -> Projects -> Run -> Run Environment. The value of DISPLAY is obtained from the rk3288. For example, execute instruction echo $DISPLAY on RK3288.
  5. Switch to "Edit" mode
  6. Click "Build" using context menu of project "Hello"
  7. The green "Build" bar means no error occured.
  8. Press "Alt+4" to show "Compile Output".

Deploying the Application

  1. Click "Deploy" using context menu of project hello_qt

  2. The green "Deploy" bar indicates no error occured.

Debugging the Application

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