美文网首页
IMX8MMEVK-Yocto环境搭建

IMX8MMEVK-Yocto环境搭建

作者: Lazy_Caaat | 来源:发表于2020-05-04 14:28 被阅读0次

yocto环境搭建篇

根据i.MX_Yocto_Project_User's_Guide.PDF这个文档,推荐用18.04 or later,我这里用的是16.04 版本的

sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
sudo apt-get install xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
sudo apt-get install u-boot-tools
文档中建议添加如下两条配置文件,经查默认已添加(/imx-yocto-bsp/build-imx8mmevk/conf/local.conf)
Ubuntu 16.04 users have commented on errors during build for SDL. To fix this comment out in local.conf the following
lines as such adding # character
#PACKAGECONFIG_append_pn-qemu-native = " sdl"
#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
默认已添加
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

把如下环境变量代码添加到 ".bashrc"文件中

export PATH=~/bin:$PATH

配置git账号并确认无误

$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list

同步IMX8的BSP代码repo

$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-warrior -m imx-4.19.35-1.1.0.xml
$ repo sync

同步过程中建议使用代理加速,中间过程容易中断,重新repo sync就行,直至结束。

编译篇

machine类型

• imx6qpsabreauto
• imx6qpsabresd
• imx6ulevk
• imx6ulz14x14evk
• imx6ull14x14evk
• imx6ull9x9evk
• imx6dlsabreauto
• imx6dlsabresd
• imx6qsabreauto
• imx6qsabresd
• imx6slevk
• imx6solosabreauto
• imx6solosabresd
• imx6sxsabresd
• imx6sxsabreauto
• imx6sllevk
• imx7dsabresd
• imx7ulpevk
• imx8qmmek
• imx8qxpmek
• imx8mqevk
• imx8mmevk
• imx8mnevk

DISTRO类型

• fsl-imx-x11 - X11 graphics are not supported on i.MX 8.
• fsl-imx-wayland - Wayland weston graphics.
• fsl-imx-xwayland - Wayland graphics and X11. X11 applications using EGL are not supported.
• fsl-imx-fb - Frame Buffer graphics - no X11 or Wayland. Frame Buffer is not supported on i.MX 8.

对于IMX8MMEVK,我们选择

在imx-yocto-bsp目录下执行
$ DISTRO=fsl-imx-xwayland  MACHINE=imx8mmevk source fsl-setup-release.sh -b ./build-imx8mm
每次退出终端后,重新进入编译环境都必须重新执行此命令,以指定板子类型,编译路径等

上面名会新生产一个build-imx8mm目录,后面如果需要其他板子(如imx8mnevk),请在imx-yocto-bsp下执行$ DISTRO=fsl-imx-xwayland MACHINE=imx8mnevk source fsl-setup-release.sh -b ./build-imx8mn 就会生成另一个文件夹,这样不会覆盖掉以前做好的东西。

选择要编译的镜像名称

支持的image name

简单介绍下

minimal 是一个最最最迷你的系统,仅仅能够启动板子,其他什么也没有
base  是包含一个console、以及基本的IMX8MMEVK官方版上的硬件驱动
sato 给移动系统用的,一般不用,支持X11
fsl-image-machine-test 是NXP community的测试镜像,不含GUI
multimedia 带一个GUI系统,但是不包含QT
imx-image-full 支持QT5,但有些板子不带GPU用不了
以上几种,编译时间依次边长,imx-image-full最长,需要下载编译8000+个文件。

开始编译,建议使用代理,否则几天也下载不完

$ bitbake imx-image-full
当遇到某个文件(例如tensorflow这个包)报告do fetch error的时候,Ctrl+C 结束编译,重新执行编译命令就会重新下载,这种事情经常遇到,所以哪个网快用哪个,或者换一个网络环境也会有效果(如在家下载不下来的文件,去公司就行,或者用手机4G流量,他们的网络出口不同,所以有些包的下载速度也不一样)
$ bitbake imx-image-full
当遇到某个文件(例如tensorflow这个包)一直报编译错误(do compile error)的时候,请使用如下命令清除它的临时文件,重新编译即可
$ bitbake tensorflow -c cleanall
$ bitbake imx-image-full

