OpenEmbedded®/Yocto Project®: Build From Sources

Last modified by Microchip on 2026/04/27 10:45

How to Build OpenEmbedded Core for MPU

Failed to execute the [display] macro. Cause: [Current user [null] doesn't have view rights on document [xwiki:Development.applications.linux4sam.faq.oebuild.oe-build.WebHome]]. Click on this message for details.

OpenEmbedded Software Development Kit (SDK)

The meta-toolchain recipes build tarballs that contain a cross-compilation toolchain, cross-compiled libraries, header files, and configuration tools suitable for application development outside OpenEmbedded.

The cross-compilation toolchain and all cross-compiled libraries are included in this Software Development Kit (SDK), allowing users to match exactly what is provided in the associated Linux4SAM demo image.

Using a different cross-compilation toolchain may lead to undefined symbols and mismatched library calls. Because the SDK matches the software available on the target system, developers can fully use the shared libraries typically expected in an embedded Linux® environment.

This cross-development cycle does not need to be integrated into an OpenEmbedded build flow. Standard development tools such as Makefiles, CMake, or IDEs can be used. This allows the development phase to remain separate from the integration phase.

Build OpenEmbedded SDK

This SDK is generated using the BitBake handy target populate_sdk.

bitbake -c populate_sdk mchp-graphics-image

or

bitbake -c populate_sdk mchp-headless-image

It will produce a comprehensive SDK script (auto-extracting archive) available in the deployment directory: from the build directory, it is usually located in tmp/deploy/sdk.

For instance, for the sama5d27-wlsom1-ek-sd graphic image type of SDK, you can find it available in: tmp/deploy/sdk/oecore-mchp-graphics-image-x86_64-cortexa5t2hf-neon-vfpv4-sama5d27-wlsom1-ek-sd-toolchain-nodistro.0.sh.

Install OpenEmbedded SDK

Once the SDK archive is generated, you can install it by running the script directly. Choose the appropriate script name according to your board.

Note: Some of the SDK variants can apply to several boards or SoCs (the sama5d2 or sama5d4 SDK could match all boards equipped with these SoCs). You can check the Yocto Project SDK table for more information about the different SDK flavors.

Some installation information will be asked of the user, as well as the appropriate installation rights:

Hereunder is an example with an SDK from the Scarthgap branch of OpenEmbedded present in Linux4SAM 2024.10:

$ ./oecore-mchp-graphics-image-x86_64-cortexa5t2hf-neon-vfpv4-sama5d27-wlsom1-ek-sd-toolchain-nodistro.0.sh
OpenEmbedded SDK installer version nodistro.0
=============================================
Enter target directory for SDK (default: /usr/local/oecore-x86_64): /opt/oecore
You are about to install the SDK to "/opt/oecore". Proceed [Y/n]? Y
[sudo] password for dharma:
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/oecore/environment-setup-cortexa5t2hf-neon-vfpv4-oe-linux-gnueabi

Use OpenEmbedded SDK

The installation directory (/opt/oecore) contains a setup script that can be sourced to initialize all required environment variables.

$ cd /opt/oecore/
$ source environment-setup-cortexa5t2hf-neon-vfpv4-oe-linux-gnueabi

You can check your new environment

export | less
[...]
declare -x AR="arm-oe-linux-gnueabi-ar"
declare -x ARCH="arm"
declare -x AS="arm-oe-linux-gnueabi-as "
declare -x CC="arm-oe-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a5 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=/opt/oecore/sysroots/cortexa5t2hf-neon-vfpv4-oe-linux-gnueabi"
[...]
declare -x CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
declare -x CMAKE_TOOLCHAIN_FILE="/opt/oecore/sysroots/x86_64-oesdk-linux/usr/share/cmake/OEToolchainConfig.cmake"
declare -x CONFIGURE_FLAGS="--target=arm-oe-linux-gnueabi --host=arm-oe-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/opt/oecore/sysroots/cortexa5t2hf-neon-vfpv4-oe-linux-gnueabi"
[...]
declare -x OECORE_DISTRO_VERSION="nodistro.0"
declare -x OECORE_NATIVE_SYSROOT="/opt/oecore/sysroots/x86_64-oesdk-linux"
declare -x OECORE_SDK_VERSION="nodistro.0"
declare -x OECORE_TARGET_ARCH="arm"
declare -x OECORE_TARGET_OS="linux-gnueabi"
[...]

Note: To be able to compile the EGT demo applications provided in the Linux4SAM release, the SDK needs to be generated using a clone of meta-atmel.

Note: EGT demo applications can be compiled using the OE SDK by following the steps below.

$ source environment-setup-cortexa5t2hf-neon-vfpv4-oe-linux-gnueabi
$ git clone --recursive https://github.com/linux4sam/egt.git
$ cd egt/
$ ./autogen.sh
$ ./configure --host="arm"
$ make

Note: To use the SDK toolchain directly, one can refer to the Yocto Project documentation.

Back to Top

Tips & Tricks

BitBake

  • BitBake User Manual
  • BitBake Cheat Sheet
  • List tasks provided by a package:

    bitbake -c listtasks <package_name>You can use one of those tasks to have fine-grained control over the package building.

Hello World example

Back to Top

Recent FAQ

Back to Top