前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >[ 物联网篇 ] 01 - NXP i.MX 8M Mini 环境的搭建

[ 物联网篇 ] 01 - NXP i.MX 8M Mini 环境的搭建

作者头像
程序手艺人
发布2019-04-17 16:10:51
3.5K0
发布2019-04-17 16:10:51
举报
文章被收录于专栏:程序手艺人
在这里插入图片描述
在这里插入图片描述

记录下如何搭建NXP i.MX 8M 的开发环境。

1. 看文档 / 找资料

不管任何时候,接触任何新的平台或学习新的知识,首先就是看官网提供的文档,或搜索下是否有相关的资料。

在这里插入图片描述
在这里插入图片描述
2. 源码下载
  • 阅读下载的文章中i.MX_Yocto_Project_User’s_Guide.pdf详细介绍了下载源码的步骤。
代码语言:javascript
复制
// 下载repo 工具 
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

// 下载源码 
mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-rocko -m imx-4.9.88-2.0.0_ga.xml
repo sync
代码语言:javascript
复制
➜  imx-yocto-bsp ./repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-rocko -m imx-4.9.88-2.0.0_ga.xml
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 101] Network is unreachable
fatal: cloning the git-repo repository failed, will remove '.repo/repo' 

// 解决方案: 

先单独克隆repo,然后将git-repo里面的repo文件复制到bin目录,在同步源码的工作目录新建.repo文件夹,把git-repo重命名为repo复制到.repo目录下:
git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo 

参考解决:Cannot get http://gerrit.googlesource.com/git-repo/clone.bundle

  • 源码下载过程遇到的错误2 : ImportError: cannot import name 'spawn’
代码语言:javascript
复制
// 运行错误
➜  imx-yocto-bsp bitbake fsl-image-validation-imx
Traceback (most recent call last):
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/bin/bitbake", line 31, in <module>
    import bb
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/__init__.py", line 79, in <module>
    from bb import fetch2 as fetch
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1843, in <module>
    from . import clearcase
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/clearcase.py", line 72, in <module>
    from   distutils import spawn
ImportError: cannot import name 'spawn'

// 解决方案
安装sudo apt-get install python3-distutils 之后解决
  • 源码下载过程遇到的错误3 : ERROR: Unable to start bitbake server
代码语言:javascript
复制
ERROR: Unable to start bitbake server
ERROR: Last 10 lines of server log for this session (/home/mike/Work/nxp-imx8/imx-yocto-bsp/bitbake-cookerdaemon.log):
    self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/cooker.py", line 197, in __init__
    self.initConfigurationData()
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/cooker.py", line 356, in initConfigurationData
    self.databuilder.parseBaseConfiguration()
  File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/cookerdata.py", line 316, in parseBaseConfiguration
    raise bb.BBHandledException
bb.BBHandledException
ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:
  chrpath
  
//解决方案 
sudo apt-get install chrpath
sudo apt-get install texinfo 

参考Unable to connect to bitbake server


2.1 编译
代码语言:javascript
复制
DISTRO=<distro name> MACHINE=<machine name> source fsl-setup-release.sh -b <build dir>
// DISTRO
DISTRO= <distro configuration name> is the distro, which configures the build environment and it is stored in meta-fsl-
bsp-release/imx/meta-sdk/conf/distro .

对应源码中的 sources/meta-fsl-bsp-release/imx/meta-sdk/conf/distro/fsl-imx-x11.conf,可以看到 

DISTRO = "fsl-imx-x11"

// MACHINE
MACHINE= <machine configuration name> is the machine name which points to the configuration file in conf/machine in
meta-freescale and meta-fsl-bsp-release.

// 编译输出的目录 
-b <build dir> specifies the name of the build directory created by the fsl-setup-release.sh script.

通过分析 fsl-setup-release.sh 脚本了解的一些信息

代码语言:javascript
复制
// MACHINE默认参数为imx6qpsabresd
if [ -z "$MACHINE" ]; then
    echo setting to default machine
    MACHINE='imx6qpsabresd'
fi
3. 固件烧录
  • NXP 固件烧录借助于uuu (Universal Update Utility) mfgtools,全平台覆盖
在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019年04月05日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. 看文档 / 找资料
  • 2. 源码下载
    • 2.1 编译
    • 3. 固件烧录
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档