Skip to main content
Version: 029-rc4

Device platform

A platform file in kas/platforms/ declares the set of Yocto/OE layers required for a family of devices. Platform files are shared across multiple machine configurations — for example, freescale.yaml is included by both nxp.yaml and toradex.yaml.

Before creating a new platform file, check whether a suitable one already exists: kas/platforms/. Existing platforms include freescale.yaml, toradex.yaml, raspberrypi.yaml, rockchip.yaml, sunxi.yaml, ti.yaml, and variscite.yaml.


Worked Example: the Toradex Platform

The layer already ships this content as kas/platforms/toradex.yaml — a good template for a new platform file. Here is how it is put together.

1 — Identify the Vendor Layers

Consult the vendor's documentation or BSP manifest to find the required Yocto layers. For Toradex NXP boards the required layers are:

  • meta-toradex-bsp-common
  • meta-toradex-nxp
  • meta-freescale, meta-freescale-distro, meta-freescale-3rdparty (already in freescale.yaml)

2 — Declare the Layers in the Platform YAML

kas/platforms/toradex.yaml uses header.includes to reuse the existing freescale.yaml rather than duplicating the Freescale layer definitions:

header:
version: 16
includes:
- kas/platforms/freescale.yaml # reuse existing Freescale layers

repos:
meta-toradex-bsp-common:
path: layers/meta-toradex-bsp-common
url: "https://git.toradex.com/meta-toradex-bsp-common.git"
branch: scarthgap-7.x.y

meta-toradex-nxp:
path: layers/meta-toradex-nxp
url: "https://git.toradex.com/meta-toradex-nxp.git"
branch: scarthgap-7.x.y

Branches must match the Yocto release you are targeting (scarthgap or kirkstone).

3 — Add Platform-Level BitBake Variables (if needed)

Use local_conf_header to inject variables into build/conf/local.conf for all machines that include this platform. For example, the raspberrypi.yaml platform enables U-Boot and UART:

local_conf_header:
platform-raspberrypi: |
LICENSE_FLAGS_ACCEPTED += "synaptics-killswitch"
RPI_USE_U_BOOT = "1"
ENABLE_UART = "1"

Add a local_conf_header block to your platform file if your vendor BSP requires default configuration flags.


Platform File Structure

KeyPurpose
header.versionKAS format version (use 16 for current releases)
header.includesOther platform YAML files to include (for layer reuse)
reposGit repositories for the vendor BSP layers
local_conf_headerVariables to append to build/conf/local.conf
bblayers_conf_headerLines to append to build/conf/bblayers.conf — e.g. nxp.yaml uses it to BBMASK vendor recipes

Once the platform file exists, create a machine file to target a specific board.