当前位置:网站首页>Qt5.12.9 migration tutorial based on Quanzhi H3
Qt5.12.9 migration tutorial based on Quanzhi H3
2022-07-02 00:05:00 【Wax gourd~】

List of articles
One . Preface

I played in College for a long time STM32 Single chip microcomputer ,STM32 Of MCU Most are based on Arm Cortex-M3/M4/M7 Architecture chip , It has strong real-time processing ability , but MCU Compared with MPU There are still limitations . Compared with MCU,MPU With higher processing and computing capabilities , Generally, you need to run a larger operating system ( Such as :Linux、Andriod) To achieve complex task processing , It's up to MPU It should have higher dominant frequency and stronger computing power , Chief representative :Arm Cortex-A Architecture's processor .
In order to complete the advanced on embedded , I bought a piece in a treasure Liunx Development board , The processor is based on ARM Cortex-A7 The whole ambition of architecture H3. The project needs to run on the development board QT application , But there is no QT Operating environment , You need to transplant it yourself .
Two . Download link
development environment :Ubuntu 18.04
Development board system : Lite version Linux3.4
Qt Source code :qt-everywhere-src-5.12.9
Qt Creater:qt-opensource-linux-x64-5.12.9.run
Cross compiler :gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-guneabi.tar.xz
- Development board information ( Including development board firmware and source code )https://pan.baidu.com/s/1a6F_0xYCsZj9S1xIl0FRmg( password :amxc)
- Qt Creater And Qt Source download link :https://download.qt.io/archive/qt/
- Cross compiler official download link :https://releases.linaro.org/components/toolchain/binaries/
- Cross compiler Tsinghua University mirror download link :https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/_toolchain/
- GLIBC Library official download link :https://sourceware.org/glibc/wiki/Glibc%20Timeline
- Xshell Download link of green version :https://423down.lanzouh.com/b0f2b54tc
among Qt If you don't want to search the source code and cross compiler directly on the official website , You can also directly CSDN download :
3、 ... and . System compilation
Update compiler
Linux The source code of the system is provided by the merchant , First, decompression. H3-DVK-lichee-201809.tar
To Ubuntu In the system ,Linux The default cross compiler version in the source code is too low , Need to replace with 4.9.4 edition
Cross compiler for . Replace the decompressed cross compiler in the source code lichee/brandy/gcc-linaro
Folder .

Source code compilation
First compilation , You need to import the default kernel configuration , Get into linux3.4
Folder . perform :
cp H3_defconfig .config
Return to lichee
Folder , Re execution :
./build.sh config
# Choose in turn 1 1 0 2
# If you are prompted usbwifi choice y
Only the first compilation requires config, Compile again later with the command
./build.sh
After successful compilation , Package firmware :
./build.sh pack
# Firmware location :tools/pack/sun8iw7p1_dragonboard_dolphin.img
Four . QT Source code compilation
Add compiler path
decompression Qt Source code to Ubuntu System , Modify file content :
route :qt-everywhere-src-5.12.9/qtbase/linux-arm-gnueabi-g++/qmake.conf
Purpose : Mainly to specify compilation Qt Compiler path of source code , Here, select just copied to lichee Compiler in source code .
#
# qmake configuration for building with arm-linux-gnueabi-g++
# MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.conf
QMAKE_CC = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-gcc
QMAKE_CXX = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-g++
QMAKE_LINK = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-g++
QMAKE_LINK_SHLIB = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-g++
# modifications to linux.conf
QMAKE_AR = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-objcopy
QMAKE_NM = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-nm -P
QMAKE_STRIP = /home/dell/linux_H3/lichee/brandy/gcc-linaro/bin/arm-linux-gnueabi-strip
load(qt_config)
To configure 、 compile 、 install
Get into qt-everywhere-src-5.12.9
directories creating config.sh
The configuration script , The content is :
./configure \
-prefix /home/dell/qt_install \
-xplatform linux-arm-gnueabi-g++ \
-confirm-license \
-opensource \
-release \
-shared \
-qt-zlib \
-qt-freetype \
-sql-sqlite \
-qt-libjpeg \
-no-qml-debug \
-no-dbus \
-no-gif \
-no-iconv \
-no-opengl \
-no-cups \
-no-glib \
-no-rpath \
-no-avx \
-no-openssl \
-nomake tools \
-qt-libpng \
-no-tslib \
among ,-prefix /home/dell/qt_install
For the specified Qt Library installation path ,-xplatform linux-arm-gnueabi-g++
Specify compiler for , Other options can be increased or decreased according to your own needs Qt Components , Cut properly .
Modify the Execution Authority
chmod 777 config,sh
Perform configuration
./config.sh
Compile source code
make -j16
install Qt
make install
After installation , Compiled Qt The library is right there /home/dell/qt_install
in .
5、 ... and . QT Migration and environment variable addition
Compile the last step Qt library , namely /home/dell/qt_install
, Copy the entire folder to lichee/buildroot/target/dragonboard/rootfs/opt/
in .

