当前位置:网站首页>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
边栏推荐
- 第六章 数据流建模
- Linux centos7 installation Oracle11g super perfect novice tutorial
- Jielizhi Bluetooth headset quality control and production skills [chapter]
- mysql之B tree 以及 B+tree
- PyTorch学习记录
- [cmake] cmake configuration in QT Creator
- 【QT】QtCreator卸载与安装(非正常状态)
- Niuke - Practice 101 - reasoning clown
- 写给当前及未来博士研究生一些建议整理分享
- 微信小程序缓存过期时间的相关设置(推荐)
猜你喜欢
![[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

Windows installation WSL (II)

Door level modeling - after class exercises

leetcode96不同的二叉搜索樹

起床困难综合症(按位贪心)

时间复杂度与空间复杂度

USB-IF协会与各种接口的由来

SQL数据分析之流程控制语句【if,case...when详解】

Selectively inhibiting learning bias for active sampling

Deep learning | three concepts: epoch, batch, iteration
随机推荐
Using uni simple router, dynamically pass parameters typeerror: cannot convert undefined or null to object
SQL数据分析之窗口排序函数rank、dense_rank、raw_number与lag、lead窗口偏移函数【用法整理】
起床困难综合症(按位贪心)
门级建模—课后习题
.env.xxx 文件,加了常量,卻undefined
[QT] qtcreator uninstall and installation (abnormal state)
写给当前及未来博士研究生一些建议整理分享
在证券账户上买基金安全吗?哪里可以买基金
leetcode96不同的二叉搜索树
哈工大《信息内容安全》课程知识要点和难点
在代码中使用SqlCommand对象
Windows installation WSL (II)
vue 强制清理浏览器缓存
Asp . Text of automatic reply to NETCORE wechat subscription number
[C #] dependency injection and Autofac
Resumption of attack and defense drill
Is it safe to choose mobile phone for stock trading account opening in Beijing?
[untitled]
- Oui. Env. Fichier XXX, avec constante, mais non spécifié
Selectively inhibiting learning bias for active sampling