how to add custom board using Yocto

Showing results for 
Search instead for 
Did you mean: 

how to add custom board using Yocto

Contributor III


  We have our own hardware closely matching the imx28evk (but not exactly).  In have built systems for it using LTIB but we want to upgrade to Yocto and to a recent kernel.

I have installed Yocto and built a successfully target for the imx28evk using Yocto.

Now I want to understand how to build for our target hardware.

The question was asked here: How to create a custom board in Yocto ? but the replies only go as far as getting the new empty layer created.

Where do I go to get a clear explanation of how to use layers and recipes to replace one board with another?  To add a layer to get from 'imx28evk' to 'myboard"?

I need to change the usage of the pins of the chip, drop the LCD and drop the nand flash.  Part of this is kernel configuration and part is a new device tree file.

I assume I will need a new 'defconfig' and a new myboard.dts but where do they go?   Somewhere under  sources/meta-myboard/.. I assume?  and where do I copy them from in order to edit them for our hardware?

The .dts files seem to be a sort of 'include' chain. Can I make just a few changes in myboard.dts and then refer the to remainder of the chain?

Having used ". setup-environment mybuild" to create a working space, it will then include conf/local.conf and after building many others including conf/bblayers.conf.

I assume I modify this conf/bblayers.conf to add my new layer.   How is this change then captured?   If the sources are in git repositories under 'sources/...'  how do other developers in the company get the changes that I've made in my local mybuild/conf ? It's not part of a git repository.

While I'm here, another question is: What role does 'repo' play in all this.  Is this new board actually a new 'project'?  How do I add projects to repo?  Does it capture the changes I've made in mybuild/conf/... ?


Colin Moloney

4 Replies

Contributor III


you probably already found a solution. For the sake of completeness: Here is my little repo for another iMX6 board

FrankBau/meta-marsboard-bsp · GitHub

which explains how to add a new board in the wiki: Yocto built Linux image · FrankBau/meta-marsboard-bsp Wiki · GitHub



Contributor II

Colin, I'm having a similar but simpler issue. All I'm trying to do is to swap the touchscreen driver in the image built by yocto.

I used menuconfig to reconfigure touchscreen driver modules.

/wandboard-bsp-dizzy/build$ bitbake -c menuconfig linux-wandboard

Then by using the .config file made by the above process I modified the defconfig in:


then bitbaked the full project.

(not sure if this is correct way... probably patch would be preferred, but it works. The driver module does not load on boot but I can get it with modprobe, these changes pushed through)

So now I am stuck because to make it work I need to patch the dtsi file which specifies the touchscreen I2C bus and GPIO. I know what to modify but I don't know how. the dtsi files are located only in build directory and I'm not sure if this location can be patched.

I'm assuming the patch files should all be in the same dir as recipes which are in source dir. So how do I save patch there which gets applied to a dtsi file buried deep in the build directory.

I'm sorry if this is something basic.. but I've searched for a long time... maybe I'm missing something basic.

Maybe Freescale guys could help

0 Kudos

NXP TechSupport
NXP TechSupport

Layers serve to compartmentalize the specific code that each vendor or application would require whereas the machine definition set the variables required for each specific target. You would definitely want to create a new layer and add your machine information there.

The machine information is contained on the conf/machine folder inside each layer. (Not all layers may contain machine definitions).

I would recommend looking at the available machine configuration files and choosing the one that is closer to your own custom board as a starting point. You may find the conf files for our boards on the Community BSP GitHub below.

The machine conf files point out to the device tree required for the specific board. You may edit a current device tree and call it on your own machine definition.

Repo is a tool built on top of git to manage several git repositories and it’s an executable Python script. Unless you add your layer to a git repository your layer would remain local. You would need to create a git with your layer and machine information and add this repository to repo. Other developers would then be able to sync with this repository and retrieve your layer.

Please do keep in mind that the local.conf file is created by the environment setup script and it is not downloaded from any repository buy rather created or edited when initializing the build directory.

You may find the Yocto Reference Manual useful as well (link below)! Although with Yocto is often recommended to look for a similar layer/machine as reference and work from there.

Contributor III

Thanks gusarambula,

  I have progressed a little.  My layer is included in the layers seen by bitbake.  The first thing I want to change is the device tree.  Searching the internet yields many different suggestions.

When I try "bitbake core-image-minimal" it fail trying to  build mtd4000.dtb: No rule to  build target.

I can't work out where I'm supposed to put the dts files and how to tell the system where they are.

If the .dtb has to be in the list for the MXS:  dtb-$(CONFIG_ARCH_MXS) += mtd4000.dtb, how do I do that in a layer?  The Makefile is in


Can anyone untangle the mess below and explain where to put the .dts/.dtsi files?

Which path is correct: linux-fslc/3.14/git/...  or linux-fslc/3.14/image/usr/...  or some other path?

Also, I will need to get the "defconfig" right for this new machine.  Where does it go and how to tell Yocto/bitbake ?

Colin Moloney


My build workspace is called "mdtata", my layer is "meta-mtdata" and my new machine is "mtd4000".  My workspace is like:













and my layer



































and build directory:










My machine config mtd4000.conf has:

    include conf/machine/include/

    PREFERRED_PROVIDER_virtual/kernel = "linux-fslc"

    PREFERRED_VERSION_linux-fslc = "3.14%"



and several attempts at the device tree:

    #KERNEL_DEVICETREE = "imx28-evk.dtb"   -- original freescale

    KERNEL_DEVICETREE = "mtd4000.dtb"

    KERNEL_DEVICETREE = "${S}/git/arch/arm/boot/dts/mtd4000.dtb"

    KERNEL_DEVICETREE = "${WORKDIR}/mtd4000.dts"


The local.conf has:

    MACHINE ??= "mtd4000"

The layer "" is:

    LICENSE = "GPLv2"

    LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

    DEPENDS += "lzop-native bc-native"

    PROVIDES = "virtual/kernel linux-mainline"

    inherit kernel

    require recipes-kernel/linux/

    require recipes-kernel/linux/

    SRCBRANCH ?= ""

    SRC_URI = "git://;branch=${SRCBRANCH} \


    LOCALVERSION = "-fslc"

The layer "linux-fslc_3.14.bbappend" is:

    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

    #FILESEXTRAPATHS_prepend := "${THISDIR}:${THISDIR}/mxs:"

    #FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:${THISDIR}/mxs:${THISDIR}/${PN}/${PV}/git/arch/arm/boot/dts:"

    COMPATIBLE_MACHINE_mtd4000 = "mtd4000"      # Should this be appended or assigned ?

    KMACHINE_mtd4000 = "mtd4000"

0 Kudos