Search code examples
linuxembeddedyoctobsp

To build custom BSP layer using Yocto for a bare metal board


I am developing an Embedded application based on Yocto Krogoth release to run on Nitrogen6x board. I have followed the steps mentioned in this link. I have successfully created the Linux distribution and Yocto SDK to develop and run my application on the nitrogen board. The target machine I used to setup the environment for building was:

MACHINE=nitrogen6x

Now, we reached a phase that we are going to create a custom board (based on same i.Mx.6). The real processor chip is not decided yet, but it will be based on iMx6.

Suppose we assume that the final custom board also uses the same processor chip as that of the Nitrogen6x board that am using for my development so far. Do I need to add any other CUSTOM BSP layer to my existing Yocto Repos to support the new custom board that I receive, or the existing Yocto layers and build environment I created for Nitrogen6x evaluation board will work fine for my custom board as well ?

Do i need to ask any specific information from the board vendor regarding the custom hardware changes he made in order to support any peripherals and GPIO lines so on.

What are the main things I have to consider if I receive a bare metal custom board from a hardware vendor who is not planning to give any minimal BSP package other than the schematics and pin mappings etc.

I read about creating a Custom BSP Layer in the Yocto documentation. But there are many other things in my mind that are not clear when I start thinking about a custom board (which is not like a Nitrogen6x, wandboard, Raspberry Pi etc., which has got a wide support in the Yocto, BSP communities).

EDIT 1 For example, I have built a Linux distribution for the Nitrogen6x board by specifying a machine name to the Yocto Build Setup Environment for which the Yocto Framework creates the Distro. I run the below instructions:

$ MACHINE=nitrogen6x source ./setup-environment build
$ bitbake core-image-sato

The machine I mentioned in the above step is nitrogen6x which is just a configuration file that looks like this. This file, mainly mentions these things:

  • Machine Type for which we are building the image for
  • Kernel Device trees required for the board
  • Preferred Uboot provider (u-boot-boundary)
  • Preferred Kernel provider (linux-boundary)
  • Preferred BSP (linux-fslc)
  • Boot Script (6x_bootscript)
  • Basic peripheral support like (serial, Bluetooth, wifi or network chips)

My understanding so far was that, In the above list everything else remains the same except the highlighted ones for the custom board. Am I right with the below points ?

Kernel Device Trees: I may have to create a custom device tree file for my custom board based on the schematics and other hardware info. Is there any reference or document that I can refer to create my own .dts file.

BSP: I am expecting that the BSP layer I am currently using for the Nitrogen board may probably be compatible and work for the custom board too since it is going to be made based on the iMx6 platform. And this is the section where I have to work to get a prompt ? Will hardware providers give us a minimal set of software to check the boards boots and gets us a prompt or do I need to get it working on a bare metal board.

Thanks for any help you can provide.


Solution

  • I strongly recommend you to create a new fresh layer in order to handle your new custom device. It will allow you to properly dissociate devices and machine configuration from remote repositories. I do not know how to plan to manager deliveries/versions but I suggest you to use repo. You will find many information on NXP documentation.

    My understanding so far was that, In the above list everything else remains the same except the highlighted ones for the custom board. Am I right with the below points ?

    We do not know what do you really expect from your custom device. So thus, this machine configuration could satisfy your requirements, but could also need adjustments. Because the new machine override new machine override has been introduced last year, I am actually not familiarized with it yet. But it allows you to configure your BSP layer by adding a simple line in your local.conf. Depending on your local.conf, you will compile kernel from linux-boundary or linux-fslc recipes.

    Kernel Device Trees: I may have to create a custom device tree file for my custom board based on the schematics and other hardware info. Is there any reference or document that I can refer to create my own .dts file.

    You are able to append as many dts you want in KERNEL_DEVICETREE = you will have to had your own one. It exists lot of information about dts. Follow this link for a first introduction.

    You will habe to create your own device tree (for instance, customboard-imx6.dts) under /arch/arm/boot/dts/ directory. You can also include it in your sources during your development process.

    BSP: I am expecting that the BSP layer I am currently using for the Nitrogen board may probably be compatible and work for the custom board too since it is going to be made based on the iMx6 platform. And this is the section where I have to work to get a prompt ?

    If yes, how do you plan to manage sources ?