modify lichee/buildroot/target/dragonboard/extra/profile
, Add global variable :
export LD_LIBRARY_PATH=/opt/qt_install/lib
export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt_install/plugins
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
Recompile after modification linux, Packing system .
./build.sh
./build.sh pack
6、 ... and . upgrade GLIBC
Burn the firmware packaged in the previous step into the development board , Use Xshell
Connect the serial port to the development board and open the terminal , Get into opt/qt_install/example
Catalog , Open any one Qt Example , Execute the executable file under the corresponding folder .
Qt Error report in execution , This is because we have replaced a higher version of the cross compiler , The original in the system source code C/C++ The library does not support .
You can execute the following command under the corresponding folder to view the corresponding version number :
strings libstdc++.so.6 | grep CXXABI # stay /usr/lib In the implementation of , see CXXABI Version number
strings libc.so.6 | grep GLIBC # stay /lib In the implementation of , see GLIBC Version number

We need to migrate the corresponding library files in the new compiler into the system . The corresponding library file is in gcc-linaro/arm-linux-gnueabi/libc
Next .
Here, it is rude to copy all the files in this directory to lichee/buildroot/target/dragonboard/rootfs/lib/
as well as lichee/buildroot/target/dragonboard/rootfs/usr/lib/
in , Overwrite the library with the same name .
7、 ... and . function QT Program
After successfully upgrading the Library , Run again Qt Executable files in the case , A successful run , thus Qt.5.12.9 Successful transplantation .

8、 ... and . Reference material
边栏推荐
- cookie、session、tooken
- Key points of security agreement
- Three methods of finding inverse numbers
- - Oui. Env. Fichier XXX, avec constante, mais non spécifié
- Timer和ScheduledThreadPoolExecutor的区别
- Is it safe for qiniu college to open an account? How to open an account?
- S32Kxxx bootloader之UDS bootloader
- Use vb Net to convert PNG pictures into icon type icon files
- Material design component - use bottomsheet to show extended content (I)
- Write some suggestions to current and future doctoral students to sort out and share
猜你喜欢
Openvino model performance evaluation tool DL workbench
Leetcode 96 différents arbres de recherche binaires
Difficult to get up syndrome (bit by bit greed)
Niuke - Practice 101 - reasoning clown
Jielizhi, production line assembly link [chapter]
GCC compilation
Correlation - intra group correlation coefficient
[QT] qtcreator uninstall and installation (abnormal state)
LDR6035智能蓝牙音响可对手机设备持续充放电方案
电商RPA机器人,助力品牌电商抢立流量高点
随机推荐
kubernetes资源对象介绍及常用命令(三)
[QT] test whether QT can connect to the database
LDR6035智能蓝牙音响可对手机设备持续充放电方案
Chapter 6 data flow modeling
【QT】对于Qt MSVC 2017无法编译的问题解决
门级建模—课后习题
Record the accidental success and failure of uploading large files
Concurrentskiplistmap -- principle of table skipping
Is it safe to choose mobile phone for stock trading account opening in Beijing?
【QT】Qt 使用MSVC2017找不到编译器的解决办法
SQL数据分析之子查询的综合用法和案例题【耐心整理】
使用VB.net将PNG图片转成icon类型图标文件
第六章 数据流建模
Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
Multi table operation - one to one, one to many and many to many
mysql之B tree 以及 B+tree
多表操作-一对一,一对多与多对多
Door level modeling - after class exercises
vs2015 AdminDeployment.xml
[C #] dependency injection and Autofac