当前位置:网站首页>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
边栏推荐
- 基于全志H3的QT5.12.9移植教程
- 北京炒股开户选择手机办理安全吗?
- Multi table operation - one to one, one to many and many to many
- 正则表达式收集
- Use the htaccess file to prohibit the script execution permission in the directory
- Timer和ScheduledThreadPoolExecutor的区别
- Soft exam information system project manager_ Compiled abbreviations of the top ten management processes to help memory recitation - -- software test advanced information system project manager 054
- MySQL Replication中并行复制怎么实现
- Kubernetes resource object introduction and common commands (III)
- [Qt] résoudre le problème que Qt msvc 2017 ne peut pas Compiler
猜你喜欢
Write some suggestions to current and future doctoral students to sort out and share
Leetcode medium question sharing (5)
leetcode96不同的二叉搜索樹
LDR6035智能蓝牙音响可对手机设备持续充放电方案
Jielizhi, production line assembly link [chapter]
SQL数据分析之子查询的综合用法和案例题【耐心整理】
Asp .NetCore 微信订阅号自动回复之文本篇
Difficult to get up syndrome (bit by bit greed)
Linux CentOS7安装Oracle11g的超完美新手教程
SQL数据分析之流程控制语句【if,case...when详解】
随机推荐
比较通俗易懂的PID理解
ADO. Net SqlConnection object usage summary
基于全志H3的QT5.12.9移植教程
Door level modeling - after class exercises
关联性——组内相关系数
Linux CentOS7安装Oracle11g的超完美新手教程
The essence of software architecture
Asp . Text of automatic reply to NETCORE wechat subscription number
[QT] solve the problem that QT MSVC 2017 cannot compile
求逆序数的三个方法
Concurrentskiplistmap -- principle of table skipping
2021 robocom world robot developer competition - semi finals of higher vocational group
写给当前及未来博士研究生一些建议整理分享
LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电
TS initial use, TS type
Leetcode 96 différents arbres de recherche binaires
How excel opens CSV files with more than one million lines
正则表达式收集
Graduation season is both a farewell and a new beginning
MySQL Replication中并行复制怎么实现