关于c:100ASKIMX6ULLPRO开发板QT移植过程说明

3次阅读

共计 4459 个字符,预计需要花费 12 分钟才能阅读完成。

百问网对于 Qt 的移植过程没有做非常具体且零碎的阐明,导致初学者的我在移植时破费了较多工夫,特此写下此文给有须要的人参考。
下述阐明基于百问网提供的环境进行形容 (网上搜寻到的个别是在全新环境进行构建)。

一、应用 repo 获取内核及工具链等

1. 配置 repo

下载 repo 工具前须要设置 git 的邮箱和用户名,git 邮箱和用户名请依据集体状况进行配置。

book@100ask:~$ git config --global user.email "user@100ask.com"
book@100ask:~$ git config --global user.name "100ask"

留神: 请先配置 git 邮箱和用户名,否则会导致下载失败(如下为参考示例图)。

2. 下载源码

执行以下 4 条命令,为不便大家复制,第 3 条是很长的命令,应用了 \ 来换行,须要一并拷贝:

book@100ask:~$ git clone https://e.coding.net/codebug8/repo.git
book@100ask:~$ mkdir -p 100ask_imx6ull-sdk && cd 100ask_imx6ull-sdk
book@100ask:~/100ask_imx6ull-sdk$ ../repo/repo init -u \
 https://gitee.com/weidongshan/manifests.git -b \
linux-sdk -m imx6ull/100ask_imx6ull_linux4.9.88_release.xml  --no-repo-verify
book@100ask:~/100ask_imx6ull-sdk$  ../repo/repo sync -j4

留神: 是在 book@100ask:~$ 目录下执行的操作

二、配置穿插编译工具链

1. 设置穿插工具链

关上配置文件 vim ~/.bashrc, 在文件开端增加以下命令

export ARCH=arm
export CROSS_COMPILE=arm-buildroot-linux-gnueabihf-
export PATH=$PATH:/home/book/100ask_imx6ull-sdk/ToolChain/arm-buildroot-linux-gnueabihf_sdk-buildroot/bin

设置结束后,要执行 source ~/.bashrc 命令使其失效,这条命令是加载这些设置的环境变量

2. 测试穿插工具链

测试环境变量:

book@100ask:~$ echo $ARCH
arm
book@100ask:~$ echo $CROSS_COMPILE
arm-buildroot-linux-gnueabihf-

测试穿插编译器:

book@100ask:~$ arm-buildroot-linux-gnueabihf-gcc -v

三、应用 Buildroot 构建根文件系统

1. 源码编译构建取得

留神:在构建前,须要将虚拟机的内存设置为 6GB 及以上 否则会中途报错!!

顺次执行以下命令

book@100ask:~/100ask_imx6ull-sdk$ pwd
/home/book/100ask_imx6ull-sdk
book@100ask:~/100ask_imx6ull-sdk $ cd Buildroot_2020.02.x 
book@100ask:~/100ask_imx6ull-sdk/Buildroot_2020.02.x$ make clean
book@100ask:~/100ask_imx6ull-sdk/Buildroot_2020.02.x$
make 100ask_imx6ull_pro_ddr512m_systemV_qt5_defconfig
book@100ask:~/100ask_imx6ull-sdk/ Buildroot_2020.02.x$ make all

留神:编译过程须要很长的工夫(5~6 小时),次要是会波及到很多依赖文件须要到外网下载,而外网的下载速度是很慢的. 编译实现后如下图所示:

2. 网络间接下载取得

源码编译的过程是漫长的,而且中途可能会出错,因而提供编译好的根文件系统以供下载

点击下载编译好的根文件系统

下载失去 Buildroot_2020.02.x.tar 包文件,之后顺次执行以下命令

book@100ask:~/100ask_imx6ull-sdk$ pwd
/home/book/100ask_imx6ull-sdk
book@100ask:~/100ask_imx6ull-sdk$ rm -rf Buildroot_2020.02.x
book@100ask:~/100ask_imx6ull-sdk$ tar –xvf Buildroot_2020.02.x.tar