编译出来的镜像路径(请自行对应自己的路径),其中大多数都是软连接,请使用真正的image文件

/home/marvin/imx-yocto-bsp/build-imx8mmevk/tmp/deploy/images/imx8mmevk
编译出来的镜像1
编译出来的镜像2

给uboot指定启动介质并重新部署镜像(EMMC)

在这个文件中配置介质类型
/home/marvin/imx-yocto-bsp/build-imx8mmevk/conf/local.conf

$ echo "UBOOT_CONFIG = \"emmc\"" >> conf/local.conf
注意!!!!每次执行DISTRO=fsl-imx-xwayland  MACHINE=imx8mmevk source fsl-setup-release.sh -b ./build-imx8mm后,local.conf文件就会被清空成默认的,记得重新更改启动介质设置

$ MACHINE=<machine name> bitbake -c deploy u-boot-imx
添加后的效果

内核源码路径

执行如下命令即可定位
bitbake -e linux-imx  | grep ^S=
内核源码位置

修改uboot代码后,需要重新编译uboot并重新deploy image

Follow the below steps to build the u-boot
//bitbake -c cleansstate u-boot-imx  //deploy文件夹下面的uboot文件会被清除掉,源码会全部被恢复!!!!
只是改了代码的话,执行下面两条命令就会生成新的uboot
bitbake -c compile -f u-boot-imx // 编译uboot
bitbake u-boot-imx  //deploy下面会生成新的uboot

#####其他如内核 linux-imx(这里包含设备树),Zimage imx-boot等只需要替换掉u-boot-imx即可

修改完相关文件后,想把所有image都更新的话,就直接重新编译整个项目名
bitbake -c compile -f imx-image-full
bitbake imx-image-full

Zimage用于UUU的启动引导,包含1K字节的IVT头,输出文件是imx-boot-imx8mmevk-sd.bin-flash_evk

单独编译源码教程链接https://community.nxp.com/docs/DOC-343273

相关文章

  • IMX8MMEVK-Yocto环境搭建

    yocto环境搭建篇 根据i.MX_Yocto_Project_User's_Guide.PDF这个文档,推荐用1...

  • React Native学习总结篇

    一、环境搭建 1.1 React Native环境搭建 1.1.1 IOS环境搭建 环境:MacOS 注意:不要使...

  • linux 第四天

    Lamp环境搭建 /*******************Lamp环境搭建:*******************...

  • codePush说明

    codePush环境搭建 环境搭建文章:环境搭建 git地址:codePush git地址2.0.3,And...

  • angular学习--02英雄指南

    环境搭建 angular官网--搭建本地开发环境和工作空间windows 10 搭建angular开发环境免搭建环...

  • Gradle开发-Groovy环境搭建

    ##Groovy环境搭建 在使用 Groovy 之前首先要搭建几个环境: Groovy 的环境搭建 JDK 环境搭...

  • 搭建 LNMP + CodeIgniter 开发环境

    搭建 LNMP + CodeIgniter 开发环境搭建 LNMP 环境首先搭建 LNMP 的服务器环境安装 Ng...

  • iOS中RN与Flutter混合开发

    一 搭建环境 1. 搭建flutter环境 1.1 搭建系统开发环境 参考链接:https://flutter....

  • 第一个MyBatis程序

    思路:搭建环境---导入MyBatis--编写代码---测试! 一、搭建环境 1、搭建数据库环境: engine=...

  • Robot Framework用法总结

    一,环境的搭建 关于robotframework环境搭建请参考博文:Robot Framework的环境搭建[ht...

网友评论

      本文标题:IMX8MMEVK-Yocto环境搭建

      本文链接:https://www.haomeiwen.com/subject/svbeghtx.html