Last edited 3 weeks ago

How to create an SDK for OpenSTLinux distribution

Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP25x lines

When an OpenSTLinux distribution has been modified, it is pertinent to build a new software development package that integrates the modifications, and to redistribute this SDK to developers (see SDK development cycle model).

1. Prerequisites[edit source]

The Distribution Package relative to your STM32 microprocessor series is installed: Category:Distribution Package.

On the installation:

  • some pieces of software might have been modified or integrated
  • the build environment script has been executed
  • the selected image has been rebuilt

2. SDK generation[edit source]

The OpenEmbedded build system uses BitBake to generate the software development package (SDK) installation script.

For more information about the SDK, see the SDK for OpenSTLinux distribution article.

Standard SDK generation
Source: Yocto Project[1]

The do_populate_sdk task helps to create the standard SDK and handles two parts: a target part and a host part. The target part is built for the target hardware and includes libraries and headers. The host part is the part of the SDK that runs on the host machine.

  • Check that the build environment script has been executed, and that the current directory is the build directory of the OpenSTLinux distribution
  • By default the SDK is generated for the host architecture used for building. To generate it for another architecture, the variable SDKMACHINE can be configured in the file conf/local.conf.
SDK architecture SDKMACHINE value
x86 64 bits SDKMACHINE= x86_64
ARM 64 bits SDKMACHINE= aarch64
  • Generate the SDK installation files (including the installation script) for a standard SDK with the following command :
bitbake -c populate_sdk <image>
<image> Image name; example:
  • st-image-weston
bitbake -c populate_sdk st-image-weston
  • The SDK installation files (<image>-<distro>-<machine>-<host machine>-toolchain-<Yocto release>-snapshot.*) are written to the deploy/sdk directory inside the build directory build-<distro>-<machine> as shown in the figure above
<host machine> Host machine on which the SDK is generated
  • x86_64 (x86 64-bit host machine)
  • aarch64 (ARM 64-bit host machine)
<Yocto release> Release number of the Yocto Project; example:
  • 4.2.4 (aka Mickledore[2])
For example
  • For STM32MP1 series
ls tmp-glibc/deploy/sdk/
  • For STM32MP2 series
ls tmp-glibc/deploy/sdk/

The main final output is the cross-development toolchain installation script (.sh file), which includes the environment setup script.
Note that several OpenEmbedded variables exist that help configure these files. The following list shows the variables associated with a standard SDK:

    DEPLOY_DIR: points to the deploy directory.
    SDKMACHINE: specifies the architecture of the machine on which the cross-development tools are run to create packages for the target hardware.
    SDKIMAGE_FEATURES: lists the features to include in the "target" part of the SDK.
    TOOLCHAIN_HOST_TASK: lists packages that make up the host part of the SDK (that is, the part that runs on the SDKMACHINE). This variable allows packages other than the default ones to be added.
    TOOLCHAIN_TARGET_TASK: lists packages that make up the target part of the SDK (that is, the part built for the target hardware).
    SDKPATH: Defines the default SDK installation path offered by the installation script.

3. Reference list[edit source]