Skip to main content
Version: kirkstone_1-08-00

Add a Machine To Clea OS

info

From now on it's assumed to be working into Seco's docker and that all the layers have been downloaded succesfully with repo tool.

Adding a machine to Clea OS involves the modification of :

  • the layer seco-base mapped in layers/base.
  • the silicon vendor-related layer (i.e. meta-seco-imx for NXP) mapped in layers/meta-seco-<vendor>.

seco-base layer

This layer is the resposible of the creation of the build folder. The tool seco-setup.sh accesses seco-base layer to scan all the boards available on Clea OS that are stored in the layers/base/configs/ folder.
To add a new machine to Clea OS this is the first step to pursue. Let's consider the board called example based on a iMX6DL processor. To add the machine with Clea OS Things features, the minimal file called seco_sbc_example_clea_os_defconfig is created with the content:

#@Description: SBC i.MX6DL EXAMPLE board for Clea OS FB and default settings
#
# Hardware Configuration
#
CONFIG_IMX6=y
CONFIG_ARCHITECTURE_IMX=y
CONFIG_MACHINE_SECO_IMX6DL_EXAMPLE=y
#
# Yocto Configuration
#
CONFIG_ENVIRONMENT_CLEA_OS_THINGS=y
CONFIG_DISTRO_CLEA_OS_THINGS_FB=y
#
# Project settings
#
CONFIG_BUILD_DIR="build_example"
CONFIG_SSTATE_DIR=""
CONFIG_DL_DIR=""
#
# Cloud Configuration
#

Similarly for the Clea OS Embedded features with Wayland, the minimal file called seco_sbc_example_clea_os_embedded_wayland_defconfig is created with the content:

#@Description: SBC i.MX6DL EXAMPLE board for Clea OS Embedded with Wayland
#
# Hardware Configuration
#
CONFIG_IMX6=y
CONFIG_ARCHITECTURE_IMX=y
CONFIG_MACHINE_SECO_IMX6DL_EXAMPLE=y

#
# Yocto Configuration
#
CONFIG_ENVIRONMENT_CLEA_OS_EMBEDDED=y
CONFIG_DISTRO_CLEA_OS_EMBEDDED_WAYLAND=y

#
# Project settings
#
CONFIG_BUILD_DIR="build_example_embedded_wayland"
CONFIG_SSTATE_DIR=""
CONFIG_DL_DIR=""

#
# Cloud Configuration
#

When the files are created and placed into the layers/base/configs/ directory, running:

yoctouser@b9c7b7068c9f:~/workdir$ . ./seco-setup.sh -l | grep example
seco_sbc_example_clea_os SBC i.MX6DL EXAMPLE board for Clea OS FB and default settings
seco_sbc_example_clea_os_embedded_wayland SBC i.MX6DL EXAMPLE board for Clea OS Embedded with Wayland

will show the added configurations.

Firstly, add to SECO's silicon vendor-related layer the machine file for the board to be included in Clea OS in the directory layers/meta-seco-<vendor>/conf. Let's consider the board named example based on a NXP iMX6DL processor, create the file called layers/meta-seco-imx/conf/seco-imx6dl-example.conf the minimal machine configuration may be:

#@TYPE: Machine
#@NAME: SECO Boards
#@SOC: i.MX6DL
#@DESCRIPTION: Machine configuration for SECO BOARDS
#@MAINTAINER: nicola.sparnacci <nicola.sparnacci@seco.com>

MACHINEOVERRIDES =. "mx6:mx6q:mx6dl:"

include conf/machine/include/seco-imx6-common.inc

UBOOT_CONFIG ??= "2x512M"
UBOOT_CONFIG[2x512M] = "seco_imx6dl_example_defconfig"

KERNEL_DEVICETREE = " \
seco/seco-imx6dl-example.dtb \
seco/overlays/seco-imx6dl-example-overlay-example.dtbo \
"

This file specifies:

  • Machine overrides.
  • Seco's iMX6 include file.
  • U-Boot configuration.
  • Kernel configuration (including the device-tree overlays).

To add a machine to Seco's silicon vendor-related layer it's needed to add the board-related flag in the layers/meta-seco-<vendor>/conf/Yconfig/Yconfig_machine file. Let's consider the board named example based on a NXP iMX6DL processor, a minimal Yconfig addition may be:

...
...
config MACHINE_SECO_IMX6DL_EXAMPLE
bool "SBC Example"
select IMX6
depends on ARCHITECTURE_IMX
help
SBC board based on NXP i.MX6 SoC
...
...

After all the needed files have been added, with seco-setup.sh it's possible to create the BitBake build environment. Following the example, to create the environment for the newly added board:

yoctouser@2337e108adfc:~/workdir$ . ./seco-setup.sh -l | grep example
seco_sbc_example_clea_os SBC i.MX6DL EXAMPLE board for Clea OS FB and default settings
seco_sbc_example_clea_os_embedded_wayland SBC i.MX6DL EXAMPLE board for Clea OS Embedded with Wayland

yoctouser@2337e108adfc:~/workdir$ . ./seco-setup.sh -d seco_sbc_example_clea_os

***
USE defconfig configuration file: seco_sbc_example_clea_os
SBC i.MX6DL EXAMPLE board for Clea OS FB and default settings
***

yoctouser@2337e108adfc:~/workdir$ . ./seco-setup.sh -c

Welcome to SECO BSP

The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
http://www.openembedded.org/

Your build environment has been configured with:

MACHINE=seco-imx6dl-example
SDKMACHINE=i686
DISTRO=clea-os-things-fb
EULA=

Double check the output of the seco-setup.sh to make sure that the creation of the environment is correct.

When seco-setup.sh creates the build directory, based on the configurations added in seco-base, it looks into meta-seco-<vendor> for the board specific flag and machine configuration.

For the example above:

  • layers/base/configs/seco_sbc_example_clea_os_defconfig contains CONFIG_MACHINE_SECO_IMX6DL_EXAMPLE.
  • seco-setup.sh searches into meta-seco-imx/conf/Yconfig/Yconfig_machine for MACHINE_SECO_IMX6DL_EXAMPLE in order to create the MACHINE variable in local.conf
  • at compile time the MACHINE variable is used to find the correct machine file, in this case layers/meta-seco-imx/conf/seco-imx6dl-example.conf.
warning

If one of the strings above are not consistent, errors at compile time or during the creation of the environment may occur.