您现在的位置: 主页 > 嵌入式处理器 > FPGA > Zybo board 开发记录: 使用Yocto建立系统 - FPGA/ASIC技术 -
本文所属标签:
为本文创立个标签吧:

Zybo board 开发记录: 使用Yocto建立系统 - FPGA/ASIC技术 -

来源: 网络用户发布,如有版权联系网管删除 2018-08-18 

Zybo board 开发记录: 使用Yocto建立系统

本文转载自:coldnew's blog

在 zybo board 开发记录: 执行 Linux 操作系统 一文中,我们提到了如何自行编译 u-boot、Linux kernel、busybox 来让 Zybo Board 可以开机进到 SD 卡上的 Linux 系统。这一次,我们要来谈谈怎样使用 Yocto Project来建立 Zybo board 的 Linux 系统。

Yocto Project 是近年来各大 SoC 商以及开发板商皆参与的 Linux 系统构件工具,透过 Yocto Project 的协助,使用者可以针对自己的需求构件想要的映像档(image)或是 Root File System,和 Yocto 类似功能的工具则是buildroot 。

本文将以 Zybo Board 作为目标开发板,示范如何使用 Yocto 来构件他的系统。

预先准备

根据你使用的 Linux 发行板的不同,你需要安装一些套件,这边列出一些发行板的信息,详细请参考 

Debian/Ubuntu
coldnew@debian ~ $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-mulTIlib build-essenTIal chrpath socat

Fedora
coldnew@fedora ~ $ sudo dnf install gawk make wget tar bzip2 gzip python unzip perl patch diffuTIls diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat finduTIls which

Gentoo
coldnew@gentoo ~ $ emerge -v dev-vcs/git dev-util/diffstat app-arch/unzip sys-apps/texinfo app-admin/chrpath media-libs/libsdl2 sys-apps/iproute2 x11-terms/xterm net-nds/rpcbind

如果你和我一样,使用 Gentoo Linux 的话,在 Gentoo Linux 下要确认你使用的是 Python 2.7
coldnew@gentoo ~ $ eselect python set python2.7

eselect python list
Available Python interpreters:
[1] python2.7 *
[2] python3.2
[3] python3.3

python
Python 2.7.5 (default, Oct 19 2013, 22:52:27)

格式化 MicroSD 卡
在这次的开发中,我们要设定 MicroSD 卡片成两个分区,第一个是 fat32 格式,第二个则使用 ext4 格式,若不会使用 fdisk 命令的话,可以透过 gparted 来进行格式化,以下是我格式化卡片的范例 (8GB 卡片)。

Zybo board 开发记录: 使用Yocto建立系统

下载 Poky

在开始用 Yocto Project 之前,我们需要下载 Poky, Poky 是 Yocto 的构件系统,基本上我们会用到的东西都会在 poky 文件夹内

注意到我们这边切换到 krogoth 这个分支,Yocto 里面不同的分之(branch) 代表了不同版本。
coldnew@gentoo ~ $ git clone git://git.yoctoproject.org/poky -b krogoth

好了后,进入到 poky 文件夹
coldnew@gentoo ~/poky $ cd poky

下载 meta-xilinx
Yocto 对于不同的 SoC 厂商,会有提供不同的 layer 来对特定的开源程序加上合适的 patch,或是添加不同 SoC 厂各自需要的韧体(firmware),以及各开发板特定的设定。在 Xilinx 平台上,我们需要下载 meta-xilinx ,我们需要的 kernel 以及 Zybo board 的设定信息都在里面。

这边一样切换到 krogoth 这个分支(branch)
coldnew@gentoo ~/poky $ git clone git://github.com/Xilinx/meta-xilinx -b krogoth

切换到编译用目录
接下来,我们将透过 source 指令暂时修改当前 shell 的环境变量,并切换到 build 文件夹
coldnew@gentoo ~/poky $ source oe-init-build-env build
You had no conf/local.conf file. This configuration file has therefore been
created for you with some default values. You may wish to edit it to, for
example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.

You had no conf/bblayers.conf file. This configuration file has therefore been
created for you with some default values. To add additional metadata layers
into your configuration please add entries to conf/bblayers.conf.

The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:

For more information about OpenEmbedded see their website:

###
Shell environment set up for builds. ###

You can now run 'bitbake '

Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'

默认的目标机器是 qemux86 因此我们需要修改一下,不过先看一下当前目录结构
coldnew@gentoo ~/poky/build $ tree .
.
└── conf
├── bblayers.conf
├── local.conf
└── templateconf.cfg

1 directory, 3 files

我们首先要修改 conf/bblayers.conf ,在上面添加我们刚刚下载的 meta-xilinx ,修改完会像这样
#
POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
#
changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
/home/coldnew/poky/meta \
/home/coldnew/poky/meta-poky \
/home/coldnew/poky/meta-yocto-bsp \
/home/coldnew/poky/meta-xilinx \
"

接下来,修改 conf/local.conf ,这份档案可以用来设定要编译的目标机器,在这边,我们将目标机器改成zybo-linux-bd-zynq7
MACHINE ??= "zybo-linux-bd-zynq7"

都改好了后,就可以开始准备编译了
编译 core-image-minimal



              查看评论 回复



嵌入式交流网主页 > 嵌入式处理器 > FPGA > Zybo board 开发记录: 使用Yocto建立系统 - FPGA/ASIC技术 -
 

"Zybo board 开发记录: 使用Yocto建立系统 - FPGA/ASIC技术 -"的相关文章

网站地图

围观()