Last edited 2 weeks ago

X-LINUX-AI Starter package

Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP23x lines, STM32MP25x lines


1. Install from the OpenSTLinux AI package repository[edit | edit source]

Info white.png Information
The STMicroelectronics packages repository service is provided for evaluation purposes only, its content may be updated at any time without notice and is therefore not approved for use in production.

All the generated X-LINUX-AI packages are available from the OpenSTLinux AI package repository service hosted at the non-browsable URL http://extra.packages.openstlinux.st.com/AI.

This repository contains AI packages that can be simply installed using apt-* utilities, which the same as those used on a Debian system:

  • the main group contains the selection of AI packages whose installation is automatically tested by STMicroelectronics
  • the updates group is reserved for future uses such as package revision update.

You can install them individually or by package group.

2. Material needed[edit | edit source]

To use the X-LINUX-AI OpenSTLinux Expansion Package, choose one of the following materials:

  • STM32MP257F-EV1 Evaluation board More info green.png + a Sony™ IMX335 5Mpx sensor
  • STM32MP257F-DK Discovery kit More info green.png + a Sony™ IMX335 5Mpx sensor
  • STM32MP257F-DK Discovery kit More info green.png for STM32MP23x lines evaluation Info.png + a Sony™ IMX335 5Mpx sensor
  • STM32MP157F-DK2 Discovery kit More info green.png + an UVC USB WebCam
  • STM32MP157F-EV1 Evaluation board More info green.png with the built in camera module: MB1379 (OmniVision OV5640 parallel camera)
  • STM32MP135F-DK Discovery kit More info green.png with the built in camera module: MB1897 (GalaxyCore 2145 parallel camera)

3. Prerequisites[edit | edit source]

  • Flash the Starter Package on your SDCard
For OpenSTLinux ecosystem release v6.0.0 More info.png :
Select and follow the correct Starter Package procedure based on the board used
As example:
For STM32MP257x-EV, follow this Starter Package procedure
For STM32MP157x-DK2, follow this Starter Package procedure
  • Your board has an internet connection either through the network cable or through a WiFi connection.
Info white.png Information

If your internet access depends on a proxy server, you should define the http_proxy environment variable with the following command before any apt-* commands:

export http_proxy='http://<proxy url>:<proxy port>/'

4. Boot the OpenSTlinux Starter Package[edit | edit source]

At the end of the boot sequence, the demo launcher application appears on the screen.

Demo launcher appearance when X-LINUX-AI is not installed

5. Install the X-LINUX-AI tool[edit | edit source]

Once the board is booted, execute the following command in the console in order to download X-LINUX-AI tool package from OpenSTLinux package repository:


For ecosystem release v6.0.0 More info.png :

  • Synchronize the OpenSTLinux package repository.
apt-get update
  • Install X-LINUX-AI tool package:
apt-get install x-linux-ai-tool 
  • Synchronize the X-LINUX-AI package repository.
apt-get update
  • Check that X-LINUX-AI is properly installed:
x-linux-ai -v
X-LINUX-AI version: 6.0.1
Info white.png Information
The x-linux-ai binary (installed in the /usr/bin directory) allows to recover information on the X-LINUX-AI delivery, like version, features, supported applications. It is also used for package management, please refer to the dedicated wiki page for more information.

6. Install AI packages[edit | edit source]

Warning white.png Warning
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.

6.1. Install X-LINUX-AI demonstration packages[edit | edit source]

To get started with X-LINUX-AI, it is recommended to install the X-LINUX-AI demonstration package, which provides all the AI frameworks, applications examples, tools and utilities optimized for the specific target used.

Depending on the board used, the demonstration package to install is not exactly the same.

  • For STM32MP2x with AI hardware accelerator please install :

The packagegroup-x-linux-ai-demo-npu is dedicated to STM32MP2x board with AI hardware accelerator, it contains the necessary packages to demonstrate performances of STM32MP2x NPU with models,frameworks and applications.

Command Description
 x-linux-ai -i packagegroup-x-linux-ai-demo-npu 
Install the X-LINUX-AI demonstration packages which provide AI frameworks, application examples and tools dedicated to the STM32MP2x board with AI hardware accelerator.

After having installed the x-linux-ai-tool you can install the X-LINUX-AI demonstration packages.

x-linux-ai -i packagegroup-x-linux-ai-demo-npu

And restart the demo launcher:

systemctl restart weston-graphical-session.service
  • For STM32MPU without AI hardware accelerator please install :

The packagegroup-x-linux-ai-demo-cpu is dedicated to STM32MPU board without AI hardware accelerator, it contains models,frameworks and applications that are running only on CPU.

Command Description
 x-linux-ai -i packagegroup-x-linux-ai-demo-cpu 
