Revision as of 18:53, 13 December 2023 by Registered User
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Applicable for STM32MP25x lines

STM32MP257F-EV1.jpg
Develop on Arm® Cortex®-A35 Develop on Arm® Cortex®-M33
Step category in.png Install the SDK Step.png Create a simple hello-world application Step.png Modify, rebuild and reload the Linux® kernel Step category out.png



1. Overview[edit source]

This stage explains how to install the SDK.
The SDK for OpenSTLinux distribution provides a standalone cross-development toolchain and libraries tailored to the contents of the specific image flashed onto the board.

2. Host computer configuration[edit source]

2.1. Install extra packages[edit source]

Additional Ubuntu packages must be installed to perform basic development tasks, basic cross-compilation (via Developer Package) or more complex cross-compilation such as OpenEmbedded does (via Distribution Package):

sudo apt-get update
sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib  chrpath socat cpio python3 python3-pip python3-pexpect 
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm bsdmainutils
sudo apt-get install libssl-dev libgmp-dev libmpc-dev lz4 zstd
  • Packages needed for some "Developer Package" use cases:
sudo apt-get install build-essential libncurses-dev libncurses5 libyaml-dev libssl-dev 
  • Package for repo (used to download the "Distribution Package" source code):
First set python3 as default: sudo apt install python-is-python3

Then follow the installation instructions described in repo.
  • Useful tools:
sudo apt-get install coreutils bsdmainutils sed curl bc lrzsz corkscrew cvs subversion mercurial nfs-common nfs-kernel-server libarchive-zip-perl dos2unix texi2html libxml2-utils


2.2. Additional configurations[edit source]

Additional configurations have to be installed to support up to 16 partitions per MMC. By default, on Linux® systems, a maximum of 8 partitions are allowed on MMC. All Packages (Starter Package, ...) need more than 10 partitions for the storage device. In order to extend the number of partitions per device to 16, the following options must be added to modprobe:

 echo 'options mmc_block perdev_minors=16' > /tmp/mmc_block.conf
 sudo mv /tmp/mmc_block.conf /etc/modprobe.d/mmc_block.conf


3. For STM32MP2 series[edit source]

3.1. Download the SDK and run the SDK installation script[edit source]

The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA0048). The detailed content licenses can be found here.


The STM32MP2 SDK is delivered through two tarball file named :

  • en.sdk-x86_64-stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.tar.gz for x86_64 host architecture
  • en.sdk-aarch64-stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.tar.gz for arm64 host architecture

Download and install the STM32MP2 SDK. The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA0048). The detailed content licenses can be found here.

STM32MP2 Developer Package SDK - STM32MP2-Ecosystem-v5.1.0 release
Download
  • Go on st.com to download
    • en.sdk-x86_64-stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.tar.gz file for x86_64 host architecture
    • en.sdk-aarch64-stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.tar.gz file for arm64 host architecture
Installation For x86_64 host architecture
  • Uncompress the tarball file to get the SDK installation script.
tar xvf en.sdk-x86_64-stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.tar.gz
  • If needed, change the permissions on the SDK installation script so that it is executable.
chmod +x stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26/sdk/st-image-weston-openstlinux-weston-stm32mp2-x86_64-toolchain-4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.sh
  • Run the SDK installation script.
    • Use the -d <SDK installation directory absolute path> option to specify the absolute path to the directory in which you want to install the SDK (<SDK installation directory>).
    • If you follow the proposition to organize the working directory, it means:
./stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26/sdk/st-image-weston-openstlinux-weston-stm32mp2-x86_64-toolchain-4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.sh -d <working directory absolute path>/Developer-Package/SDK
  • A successful installation outputs the following log:
ST OpenSTLinux - Weston - (A Yocto Project Based Distro) SDK installer version 4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
===================================================================================================================================
You are about to install the SDK to "<working directory absolute path>/Developer-Package/SDK". Proceed [Y/n]? 
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.
$ . <working directory absolute path>/Developer-Package/SDK/environment-setup-cortexa35-ostl-linux

For arm64 host architecture

tar xvf en.sdk-aarch64-stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.tar.gz
  • If needed, change the permissions on the SDK installation script so that it is executable.
chmod +x stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26/sdk/st-image-weston-openstlinux-weston-stm32mp2-aarch64-toolchain-4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.sh
  • Run the SDK installation script.
    • Use the -d <SDK installation directory absolute path> option to specify the absolute path to the directory in which you want to install the SDK (<SDK installation directory>).
    • If you follow the proposition to organize the working directory, it means:
./stm32mp2-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26/sdk/st-image-weston-openstlinux-weston-stm32mp2-aarch64-toolchain-4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26.sh -d <working directory absolute path>/Developer-Package/SDK
  • A successful installation outputs the following log:
ST OpenSTLinux - Weston - (A Yocto Project Based Distro) SDK installer version 4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26
===================================================================================================================================
You are about to install the SDK to "<working directory absolute path>/Developer-Package/SDK". Proceed [Y/n]? 
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.
$ . <working directory absolute path>/Developer-Package/SDK/environment-setup-cortexa35-ostl-linux
Release note

Details about the content of the SDK are available in the associated STM32 MPU ecosystem release note.

Archive box.png If you are interested in older releases, please have a look into the section Archives.

  • The SDK is in the <SDK installation directory>:
<SDK installation directory>                                      SDK for OpenSTLinux distribution: details in Standard SDK directory structure article
├── environment-setup-cortexa35-ostl-linux                        Environment setup script for Developer Package
├── site-config-cortexa35-ostl-linux
├── sysroots
│   ├── cortexa35-ostl-linux                                      Target sysroot (libraries, headers, and symbols)
│   │   └── [...]
│   └── x86_64-ostl_sdk-linux                                     Native sysroot (libraries, headers, and symbols)
│       └── [...]
└── version-cortexa35-ostl-linux

For arm64 host architecture

<SDK installation directory>                                      SDK for OpenSTLinux distribution: details in Standard SDK directory structure article
├── environment-setup-cortexa35-ostl-linux                        Environment setup script for Developer Package
├── site-config-cortexa35-ostl-linux
├── sysroots
│   ├── cortexa35-ostl-linux                                      Target sysroot (libraries, headers, and symbols)
│   │   └── [...]
│   └── aarch64-ostl_sdk-linux                                     Native sysroot (libraries, headers, and symbols)
│       └── [...]
└── version-cortexa35-ostl-linux


3.2. Start the SDK up[edit source]

Info white.png Information
The SDK environment setup script must be run, once, on each new working terminal on which you cross-compile
 cd $HOME/STM32MPU_workspace/STM32MPU-Ecosystem-v5.1.0/Developer-Package 
 source SDK/environment-setup-cortexa35-ostl-linux


The following checks ensure that the environment is correctly set up:

  • Check the target architecture
 echo $ARCH
arm64
  • Check the toolchain binary prefix for the target tools
 echo $CROSS_COMPILE
aarch64-ostl-linux-

  • Check the C compiler version
 $CC --version
aarch64-ostl-linux-gcc (GCC) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • Check that the SDK version is the expected one (e.g.)
 echo $OECORE_SDK_VERSION
4.2.4-openstlinux-6.1-yocto-mickledore-mpu-v24.06.26

If any of these commands fails or does not return the expected result, try to reinstall the SDK.



Back button.png Overview button.png Next button.png