当前位置:网站首页>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
边栏推荐
- SQL数据分析之流程控制语句【if,case...when详解】
- [QT] solve the problem that QT MSVC 2017 cannot compile
- I would like to ask, which securities is better for securities account opening? Is it safe to open a mobile account?
- Vue force cleaning browser cache
- 使用多线程Callable查询oracle数据库
- Overview of edge calculation
- leetcode96不同的二叉搜索树
- RPA教程01:EXCEL自动化从入门到实操
- Three methods of finding inverse numbers
- Various global files related to [.Net core] program
猜你喜欢

Download the online video m3u8 tutorial

Leetcode medium question sharing (5)

【QT】對於Qt MSVC 2017無法編譯的問題解决

UDS bootloader of s32kxxx bootloader

Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
![[QT] solve the problem that QT MSVC 2017 cannot compile](/img/35/e458fd437a0bed4bace2d6d65c9ec8.png)
[QT] solve the problem that QT MSVC 2017 cannot compile

The origin of usb-if Association and various interfaces
![Various global files related to [.Net core] program](/img/89/32623abf30d3dc92a3cdb1710a624f.png)
Various global files related to [.Net core] program

Leetcode 96 différents arbres de recherche binaires

SQL数据分析之流程控制语句【if,case...when详解】
随机推荐
Is it safe to choose mobile phone for stock trading account opening in Beijing?
2021 robocom world robot developer competition - preliminary competition of higher vocational group
LeetCode中等题题分享(5)
关联性——组内相关系数
PyCharm调用matplotlib绘图时图像弹出问题怎么解决
leetcode96不同的二叉搜索树
leetcode96不同的二叉搜索樹
回顾数据脱敏系统
如何提升数据质量
cookie、session、tooken
Use vb Net to convert PNG pictures into icon type icon files
Algolia's search needs are almost closed
Material design component - use bottomsheet to show extended content (I)
Leetcode 96 différents arbres de recherche binaires
Kubernetes resource object introduction and common commands (III)
RPA教程01:EXCEL自动化从入门到实操
algolia 搜索需求,做的快自闭了...
【模板】自适应辛普森积分
Jielizhi, production line assembly link [chapter]
Vue force cleaning browser cache