“Imx-4.1.15 Yocto-2.1 系统使用”的版本间的差异

来自ARM Wiki
跳转至: 导航搜索
(创建页面,内容为“该yocto系统是基于x11显示协议的嵌入式系统。系统集成的qt支持x11显示插件。 ==基础信息== ===用户密码=== 系统默认使用root用...”)
 
第3行: 第3行:
 
==基础信息==
 
==基础信息==
 
===用户密码===
 
===用户密码===
系统默认使用root用户登录,并支持root用户ssh远程登录,给目标系统root用户设置密码为root<br />
+
系统默认使用root用户登录,并支持root用户ssh远程登录,免密码。
<syntaxhighlight lang="bash">
 
$ passwd root
 
> root
 
> root
 
</syntaxhighlight>
 
  
 
==QT开发==
 
==QT开发==
第21行: 第16行:
 
sudo apt-get install asciidoc autoconf autotools-dev bash bc binfmt-support binutils bison build-essential bzip2 chrpath cmake cpio curl cvs dblatex device-tree-compiler diffstat expect fakeroot file flex g++ gawk gcc genext2fs git git-gui gitk g++-multilib graphviz gzip intltool libdrm-dev libglade2-dev libglib2.0-dev libgtk2.0-dev liblz4-tool libncurses5 libqt4-dev libsigsegv2 libssl-dev libudev-dev libusb-1.0-0-dev linaro-image-tools live-build m4 make mercurial mtools ncurses-dev openssh-client parted patch patchelf perl python python-linaro-image-tools python-matplotlib python-pip qemu-user-static repo rsync sed ssh subversion tar texinfo u-boot-tools unzip w3m wget libdb1-compat python3-pyelftools
 
sudo apt-get install asciidoc autoconf autotools-dev bash bc binfmt-support binutils bison build-essential bzip2 chrpath cmake cpio curl cvs dblatex device-tree-compiler diffstat expect fakeroot file flex g++ gawk gcc genext2fs git git-gui gitk g++-multilib graphviz gzip intltool libdrm-dev libglade2-dev libglib2.0-dev libgtk2.0-dev liblz4-tool libncurses5 libqt4-dev libsigsegv2 libssl-dev libudev-dev libusb-1.0-0-dev linaro-image-tools live-build m4 make mercurial mtools ncurses-dev openssh-client parted patch patchelf perl python python-linaro-image-tools python-matplotlib python-pip qemu-user-static repo rsync sed ssh subversion tar texinfo u-boot-tools unzip w3m wget libdb1-compat python3-pyelftools
 
</syntaxhighlight>
 
