OpenEmbedded / Yocto Project / Poky: build from sources

How to build Poky for AT91

Note that building an entire distribution is a long process. It also requires a big amount of free disk space.

The support for Atmel AT91 SoC family is included in a particular Yocto layer: meta-atmel. The source for this layer are hosted on Linux4SAM GitHub account:

Building environment

A step-by-step comprehensive installation is explained in the Yocto Project Quick Start. The following lines have to be considered as an add-on that is AT91 specific or that can facilitate your setup.


Here are the reference pages for setting up a Yocto building environment: What You Need and How You Get It.

Step by step build procedure

Note here is a copy of the README procedure available directly in the meta-atmel layer. This file in the meta-atmel layer repository must be considered as the reference and the following copy can be out-of-sync.

This layer provides support for Microchip microprocessors (aka AT91)

For more information about the Microchip MPU product line see:
Linux & Open Source on Microchip microprocessors:

Supported SoCs / MACHINE names
Note that most of the machine names below, have a SD Card variant that can be
built by adding an "-sd" suffix to the machine name.
- SAMA5D2 product family / sama5d2-xplained, sama5d2-xplained-emmc, sama5d27-som1-ek-sd, sama5d2-ptc-ek, sama5d2-icp, sama5d27-wlsom1-ek-sd
- SAMA5D4 product family / sama5d4ek, sama5d4-xplained
- SAMA5D3 product family / sama5d3xek, sama5d3-xplained
- AT91SAM9x5 product family (AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35 and AT91SAM9X35) / at91sam9x5ek
- AT91SAM9RL / at91sam9rlek
- AT91SAM9G45 / at91sam9m10g45ek
- SAM9X60 / sam9x60ek

- meta-atmel
URI: git://
Branch: warrior

This Layer depends on :
- poky
URI: git://
Branch: warrior
Tag: 1153a954e652304b6b5d287437817b7da891d491

- meta-openembedded
URI: git://
Branch: warrior
Tag: 3bdbf72e3a4bf18a4a2c7afbde4f7ab773aeded9

- meta-qt5
URI: git://
Branch: jansa/warrior (5.12)
Tag: dc2dedef9961950b88f4245ba7499538ec4244ab

Build procedure

0/ Create a directory
mkdir my_dir
cd my_dir

1/ Clone yocto/poky git repository with the proper branch ready
git clone git:// -b warrior

2/ Clone meta-openembedded git repository with the proper branch ready
git clone git:// -b warrior

3/ Clone meta-qt5 git repository with the proper branch ready
git clone git://
cd meta-qt5
git checkout upstream/warrior
cd ..

4/ Clone meta-atmel layer with the proper branch ready
git clone git:// -b warrior

5/ Enter the poky directory to configure the build system and start the build process
cd poky

6/ Initialize build directory
source oe-init-build-env build-microchip

7/ Add meta-atmel layer to bblayer configuration file
vim conf/bblayers.conf

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly


BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../../..')}"

  ${BSPDIR}/poky/meta \
  ${BSPDIR}/poky/meta-poky \
  ${BSPDIR}/poky/meta-yocto-bsp \
  ${BSPDIR}/meta-atmel \
  ${BSPDIR}/meta-openembedded/meta-oe \
  ${BSPDIR}/meta-openembedded/meta-networking \
  ${BSPDIR}/meta-openembedded/meta-python \
  ${BSPDIR}/meta-openembedded/meta-multimedia \
  ${BSPDIR}/meta-qt5 \

  ${BSPDIR}/poky/meta \
  ${BSPDIR}/poky/meta-poky \

8/ Edit local.conf to specify the machine, location of source archived, package type (rpm, deb or ipk)
Pick one MACHINE name from the "Supported SoCs / MACHINE names" chapter above
and edit the "local.conf" file. Here is an example:

vim conf/local.conf
MACHINE ??= "sama5d2-xplained"
DL_DIR ?= "your_download_directory_path"
PACKAGE_CLASSES ?= "package_ipk"
USER_CLASSES ?= "buildstats image-mklibs"

To get better performance, use the "poky-atmel" distribution by also adding that
DISTRO = "poky-atmel"

9/ Build core minimal image
bitbake core-image-minimal

10/ We found that additional local.conf changes are needed for our QT demo
image. You can add these two lines at the end of the file:
vim conf/local.conf

11/ Build images
bitbake microchip-headless-image

