AN 1011: TinyML Applications in Altera FPGAs Using LiteRT for Microcontrollers

ID 848984
Date 4/07/2025
Public
Document Table of Contents

4.2.2. Building LiteRT for Microcontrollers Static Library

You must build LiteRT for Microcontroller libraries in Linux environments. If you are using Windows OS, you can invoke Windows* Subsystem for Linux* (WSL). Run the following commands:
$ sudo apt update
$ sudo apt install make git python3 unzip python3-pip
$ pip3 install numpy Image
$ cd $TOP_FOLDER
$ git clone --depth 1 https://github.com/tensorflow/tflite-micro.git
$ cd tflite-micro
$ python3 tensorflow/lite/micro/tools/project_generation/create_tflm_tree.py\
 -e hello_world tflite_app
Note: It is mandatory to change Directory command (cd) to tflite-micro. The execution of create_tflm_tree.py Python script fails when it is executed from different directory.
Figure 19. Content of the tflite_app Folder

Altera recommends to review the Hello World TinyML example in the examples folder. It is a prediction model on the sine function. For more information, please refer to LiteRT – Hello World Example and LiteRT - Get started with microcontrollers.