2021-03-08

Posted chocolate2018

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2021-03-08相关的知识,希望对你有一定的参考价值。

在Wandboard上使用yocto构建Qt5

假设你已经开始使用Yocto和Wandboard(如果没有,请参阅Getting_started_with_Yocto_on_Wandboard)…
这些指示在哪里测试与Yocto Dizzy
内容
•1克隆meta-qt5
•2编辑yocto配置文件
•3 Bitbake !
•4测试你的映像
•5 交叉编译QtCreator的Qt5
5.1 bitbake a meta-toolchain-qt5
5.2安装新的工具链
5.3配置Qt creator
克隆meta-qt5
在yocto/sources目录中获取最新稳定的meta-qt5:

$ git clone -b dizzy https://github.com/meta-qt5/meta-qt5.git

确保为meta-qt5克隆与其他层相同的分支!(这里我们使用的是dizzy,所以用您首选的分支替换“dizzy”。)
编辑您的yocto配置文件

  1. 编辑yocto/build/conf/ bbllayers .conf,在最后添加meta-qt5层:
$BSPDIR/sources/meta-qt5 \\
 $BSPDIR/sources/meta-openembedded/meta-ruby \\
 $BSPDIR/sources/meta-openembedded/meta-multimedia \\
  1. 编辑yocto/build/conf/local.conf并添加:
    EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh "
IMAGE_INSTALL_append = " gcc g++ binutils libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev \\
autoconf automake ccache chkconfig glib-networking glibmm \\
packagegroup-core-buildessential pkgconfig  \\
boost cmake zlib glib-2.0 packagegroup-fsl-tools-testapps  \\
    ruby \\
    cpufrequtils \\
    nano \\
    gdb \\
    gstreamer \\
    gst-meta-video \\
    gst-fsl-plugin \\
    gst-plugins-base-app \\
    gst-plugins-base \\
    gst-plugins-good \\
    gst-plugins-good-rtsp \\
    gst-plugins-good-udp \\
    gst-plugins-good-rtpmanager \\
    gst-plugins-good-rtp \\
    gst-plugins-good-video4linux2 \\
    openssh-sftp-server \\
    packagegroup-fsl-gstreamer \\
    packagegroup-fsl-tools-testapps \\
    packagegroup-fsl-tools-benchmark \\
    imx-vpu \\
    imx-test \\    	
    qtbase-fonts \\
    qtbase-plugins \\
    qtbase-tools \\
    qtbase-examples \\
    qtdeclarative \\
    qtdeclarative-plugins \\
    qtdeclarative-tools \\
    qtdeclarative-examples \\
    qtdeclarative-qmlplugins \\
    qtmultimedia \\
    qtmultimedia-plugins \\
    qtmultimedia-examples \\
    qtmultimedia-qmlplugins \\
    qtsvg \\
    qtsvg-plugins \\
    qtsensors \\
    qtimageformats-plugins \\
    qtsystems \\
    qtsystems-tools \\
    qtsystems-examples \\
    qtsystems-qmlplugins \\
    qtscript \\
    qt3d \\
    qt3d-examples \\
    qt3d-qmlplugins \\
    qt3d-tools \\
    qtwebkit \\
    qtwebkit-examples-examples \\
    qtwebkit-qmlplugins \\
    qtgraphicaleffects-qmlplugins \\
    qtconnectivity-qmlplugins \\
    qtlocation-plugins \\
    qtlocation-qmlplugins \\
    cinematicexperience \\
    cairo pango fontconfig freetype pulseaudio dbus \\
    alsa-lib alsa-tools alsa-state alsa-utils-alsaconf fsl-alsa-plugins \\
    i2c-tools \\ 
    "

我们在EXTRA_IMAGE_FEATURES 中包含ssh-server-openssh,在IMAGE_INSTALL_append中包含openssh-sftp-server,以便使用QtCreator进行快速部署
•注意:qtquickcontrols-qmlplugins在主分支失败
如果您计划使用’core-image-minimal’映像,那么必须将’dbus’添加到IMAGE_INSTALL_append列表中。
如果你计划使用Qt5 eglfs插件来使用framebuffer加速图形,你需要抛弃X11和wayland,这样才能包含适当的图形驱动:
DISTRO_FEATURES_remove = “x11 wayland”
• Wandboard Linux内核3.10.17在设备树中配置了24位深度,用于HDMI和LCD显示。如果您在eglfs平台上运行Qt5应用程序时遇到问题,请在您自己的内核分支中将位深度更改为32位,或者在运行任何egl应用程序之前使用fbset (fbset [w] [h] [w] [h] 32)。
Bitbake !
Bitbake一个像core-image-minimal这样的图像(你需要在你的yocto/build目录下):

$ bitbake fsl-image-multimedia-full

注意:如果bitbake因为一个关于cmake或drm配方的错误而失败,请找到它们的目录,删除它们,然后重试。
测试你的映像
启动你的图像并使用CinematicExperience测试你的Qt5安装(如果使用eglfs和触摸屏,则使用以下参数):

$ Qt5_CinematicExperience -platform eglfs

为QtCreator交叉编译Qt5
现在,使用QtCreator构建交叉编译环境非常容易。版本1.7中的路径指的是Yocto Dizzy分支,如果你使用不同的分支请使用相应的路径。
bitbake一meta-toolchain-qt5
Bitbake一个poky的工具链(你需要在你的yocto/build目录下):

$ bitbake meta-toolchain-qt5

安装新的工具链
运行在yocto/build/tmp/deploy/sdk中生成的新安装程序

$ sh poky-eglibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-1.7.sh

这将安装一个交叉编译器及其所需的环境,包括Qt5 arm库。
配置Qt的创造者
在运行位于/opt/poky/1.7中的安装环境脚本后,在终端上运行qtcreator
在QtCreator中,转到Tools>Options>Devices,然后将您的Wandboard添加为通用linux设备。
转到“工具”>“选项”>“构建和运行”和:

  1. 添加一个新的编译器。选择poky编译器:/opt/poky/1.7/sysroot /x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-cpp
  2. 通过选择位于/opt/poky/1.7/sysroot /x86_64-pokysdk-linux/usr/bin/qt5中的qmake,添加新的交叉编译的Qt版本
  3. 添加一个新的工具包,选择新的Qt5版本和编译器,并将sysroot设置为/opt/poky/1.7/sysroot /cortexa9hf-vfp-neon-poky-linux-gnueabi,并让Qt mkspec为空。最后,为设备选择你的wandboard。

以上是关于2021-03-08的主要内容,如果未能解决你的问题,请参考以下文章

构建数据中台——数据只有被使用起来,才能创造价值

团队型代码设计规则

“云计算”将创造未来互联网新生活(幸福的云家人)

IPFS创造新一轮的数据革命

《未来简史》经典句子

2021-03-08