RK3568 development notes (7): Build a Qt cross-compilation development environment on the host ubuntu, compile a Demo, and run the Demo test on the target board

If the article is an original article, please indicate the source of the original article when reprinting it.
The blog address of this article: https://hpzwl.blog.csdn.net/article/details/132733901

The collection of red fat man’s network technology blog posts: a collection of development technologies (including Qt practical technology, Raspberry Pi, 3D, OpenCV, OpenGL, ffmpeg, OSG, microcontroller, software and hardware combination, etc.) is being continuously updated...

Rockchip Development Column

Previous article: " RK3568 Development Notes (6): Development board to program Ubuntu firmware (supports mipi screen mirroring + HDMI screen mirroring) " Next article: " RK3568 Development Notes (8): Development board to program buildroot firmware ( Supports mipi screen mirroring + HDMI screen mirroring) hdmi screen), build a Qt cross-compilation development environment, compile a Demo, and run the Demo test on the target board


Preface

  In the previous blog post, a relatively complete ubuntu host has been built. It is very complete, but I found that there is no Qt cross-compilation development environment, so I still need to build a Qt cross-compilation development environment.


Additional information

  This article is based on Qt cross-compilation on a virtual machine based on "RK3568 Development Notes (3): RK3568 Virtual Machine Basic Environment Construction Update Source, Installation of Network Tools, Serial Port Debugging, Network Connection, File Transfer, Installation of vscode and Samba Shared Services" Built.


Install desktop version of Qt on ubuntu

  (PS: This is the ubuntu development environment for installing qt, including the desktop compilation board of qtcreator and a compiler that supports gcc.)

Step 1: Download Qt5.14.2

  Insert image description here

Step 2: Install the desktop board

  (PS1: When installing qt, please disconnect from the Internet first, otherwise you must log in)
  (PS2: qt5.14.2 is the official version, it is best not to change the version yourself unless necessary)
  Insert image description here

  Insert image description here

  Insert image description here

  Insert image description here

  Insert image description here

  After the installation is complete, open QtCreator, as shown below:
  Insert image description here


Create a hello world application Demo

Step 1: Create a new Qt project

  Create a new testDemo test project:
  Insert image description here

  Insert image description here

  Insert image description here

  Note here that this is the desktop gcc version:
  Insert image description here

Step 2: Make a simple project

  Let it use the full screen/normal display toggle:
  Insert image description here

Step 3: Run the test locally

  Insert image description here

  Click "Full Screen Switch":
  Insert image description here


Build a cross-compiled Qt compiler on ubuntu (test the official buildroot qt board)

  (PS: What is officially provided is the qt cross-compilation environment of buildroot. Here we first test whether we can use this board for display).

Step 1: Download and unzip

  Download the official package for compiling qt:
  Insert image description here

  Put it on the host machine and unzip it:
  Insert image description here

Step 2: Open the QtCreator configuration environment

  Configure qmake of Qt board
  Insert image description here

  Insert image description here

  Configure the cross compiler gcc
  Insert image description here

  Insert image description here

  Insert image description here

  Then create a new compilation package:
  Insert image description here

  Insert image description here

Step 3: Switch the project to the buildroot package

  Insert image description here

Step 4: Compile the project

  Insert image description here

  Insert image description here

Step 5: Get it on the development board and use sftp to get there

  Ubuntu comes with the commonly used ssh and stfp. The username and password are both topeet, so you can use the regular filezile method to pass them over. Run and find few libraries. First test a simple c project, and then see if it is necessary to transplant the qt stuff:
  Insert image description here

  Find the cross-compiler folder, it is in sysroot:
  Insert image description here

  Get it to him:
  Insert image description here

  Insert image description here

  Check sysroot:
  Insert image description here

  Didn't find a copy? (It used to be usr/lib, this is now in usr/local/lib)
  Insert image description here

  Copy again (I found that Qt5 is also there, so I saved it and did it separately):
  Insert image description here

  Copy failed and found that the size is not enough (the lib package has 1.4 G, which is less than 800MB. Even if the full library of Qt is extracted separately, it is more than 800MB, as a person):
  Insert image description here


summary

  Those compiled with the cross-compiler of buildroot-qt can be put on Ubuntu, because their kernel and cross-compiler board are the same, and Ubuntu is also built with a cross-compiler.
  Insert image description here

  But because the space is small, libraries with qt cannot be transplanted (Qt, ffmpeg, and Qt applications will need to be transplanted later, which is relatively troublesome, so I will not continue). Change the buildroot system (because qt has already been done) Library, then Ubuntu originally thought it supported additional USB touch screens, but now it does not support it, so it is more appropriate to replace the buildroot)


Previous article: " RK3568 Development Notes (6): Development board to program Ubuntu firmware (supports mipi screen mirroring + HDMI screen mirroring) " Next article: " RK3568 Development Notes (8): Development board to program buildroot firmware ( Supports mipi screen mirroring + HDMI screen mirroring) hdmi screen), build a Qt cross-compilation development environment, compile a Demo, and run the Demo test on the target board


If the article is an original article, please indicate the source of the original article when reprinting it.
The blog address of this article: https://hpzwl.blog.csdn.net/article/details/132733901

Guess you like

Origin blog.csdn.net/qq21497936/article/details/132733901