当前位置:网站首页>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
边栏推荐
- Three methods of finding inverse numbers
- Ldr6035 smart Bluetooth audio can continuously charge and discharge mobile devices
- Chapter 6 data flow modeling
- Multi table operation - one to one, one to many and many to many
- 回顾数据脱敏系统
- Jielizhi Bluetooth headset quality control and production skills [chapter]
- 下载在线视频 m3u8使用教程
- Which app is better and more secure for stock mobile account opening
- 牛客-练习赛101-推理小丑
- Selectively inhibiting learning bias for active sampling
猜你喜欢

Leetcode 96 différents arbres de recherche binaires
![[Qt] résoudre le problème que Qt msvc 2017 ne peut pas Compiler](/img/35/e458fd437a0bed4bace2d6d65c9ec8.png)
[Qt] résoudre le problème que Qt msvc 2017 ne peut pas Compiler

使用VB.net将PNG图片转成icon类型图标文件

SQL Server 安装指南

SQL数据分析之子查询的综合用法和案例题【耐心整理】

Difficult to get up syndrome (bit by bit greed)

Graduation season is both a farewell and a new beginning

Door level modeling - after class exercises

2021 robocom world robot developer competition - semi finals of higher vocational group

leetcode96不同的二叉搜索樹
随机推荐
二叉搜索树的创建,查找,添加,删除操作
Selectively inhibiting learning bias for active sampling
LDR6035智能蓝牙音响可对手机设备持续充放电方案
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
华为HMS Core携手超图为三维GIS注入新动能
algolia 搜索需求,做的快自闭了...
cookie、session、tooken
vs2015 AdminDeployment. xml
Kubernetes resource object introduction and common commands (III)
Difficult to get up syndrome (bit by bit greed)
写给当前及未来博士研究生一些建议整理分享
Openvino model performance evaluation tool DL workbench
SQL数据分析之子查询的综合用法和案例题【耐心整理】
使用uni-simple-router,动态传参 TypeError: Cannot convert undefined or null to object
使用多线程Callable查询oracle数据库
ADO.NET之SqlDataAdpter对象
Using SqlCommand objects in code
一个实习生的CnosDB之旅
求逆序数的三个方法
S32Kxxx bootloader之UDS bootloader