Install the SDK


1 Overview[edit]

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

2 Host computer configuration[edit]

2.1 Install extra package[edit]

In order to do basic development tasks, basic cross-compilation (via Developer Package) or more complex cross-compilation as OpenEmbedded does (via Distribution Package), some extra Ubuntu packages should be installed:

PC $> sudo apt-get update
PC $> sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 pylint xterm
PC $> sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
  • Packages needed for some "Developer Package" use cases:
PC $> sudo apt-get install libncurses5-dev libncursesw5-dev libssl-dev linux-headers-generic u-boot-tools device-tree-compiler bison flex g++ libyaml-dev
  • Package for repo (used to download the "Distribution Package" source code):
Please follow official instructions to install repo
 For Ubuntu 16.04 you should use the legacy repo old-repo-python2 chapter
  • Some useful tools:
PC $> sudo apt-get install coreutils bsdmainutils sed curl bc lrzsz corkscrew cvs subversion mercurial nfs-common nfs-kernel-server libarchive-zip-perl dos2unix texi2html diffstat libxml2-utils

You can also install a Java Runtime Engine, this is required for STM32CubeMX and STM32CubeProgrammer

PC $> sudo apt-get install default-jre


2.2 Additionnal configurations[edit]

  • Allow up to 16 partitions per mmc

By default, on Linux system, a maximum of 8 partitions are allowed on mmc. All Packages (Starter Package, ...) need more than 10 partitons for the storage device. In order to extend the number of partitions per device to 16, the following options must be added to modprobe:

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

3 Download the SDK[edit]

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

Warning.png To download a package, it is recommended to be logged in to your "myst" account [1]. If, trying to download, you encounter a “403 error”, you could try to empty your browser cache to workaround the problem. We are working on the resolution of this problem.
We apologize for this inconvenience

For ecosystem release v2.1.0 More info.png :

  • Download the Developer Package SDK into the following directory: $HOME/STM32MPU_workspace/tmp
  • Uncompress the tarball file to get the SDK installation script
PC $> cd $HOME/STM32MPU_workspace/tmp
PC $> tar xvf en.SDK-x86_64-stm32mp1-openstlinux-5-4-dunfell-mp1-20-11-12.tar.xz

For ecosystem release v2.0.0 More info.png :

  • Download the Developer Package SDK into the following directory: $HOME/STM32MPU_workspace/tmp
  • Uncompress the tarball file to get the SDK installation script
PC $> cd $HOME/STM32MPU_workspace/tmp
PC $> tar xvf en.SDK-x86_64-stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24.tar.xz

4 Run the SDK installation script[edit]

4.1 For ecosystem release v2.1.0 More info.png[edit]
  • Create your STM32MP15 Developer Package SDK directory on your host computer
PC $> mkdir -p $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package/SDK
  • Change the permissions of the SDK installation script so that it is executable
PC $> chmod +x stm32mp1-openstlinux-5.4-dunfell-mp1-20-11-12/sdk/st-image-weston-openstlinux-weston-stm32mp1-x86_64-toolchain-3.1-openstlinux-5.4-dunfell-mp1-20-11-12.sh
  • Execute the SDK installation script
PC $> ./stm32mp1-openstlinux-5.4-dunfell-mp1-20-11-12/sdk/st-image-weston-openstlinux-weston-stm32mp1-x86_64-toolchain-3.1-openstlinux-5.4-dunfell-mp1-20-11-12.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 3.1-openstlinux-5.4-dunfell-mp1-20-11-12
=======================================================================================================================
You are about to install the SDK to "/home/osboxes/MCD/V2.1/Developper-Package/SDK". 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.
 $ . /<working directory absolute path>/STM32MPU_workspace/STM32MP15-Ecosystem-v2.1.0/Developer-Package/SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
4.2 For ecosystem release v2.0.0 More info.png[edit]
  • Create your STM32MP15 Developer Package SDK directory on your host computer
PC $> mkdir -p $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package/SDK
  • Change the permissions of the SDK installation script so that it is executable
PC $> chmod +x stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sdk/st-image-weston-openstlinux-weston-stm32mp1-x86_64-toolchain-3.1-openstlinux-5.4-dunfell-mp1-20-06-24.sh
  • Execute the SDK installation script
PC $> ./stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sdk/st-image-weston-openstlinux-weston-stm32mp1-x86_64-toolchain-3.1-openstlinux-5.4-dunfell-mp1-20-06-24.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 3.1-openstlinux-5.4-dunfell-mp1-20-06-24
=======================================================================================================================
You are about to install the SDK to "/home/osboxes/MCD/V2.0/Developper-Package/SDK". 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.
 $ . /<working directory absolute path>/STM32MPU_workspace/STM32MP15-Ecosystem-v2.0.0/Developer-Package/SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi

5 Starting up the SDK[edit]

Info.png The SDK environment setup script must be run once in each new working terminal in which you cross-compile
PC $> cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v2.X.0/Developer-Package /* For ecosystem release  v2.1.0 More info.png : X is equal to 1 ; For ecosystem release  v2.0.0 More info.png : X is equal to 0 ;   
PC $> source SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi

The following checkings allow to ensure that the environment is correctly setup:

  • Check the target architecture
PC $> echo $ARCH
arm
  • Check the toolchain binary prefix for the target tools
PC $> echo $CROSS_COMPILE
arm-ostl-linux-gnueabi-

  • Check the C compiler version
PC $> $CC --version
arm-ostl-linux-gnueabi-gcc (GCC) 9.3.0  
Copyright (C) 2019 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
PC $> echo $OECORE_SDK_VERSION
3.1-openstlinux-5.4-dunfell-mp1-20-11-12 /* For ecosystem release  v2.1.0 More info.png  */
3.1-openstlinux-5.4-dunfell-mp1-20-06-24  /* For ecosystem release  v2.0.0 More info.png  */

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