四、Qtcreator 装置配置

1. 下载安装

点击下载 Qt 5.12.8

执行以下命令开始装置,图形化流程不再赘述

book@100ask:~/Desktop$ chmod 777 qt-opensource-linux-x64-5.12.8.run
book@100ask:~/Desktop$ ./qt-opensource-linux-x64-5.12.8.run

2. 配置开发环境

a. 在 QtCreator 界面中,顺次点击 tools -> options

b. 设置编译器, 顺次点击 Compilers -> Add -> Custom -> C/C++ 增加编译器

b.1 对于 C++ 编译器顺次增加以下内容

/home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
/usr/bin/make

b.2 对于 C 编译器顺次填写以下内容

/home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
/usr/bin/make

c. 增加 Qt 版本,顺次点击 Qt Versions -> Add,填写以下内容

d. Kits 设置,顺次点击 Kits -> Add,填写以下内容

/home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin

e. 点击 OK 实现配置

五、tslib 编译配置

1. 源文件下载

01_all_series_quickstart\
    04_嵌入式 Linux 利用开发基础知识 \source\11_input\
        02_tslib\

2. 穿插编译

book@100ask:~$ pwd
/home/book
book@100ask:~$ ls
100ask_imx6ull-sdk  Downloads         nfs_rootfs  repo       tslib-1.21.tar.xz
Desktop             examples.desktop  Pictures    snap       Videos
Documents           Music             Public      Templates
book@100ask:~$ tar xvf tslib-1.21.tar.xz
book@100ask:~$ cd tslib-1.21/
book@100ask:~/tslib-1.21$ ./configure --host=arm-linux-gnueabihf  --prefix=/
book@100ask:~/tslib-1.21$ make
book@100ask:~/tslib-1.21$ make install DESTDIR=$PWD/tmp

3. 复制头文件、库文件放到工具链目录

book@100ask:~/tslib-1.21$ cd tmp/
book@100ask:~/tslib-1.21tmp/$ cp include/* /home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/include
book@100ask:~/tslib-1.21tmp/$ cp -d lib/*so*  /home/book/100ask_imx6ull-sdk/ToolChain/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib/

4. 复制依赖文件到开发板

book@100ask:~$ pwd
/home/book
book@100ask:~$ cp -r tslib-1.21 nfs_rootfs/
book@100ask:~$ cd nfs_rootfs/
book@100ask:~/nfs_rootfs$ ls
tslib-1.21

留神:以下命令在开发板命令行实现(同时确保开发板网络文件系统已挂载)

cp  /mnt/tslib-1.21/tmp/lib/*so*  -d     /lib
cp  /mnt/tslib-1.21/tmp/bin/*            /bin
cp  /mnt/tslib-1.21/tmp/etc/ts.conf  -d  /etc

5. 批改开发板环境变量

关上 sudo vi /etc/profile 文件,在开端增加如下:

export XDG_RUNTIME_DIR=/usr/lib/
export RUNLEVEL=3

export QT_QPA_FB_DISABLE_INPUT=1
export QT_QPA_GENERIC_PLUGINS=tslib
export QT_QPA_FONTDIR=/usr/lib/fonts
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CONSOLEDEVICE=none
export QT_QPA_FB_TSLIB=1
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event1

六、最初的测试

1. 敞开默认的 GUI 程序

对于 IMX6ULL,首先须要敞开默认的 qt gui 程序才可进行后续的测试,敞开命令如下所示:

[root@100ask:~]# mv   /root/S99myirhmi2 /etc/init.d/
[root@100ask:~]# reboot

2. Ubutun 下的 Qt 程序编写

编译时留神抉择 Kit 工具

3. 开发板运行测试

显示及触摸都是失常的,然而跑简单页面卡顿显著

演示用的源文件

正文完
 0