Typical bitbake output
Build Configuration:
BB_VERSION           = "1.42.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "sama5d2-xplained-sd"
DISTRO               = "poky-atmel"
DISTRO_VERSION       = "2.7.1"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta-yocto-bsp       = "warrior:1153a954e652304b6b5d287437817b7da891d491"
meta-atmel           = "warrior:f883dcdcb4e55ec0e073c497221e7fe7466b7acb"
meta-multimedia      = "warrior:3bdbf72e3a4bf18a4a2c7afbde4f7ab773aeded9"
meta-qt5             = "warrior:dc2dedef9961950b88f4245ba7499538ec4244ab"

To contribute to this layer you should submit the patches for review to:
the github pull-request facility directly or the forum. Anyway, don't forget to
Cc the maintainers.

AT91 Forum:

for some useful guidelines to be followed when submitting patches:

Nicolas Ferre 
Patrice Vilchez 

When creating patches insert the [meta-atmel] tag in the subject, for example
use something like:
git format-patch -s --subject-prefix='meta-atmel][PATCH' 

Atmel Poky Qt-Embedded SDK

The meta-toolchain recipes build tarballs which contain cross compilation toolchain, cross compiled libraries, includes and configuration tools suitable for application development outside Poky.

The specific meta-toolchain-qte or meta-toolchain-qt5 recipe adds all Qt-Embedded/QT5 libraries and all need environment variables needed to cross compile Qt applications.

For more recent Yocto Project distributions, we use the even more handy target populate_sdk.

Build Atmel Poky Qt/EGT-Embedded SDK

bitbake -c populate_sdk microchip-graphics-image
bitbake -c populate_sdk microchip-headless-image

Install Atmel Poky Qt-Embedded SDK

> ./ 
Poky (Yocto Project Reference Distro) SDK installer version 2.6.2
Enter target directory for SDK (default: /opt/poky-atmel/2.6.2): 
You are about to install the SDK to "/opt/poky-atmel/2.6.2". Proceed[Y/n]? y
Extracting SDK.......................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /opt/poky-atmel/2.6.2/environment-setup-cortexa5t2hf-neon-poky-linux-gnueabi
 $ . /opt/poky-atmel/2.6.2/environment-setup-cortexa5t2hf-vfp-poky-linux-gnueabi

Use Atmel Poky Qt-Embedded SDK

The installation directory (/opt/poky-atmel/2.6.2) contains a setup script which can be sourced to initialize all required environment variables.

cd /opt/poky-atmel/2.6.2/
source environment-setup-cortexa5t2hf-neon-poky-linux-gnueabi 

You can check your new environment

export | less
declare -x AR="arm-poky-linux-gnueabi-ar"
declare -x AS="arm-poky-linux-gnueabi-as "
declare -x CC="arm-poky-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a5 --sysroot=/opt/poky-atmel/2.6.2/sysroots/cortexa5t2hf-neon-poky-linux-gnueabi"
declare -x CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
declare -x CPP="arm-poky-linux-gnueabi-gcc -E  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a5 --sysroot=/opt/poky-atmel/2.6.2/sysroots/cortexa5t2hf-neon-poky-linux-gnueabi"
declare -x CROSS_COMPILE="arm-poky-linux-gnueabi-"
declare -x LD="arm-poky-linux-gnueabi-ld  --sysroot=/opt/poky-atmel/2.6.2/sysroots/cortexa5t2hf-neon-poky-linux-gnueabi"
declare -x LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
declare -x OECORE_DISTRO_VERSION="2.6.2"
declare -x OE_QMAKE_CC="arm-poky-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a5 --sysroot=/opt/poky-atmel/2.6.2/sysroots/cortexa5t2hf-neon-poky-linux-gnueabi"
NoteTo be able to compile the EGT/QT demo applications provided in the Linux4SAM 6.2 release, SDK needs to be generated using a clone of meta-atmel.

Tips & tricks


bitbake -c listtasks <package_name>

You can use one of those tasks to have a fine grained control over the package building.

Hello World example

Reference to the "Hello World" example.

Recent FAQ


Gui Solutions: Presentation of some GUI solutions. (Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained, Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek)
Yocto Project FAQ: Some Yocto Project FAQ entries. (Sama5d27Som1EK, Sama5d2PtcEK, Sama5d2Xplained, Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek, AT91sam9x5-ek)
r30 - 13 Nov 2019 - 09:33:50 - CodrinCiubotariu
Linux & Open Source related information for AT91 Smart ARM Microcontrollers

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.

Atmel® and others, are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. This site is powered by the TWiki collaboration platform

ARM® and others are registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others.

Ideas, requests, contributions ? Connect to LinksToCommunities page.

Syndicate this siteRSS ATOM