使用Yocto构建固件的最佳实践 [英] Best practice for building firmware using Yocto

查看:76
本文介绍了使用Yocto构建固件的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作正常的Yocto构建系统,该系统基于rocko分支,该分支正在为基于ARM的目标板生成映像.该板上的芯片之一是一个小型的,基于ARM的微控制器,与主CPU分离.它需要加载我必须构建的固件映像.

I have a working Yocto build system based on the rocko branch that is generating images for an ARM-based target board. One of the chips on this board is a small ARM-based micro-controller that is separate to the main CPU. It needs to be loaded with a firmware image that I have to build.

制作该微控制器固件的配方很容易.它需要一个ARM交叉编译器,然后需要一些特殊的编译器选项来控制代码生成(用于cortex-m4 + thumb等).问题是,如果我设置一个普通的菜谱,它将假定我正在为目标ARM体系结构构建某种东西,这是另一种类型的ARM,需要不同的代码生成选项.我当然可以使固件Makefile覆盖为目标系统提供的交叉编译环境,并使Makefile仅生成二进制固件映像.

It would be easy to make a recipe to build this microcontroller firmware. It requires an ARM cross compiler and then some special compiler options to control the code generation (for cortex-m4 + thumb etc). The trouble is, if I setup a normal recipe, it will assume that I'm building something for the target ARM architecture, which is a different type of ARM needing different code generation options. I can of course have the firmware Makefile override the cross-compile environment that is provided for the target system and have the Makefile just produce the binary firmware image.

但这将产生一个标称用于目标ARM体系结构的软件包,但其中包含一个二进制blob,该二进制blob旨在被闪存到目标板上的芯片上.

But this will result in a package that is nominally for the target ARM architecture, but which contains a binary blob intended to be flashed onto a chip on the target board.

所以我的问题是,我应该如何为将要在与yocto最终使用的机器完全不同的架构上执行的固件制定配方?

So my question is, how should I make a recipe for firmware that will execute on a totally different architecture to the MACHINE that the yocto build is ultimately for?

似乎我需要创建一个专门为微控制器构建的配方,因此在某种程度上与正常目标配方不同.

It seems like I need to create a recipe that builds specially for the micro-controller and is therefore different in some way to normal target recipes.

推荐答案

Multiconfig可能会为您提供帮助.用例之一是您要为由FPGA和ARM内核组成的电路板构建映像,这在某种程度上类似于您的用例.

Multiconfig may help you. One of the use case is that you want to build image for board which consists of FPGA and ARM core, this is somehow similar to your use case.

引用发行的发行说明(2.2),它是在那里介绍的:

Quoting release notes of morty (2.2), it was introduced there:

对多配置构建的基本支持.例如,这样可以一次构建多个机器,如果您的板上有两个单独的SoC,每个SoC都有自己的OS,但是您希望在同一构建中将它们作为目标,则这可能会很有用.

我还没有尝试过,但是Rocko的文档在这里:

I didn't try it yet, but the documentation for rocko is here: https://www.yoctoproject.org/docs/2.4/mega-manual/mega-manual.html#platdev-building-targets-with-multiple-configurations

您基本上定义了两个机器配置文件,在BBMULTICONFIG变量中定义它们,并在需要时以multiconfig:<configuration>:前缀为目标运行bitbake.

You basically define two machine configuration files, define them in BBMULTICONFIG variable and run bitbake with multiconfig:<configuration>: prefix for target when needed.

这篇关于使用Yocto构建固件的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