Install the X-LINUX-AI demonstration packages which provide AI frameworks, application examples and tools dedicated to the STM32MPU board without AI hardware accelerator.

After having installed the x-linux-ai-tool you can install the X-LINUX-AI demonstration packages.

x-linux-ai -i packagegroup-x-linux-ai-demo-cpu

And restart the demo launcher:

systemctl restart weston-graphical-session.service

6.2. [OPTIONAL] Going further with X-LINUX-AI package management[edit | edit source]

6.2.1. Install X-LINUX-AI package-group[edit | edit source]

In addition with the X-LINUX-AI demonstration package, there are also other groups of packages dedicated to providing all the necessary packages and tools for a specific artificial intelligence functionality named "packagegroup".

The available packagegroups for STM32MP2x board with AI hardware accelerator are the following:

  • packagegroup-x-linux-ai-demo-npu: Default packagegroup provinding for X-LINUX-AI expansion package evaluation for board with AI hardware accelerator.
  • packagegroup-x-linux-ai-npu: Provide minimal packages to address NN hardware acceleration on NPU for STM32MP2 series' boards More info green.png.
  • packagegroup-x-linux-ai-<tflite/onnxruntime>-npu: Provide packages and tools dedicated to a specific AI frameworks like TensorFlow Lite and ONNX.
  • packagegroup-x-linux-ai: Packagegroup used to install all the packages available in X-LINUX-AI for the target used.
Command Description
x-linux-ai -i packagegroup-x-linux-ai-demo-npu
Install X-LINUX-AI demonstration packages which provide AI frameworks, application examples and tools dedicated to the board used.
x-linux-ai -i packagegroup-x-linux-ai-npu
Install X-LINUX-AI packages allowing to use OpenVX stack for the NPU hardware acceleration (including application samples)
x-linux-ai -i packagegroup-x-linux-ai-tflite-npu
Install X-LINUX-AI packages related to TensorFlow™ Lite framework (including application samples)
x-linux-ai -i packagegroup-x-linux-ai-onnxruntime-npu
Install X-LINUX-AI packages related to ONNX Runtime™ (including application samples)
x-linux-ai -i packagegroup-x-linux-ai
Install all X-LINUX-AI packages available for the target with AI hardware accelerator

The available packagegroups for STM32MPU board without AI hardware accelerator are the following:

  • packagegroup-x-linux-ai-demo-cpu: Default packagegroup provinding for X-LINUX-AI expansion package evaluation for board with out AI hardware accelerator.
  • packagegroup-x-linux-ai-<tflite/onnxruntime>-cpu: Provide packages and tools dedicated to a specific AI frameworks like TensorFlow Lite and ONNX.
  • packagegroup-x-linux-ai-cpu: Packagegroup used to install all the packages available in X-LINUX-AI for the target used.
Command Description
x-linux-ai -i packagegroup-x-linux-ai-demo-cpu
Install X-LINUX-AI demonstration packages which provide AI frameworks, application examples and tools dedicated to the board used.
x-linux-ai -i packagegroup-x-linux-ai-tflite-cpu
Install X-LINUX-AI packages related to TensorFlow™ Lite framework (including application samples)
x-linux-ai -i packagegroup-x-linux-ai-onnxruntime-cpu
Install X-LINUX-AI packages related to ONNX Runtime™ (including application samples)
x-linux-ai -i packagegroup-x-linux-ai-cpu
Install all X-LINUX-AI packages available for the target without AI hardware accelerator

6.2.2. Install X-LINUX-AI individual packages[edit | edit source]

To be able to list or manage all the X-LINUX-AI individual packages available please refer to the dedicated X-LINUX-AI tool suite article

7. Launch an AI application sample[edit | edit source]

Once the demo launcher is restarted, notice that it is slightly different because new AI application samples have been installed.
The demo launcher has the following appearance, and you can navigate into the different screens by using the NEXT or BACK buttons.

7.1. For STM32MP2x lines with AI hardware accelerator[edit | edit source]

Demo launcher appearance when X-LINUX-AI is installed on MP2x with AI hardware accelerator

7.2. For STM32MPU series without AI hardware accelerator[edit | edit source]

Demo launcher appearance when X-LINUX-AI is installed on MPU without AI hardware accelerator

The demo launcher now contain AI application samples that are described within dedicated article available in the X-LINUX-AI application samples page.

7.3. Enjoy running your own NN models[edit | edit source]

The above examples provide application samples to demonstrate how to execute models easily on the STM32MPUs.

You are free to update the C/C++ application or Python scripts for your own purposes, using your own NN models.

Source code locations are provided in application sample pages.

8. References[edit | edit source]