</syntaxhighlight>
主机PC端环境以Ubuntu16.04为例,目标板系统为buildroot嵌入式系统,默认使用root用户登录,并支持root用户ssh远程登录,给目标系统root用户配置密码为root<br />
+
主机PC端环境以Ubuntu16.04为例,目标板系统为yocto嵌入式系统。
<syntaxhighlight lang="bash">
+
下载[http://norcord.com:8070/f/6827e50fef7d41cd8f04/?dl=1 qt开发SDK],SDK中包含交叉编译工具链、qmake、sysroot等,终端执行命令进行安装:
$ passwd root
+
<br />
> root
 
> root
 
</syntaxhighlight>
 
SDK与系统镜像一同发布,从相应的烧录包中获取SDK。SDK中包含交叉编译工具链、qmake、与目标板系统的rootfs。解压SDK到任意目录$TOP_DIR(示例中以路径/home/lin/trash为例),并运行开发环境配置脚本<br />
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ tar host.tar.gz -C $TOP_DIR
+
./fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh
$ cd $TOP_DIR/host
 
$ ./relocate-sdk.sh
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
默认安装在/opt/fsl-imx-x11/4.1.15-2.1.0,可自定义修改。
 +
可下载qt示例程序[http://norcord.com:8070/f/6080a212fc55499f8ac8/?dl=1 examples],并解压到任意路径。
 
===使用终端命令行编译运行qt程序===
 
===使用终端命令行编译运行qt程序===
 
qt程序使用SDK中的qt5 examples例程,通过qmake、make命令进行编译
 
qt程序使用SDK中的qt5 examples例程,通过qmake、make命令进行编译

2022年1月17日 (一) 20:19的版本

该yocto系统是基于x11显示协议的嵌入式系统。系统集成的qt支持x11显示插件。

基础信息

用户密码

系统默认使用root用户登录,并支持root用户ssh远程登录,免密码。

QT开发

搭建qt开发环境

x86主机或虚拟机的系统用Ubuntu16.0或Ubuntu18.04进行交叉编译开发,开发环境配置参考如下:
Ubuntu16.04系统主机编译环境建议安装

sudo apt-get install repo git-core gitk git-gui gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler gcc-aarch64-linux-gnu mtools parted libudev-dev libusb-1.0-0-dev python-linaro-image-tools linaro-image-tools autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs git mercurial rsync openssh-client subversion asciidoc w3m dblatex graphviz python-matplotlib libc6:i386 libssl-dev texinfo liblz4-tool genext2fs expect patchelf gawk

Ubuntu18.04系统主机编译环境建议安装

sudo apt-get install asciidoc autoconf autotools-dev bash bc binfmt-support binutils bison build-essential bzip2 chrpath cmake cpio curl cvs dblatex device-tree-compiler diffstat expect fakeroot file flex g++ gawk gcc genext2fs git git-gui gitk g++-multilib graphviz gzip intltool libdrm-dev libglade2-dev libglib2.0-dev libgtk2.0-dev liblz4-tool libncurses5 libqt4-dev libsigsegv2 libssl-dev libudev-dev libusb-1.0-0-dev linaro-image-tools live-build m4 make mercurial mtools ncurses-dev openssh-client parted patch patchelf perl python python-linaro-image-tools python-matplotlib python-pip qemu-user-static repo rsync sed ssh subversion tar texinfo u-boot-tools unzip w3m wget libdb1-compat python3-pyelftools

主机PC端环境以Ubuntu16.04为例,目标板系统为yocto嵌入式系统。 下载qt开发SDK,SDK中包含交叉编译工具链、qmake、sysroot等,终端执行命令进行安装:

./fsl-imx-x11-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-4.1.15-2.1.0.sh

默认安装在/opt/fsl-imx-x11/4.1.15-2.1.0,可自定义修改。 可下载qt示例程序examples,并解压到任意路径。

使用终端命令行编译运行qt程序

qt程序使用SDK中的qt5 examples例程,通过qmake、make命令进行编译

$ export PATH=$TOP_DIR/host/bin:$PATH
$ cd $TOP_DIR/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/opengl/hellowindow
$ qmake
$ make

生成hellowindow程序,可通过scp拷贝到目标板中直接运行

$ scp hellowindow root@10.168.1.247:
$ ssh root@10.168.1.247
$ ./hellowindow

系统在/etc/init.d/S50launcher开机启动服务中,启动了wayland显示服务,并运行了QLauncher桌面,若使用eglfs或linuxfb显示插件,则需要移除S50launcher服务

$ mv /etc/init.d/S50launcher ~
$ sync
$ reboot

指定eglfs显示插件运行程序

$ ./hellowindow -platform eglfs

Projects 0.jpg

指定linuxfb显示插件运行程序

$ ./calculator -platform linuxfb

使用qtcreator开发调试qt程序

qtcreator集成编辑、编译、运行、调试环境于一体,提升开发效率

安装qtcreator

$ sudo apt-get install qtcreator


添加Qt Versions
Tools --> Options --> Build & Run --> Qt Versions --> Add --> 选中qmake路径 --> Apply
Qtcreator1 Qt Versions.png


添加Compilers
Tools --> Options --> Build & Run --> Compilers --> Add --> GCC -- 选中g++路径 --> Apply
注意:选中g++路径,并修改ABI一栏明确指示平台架构为arm
Qtcreator1 Compilers.png


添加Devices(可选项)
Tools --> Options --> Devices --> Add --> General Linux Device --> start Wizard
Qtcreator1 Devices.png

并点击"Test"测试设备联通
Device Test.png


添加Kits
Tools --> Options --> Build & Run --> Kits --> Add --> Apply
Qtcreator1 Kits.png


打开 hellowindow 工程并选择Kits
Welcome --> Open Porject --> 选择工程路径 /home/lin/trash/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/opengl/hellowindow/hellowindow.pro --> Configure Project
Qtcreator1 Configure Project.png


编译运行 hellowindow
Build --> Build Project "hellowindow" --> 重启qtcreator --> Build --> Run
Projects 1.png

Projects 2.jpg