How to install and use the X-LINUX-AI SDK add-on

Revision as of 11:42, 16 June 2022 by Registered User
Applicable for STM32MP13x lines, STM32MP15x lines

1. Article purpose[edit source]

This article describes how to install and use the X-LINUX-AI SDK add-on.

2. Prerequisites[edit source]

2.1. Install the OpenSTLinux SDK[edit source]

First of all, you need to download and install the OpenSTLinux SDK which contains all the basis needed for the X-LINUX-AI add-on. To do this, follow the first four sections of the OpenSTLinux SDK tutorial. Once this has been done, you should have a directory containing the OpenSTLinux SDK.

Warning white.png Warning
You only need to follow the section 1 to 4 of the OpenSTLinux SDK tutorial.
Info white.png Information
Once this is done, the path to the OpenSTLinux SDK should be the following $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v4.0.0/Developer-Package/SDK if an STM32MP15x series is used or $HOME/STM32MPU_workspace/STM32MP13-Ecosystem-v4.0.0/Developer-Package/SDK if an STM32MP13x series is used.

3. X-LINUX-AI SDK add-on Installation[edit source]

3.1. Download the X-LINUX-AI SDK add-on[edit source]

To add the Artificial Intelligence part into the OpenSTLinux SDK, you need to download and install the X-LINUX-AI SDK add-on. The add-on are delivered through a tarball file named : SDK-X-LINUX-AI-addon.tar.gz and can be downloaded here: X-LINUX-AI SDK add-on.

Warning white.png Warning
The X-LINUX-AI SDK add-on version must be the same as the OpenSTLinux SDK. If the version are not aligned, it might not work correctly.

3.2. Install the X-LINUX-AI SDK add-on[edit source]

3.2.1. For STM32MP15x lines[edit source]

After that, you need to uncompress the tarball file in your OpenSTLinux SDK directory. First, copy the add-on to the OpenSTLinux SDK directory:

  cp ~/Downloads/SDK-X-LINUX-AI-addon.tar.gz  $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v4.0.0/Developer-Package/SDK

Then, move to you OpenSTLinux SDK directory:

  cd  $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v4.0.0/Developer-Package/SDK

Finally, uncompress the tarball:

  tar xzf SDK-X-LINUX-AI-addon.tar.gz
Warning white.png Warning
It is mandatory to uncompress the tarball inside the OpenSTLinux SDK directory.

3.2.2. For STM32MP13x lines[edit source]

After that, you need to uncompress the tarball file in your OpenSTLinux SDK directory. First, copy the add-on to the OpenSTLinux SDK directory:

  cp ~/Downloads/SDK-X-LINUX-AI-addon.tar.gz  $HOME/STM32MPU_workspace/STM32MP13-Ecosystem-v4.0.0/Developer-Package/SDK

Then, move to you OpenSTLinux SDK directory:

  cd  $HOME/STM32MPU_workspace/STM32MP13-Ecosystem-v4.0.0/Developer-Package/SDK

Finally, uncompress the tarball:

  tar xzf SDK-X-LINUX-AI-addon.tar.gz
Warning white.png Warning
It is mandatory to uncompress the tarball inside the OpenSTLinux SDK directory.

3.3. Start the SDK[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

3.3.1. For STM32MP15x lines[edit source]

The add-on are now installed into the OpenSTLinux SDK, you can start the SDK as it is described in the OpenSTLinux SDK installation process. Go to your OpenSTLinux SDK directory and source the environment:

  cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v4.0.0/Developer-Package/SDK
  source environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi

3.3.2. For STM32MP13x lines[edit source]

The add-on are now installed into the OpenSTLinux SDK, you can start the SDK as it is described in the OpenSTLinux SDK installation process. Go to your OpenSTLinux SDK directory and source the environment:

  cd $HOME/STM32MPU_workspace/STM32MP13-Ecosystem-v4.0.0/Developer-Package/SDK
  source environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi

4. Use the SDK[edit source]

4.1. Build an application with the SDK[edit source]

Info white.png Information
In this section, the image classification application will be used as example, but all the application can be build with this method.

Once the SDK is correctly setup, the applications can be built easily. At first choose the application, in this example the image classification application will be built. Go to the image classification directory:

  cd openstlinux-4.0/layers/meta-st/meta-st-stm32mpu-ai/recipes-samples/tflite-cv-apps/files/image-classification/