1. Article purpose[edit source]
This article describes how to install and use the X-LINUX-AI SDK add-on.
The X-LINUX-AI SDK add-on extends the OpenSTLinux SDK with AI functionality to develop and build an AI application easily. It is available from the X-LINUX-AI product webpage.
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 installation guide. Once this has been done, you should have a directory containing the OpenSTLinux SDK.
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 is delivered through a tarball file named : en.SDK-x86_64-TBD-X-LINUX-AI-v2.2.0.tar.gz and can be downloaded here: [TBD X-LINUX-AI SDK add-on].
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/en.SDK-x86_64-TBD-X-LINUX-AI-v2.2.0.tar.gz $HOME/STM32MPU_workspace/STM32MP15-Ecosystem-v4.0.0/Developer-Package/SDK
Then, move to your 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
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
3.3. Start the SDK[edit source]
3.3.1. For STM32MP15x lines[edit source]
The add-on is now installed into the OpenSTLinux SDK, you can start the SDK. 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 is now installed into the OpenSTLinux SDK, you can start the SDK. 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]
Once the SDK is correctly setup, the applications can be built easily. In this example, it is the image classification application that will be built.
Download the github repository:
git clone https://github.com/STMicroelectronics/meta-st-stm32mpu-ai.git
Go to the image classification directory:
cd meta-st-stm32mpu-ai/recipes-samples/tflite-cv-apps/files/image-classification/src
Then, use the make command to build the application:
make
A new file appears named label_tfl_gst_gtk.This is a binary file which has been generated using the make command, it is compiled for the STM32MP1x architecture. It must now be transferred to the board.
4.2. Use the application[edit source]
Once the STM32MP1x board is correctly setup and the X-LINUX-AI packages are installed with the right version. It is possible to send the application to the board.
To do it, use the following command using your own IP address:
scp -r -p label_tfl_gst_gtk root@<ip_address>:/usr/local/demo-ai/computer-vision/tflite-image-classification/bin/
Then, use the ssh protocol to connect to the board:
ssh root@<ip_address>
On the board, go to the right directory and use the image classification script to launch the application:
cd /usr/local/demo-ai/computer-vision/tflite-image-classification/bin/ ./launch_bin_label_tfl_mobilenet.sh
This script is using the label_tfl_gst_gtk application that has been compiled before.