STMicroelectronics AlgoBuilder User Manual

UM2373
User manual
Getting started with the AlgoBuilder application for the graphical design of
algorithms
Introduction
AlgoBuilder is a graphical design application to build and use algorithms.
The software is distributed in two versions:
AlgoBuilder – standalone AlgoBuilder software;
AlgoBuilderSuite – all-in-one software package which contains AlgoBuilder and two other software tools, Unico-GUI &
Unicleo GUI that facilitate the programming of sensors for an easy and intuitive experience for the user.
These tools quickly elaborate prototypes of applications for STM32 microcontrollers and MEMS sensors, including already existing algorithms (i.e. sensor fusion or pedometer), user-defined data processing blocks and additional functionalities.
AlgoBuilder reuses previously defined blocks, combines multiple functionalities in a single project and visualizes data using Unicleo-GUI in real time using plot and display.
AlgoBuilder utilizes the STM32 ODE (Open Development Environment) ecosystem which combines hardware like STM32 Nucleo boards (NUCLEO-F401RE or NUCLEO-L476RG), X-NUCLEO-IKS01A2 or X-NUCLEO-IKS01A3 expansion board and
software (STM32 HAL drivers, BSP structure, low and high-level sensor drivers) along with SensorTile.box and STWIN.
UM2373 - Rev 9 - October 2020 For further information contact your local STMicroelectronics sales office.
www.st.com

1 Description

1.1 Overview

The main objectives of AlgoBuilder are:
quick prototyping of applications for STM32 microcontrollers and MEMS sensors which already include existing algorithms (e.g. sensor fusion or pedometer), user-defined data processing blocks and additional functionalities
easier process of implementing proof of concept using graphical interface without writing the code
reuse of previously defined blocks
combination of multiple functionalities in a single project
visualization of data in Unicleo-GUI in real time using plot and display
The key features of the application include:
Simple graphical design of algorithms (drag and drop, connect, set properties, build, upload)
Optional multi-level design
Wide range of function blocks available in libraries, including motion sensor algorithms (e.g. sensor fusion, gyroscope, magnetometer calibration, pedometer, ...)
Integrated function blocks for FFT analysis
Function block creator for custom block creation
Automatic validation of design rules
C code generation from the graphical design
Use of external compilers (STM32CubeIDE, IAR EWARM, Keil µVision®, System Workbench for STM32)
Possibility to automatically generate MLC settings for compatible iNEMO inertial modules using Unico-GUI
Generated firmware output displayed through integrated output data monitor or Unicleo-GUI
Open XML format for function blocks and design storage
Possibility to send output data to AWS cloud using MQTT protocol
Support for NUCLEO-F401RE or NUCLEO-L476RG with connected X-NUCLEO-IKS01A2 or X-NUCLEO-
IKS01A3 expansion board, SensorTile STEVAL-STLKT01V1, SensorTile.box STEVAL-MKSBOX1V1 and
STWIN SensorTile STEVAL-STWINKT1
Network updates with automatic notification of new releases
UM2373
Description
1.2
UM2373 - Rev 9

Prerequisites

The following software and hardware are needed to fully exploit the functions of AlgoBuilder.
One of the following IDEs:
STM32CubeIDE 1.0.0 or newer
IAR-EWARM 8.11.0 or newer
Keil µVision 5.22 or newer
Unicleo-GUI
STM32CubeProgrammer (STM32CubeProg)
STM32 Virtual COM Port Driver (STSW-STM32102)
NUCLEO-F401RE or NUCLEO-L476RG with X-NUCLEO-IKS01A2 or X-NUCLEO-IKS01A3 or SensorTile
STEVAL-STLKT01V1 or SensorTile.box STEVAL-MKSBOX1V1 and STWIN SensorTile STEVAL-STWINKT1
page 2/53

1.3 Terms and references

Function block is a data processing element with one or multiple inputs or outputs. It processes inputs and generates outputs and can have one or more properties.
Design is a set of several function blocks connected together.
UM2373
Terms and references
Figure 1. AlgoBuilder function block
Figure 2. AlgoBuilder design
Node represents the connection between two function blocks.
Firmware for STM32 microcontroller can be built from the design.
STM32 Nucleo development board with an STM32 microcontroller used for design testing.
X-NUCLEO-IKS01A2 motion MEMS and environmental sensor expansion board which embeds accelerometer, gyroscope, magnetometer, temperature, humidity and pressure sensors.
Figure 3. STM32 Nucleo (NUCLEO-F401RE) plus X-NUCLEO-IKS01A2
UM2373 - Rev 9
page 3/53
Unicleo-GUI can be used to display the firmware outputs.
Figure 4. Unicleo-GUI
UM2373
Terms and references
UM2373 - Rev 9
page 4/53

1.4 Principle of operation

The workflow starts from the graphical design of the desired functionality by using a simple "drag and drop" approach.
You can use the predefined function blocks provided in the form of libraries.
You can also create a custom function block. Some function block properties can or must be adjusted in order to run (in the example, filter coefficients are defined in the filter function block properties). Then, you can interconnect the compatible function blocks using nodes.
AlgoBuilder automatically checks the compatibility between input and output and allows connecting only terminals
with the same type and dimension.
When the design is finished, AlgoBuilder generates the C code from the defined graphical design.
The final firmware project is created from the C code generator combined with pre-prepared firmware templates and binary libraries.
The project can be compiled using an external compiler tool and the most common Integrated Development Environments (IDEs) are supported (System Workbench for STM32 with GCC compiler, Keil µVision, IAR Embedded Workbench).
An STM32 Nucleo board is then programmed by the generated binary file. When the firmware is executed it starts reading data from the selected sensor, process the data via the algorithm and sends results to Unicleo-GUI application.
During the graphical design, you can select how to see the results. Graphs, logical analyzer, bar charts, 3D plot, scatter plot, histogram, teapot, FFT plot and text values are supported.
During the startup, the firmware configures the Unicleo-GUI to display in the desired format.
The graphical designs as well as the libraries are stored as XML files.
UM2373
Principle of operation
Figure 5. AlgoBuilder principle of operation
UM2373 - Rev 9
page 5/53

2 Getting started

2.1 Installing the software

The software is distributed in two versions:
• AlgoBuilder – standalone AlgoBuilder software;
• AlgoBuilderSuite – all-in-one software package which contains AlgoBuilder and two other software tools, Unico-
GUI & Unicleo GUI.
AlgoBuilder software is designed to run in Microsoft® Windows. To install the application, run
Setup_AlgoBuilder.exe or AlgoBuilderSuite.exe, follow the instructions and execute AlgoBuilder once the installation is complete.
UM2373
Getting started
Figure 6. AlgoBuilder installer
UM2373 - Rev 9
Figure 7. AlgoBuilderSuite installer
page 6/53
AlgoBuilderSuite installer contains a certain version of AlgoBuilder, Unicleo-GUI and Unico-GUI. The installer is able to check simultaneously if a newer version of each individual software is available on st.com and download it during the installation process.

2.2 Running the software for the first time

The installer may have created a shortcut on your Windows desktop and/or Windows start menu. The AlgoBuilder can be run by double clicking on the shortcut. If the shortcuts were not created, you can run the AlgoBuilder by executing AlgoBuilder.exe file which is located in the directory where the application was installed (default location is C:\Program Files (x86)\STMicroelectronics\AlgoBuilder).
Figure 8. AlgoBuilder icon
UM2373
Running the software for the first time
UM2373 - Rev 9
page 7/53

2.3 Application settings

You can adjust the AlgoBuilder configuration in File→Application Settings.
Step 1. Specify the path to Unicleo-GUI.
UM2373
Application settings
Figure 9. Application Settings menu option
Figure 10. Application Settings window
If the path (Unicleo-GUI.exe) is properly set, the Unicleo-GUI can be quickly executed from the toolbar or the AlgoBuilder menu. If the path is not set, the corresponding icon in the toolbar and item in the menu are disabled.
Step 2. Specify the path to at least one IDE.
For STM32CubeIDE put the path to stm32cubeide.exe, for System Workbench for STM32 to eclipsec.exe, for IAR Embedded Workbench to IarBuild.exe and for Keil µVision to UV4.exe.
Step 3. Set up the options related to SensorTile programming.
If you are going to use SensorTile and program it using the integrated ST-LINK V2.1 programmer on an STM32 NUCLEO board, select List All Embedded Drives.
Step 4. Specify the path to the STM32CubeProgrammer.
If you want to use a standalone ST-LINK programmer or DFU programming mode, specify the path to the previously installed STM32CubeProgrammer.
Step 5. Set up the application behavior.
If Filter Build Output is enabled, AlgoBuilder automatically filters outputs from the external compiler and makes them more readable in the console.
The font size can be adjusted as well, for better readability on high-resolution monitors.
UM2373 - Rev 9
page 8/53

2.4 Network update settings

The application is able to check and notify if a new version is available. You can then decide whether to download and install the new version.
Some functional network parameters have to be properly set in Network Update Settings in the File menu.
Figure 11. Network Update Settings menu option
The setting dialog is divided in different sections:
1. In the first section you can choose between manual and automatic check. In the latter, you can adjust the periodicity. If an interval of zero days is set, a check for updates is performed at every application start. To run an immediate check for updates, click on Check Now.
2. The second section contains options for proxy server type settings.
Tip: When you select Use System Proxy Parameters, it is usually necessary to open a web browser to run all security scripts before running a check for updates.
3. The third section contains the proxy manual configuration field where the proxy HTTP name and port number can be entered.
4. The last section contains the authentication credential fields (if required)
The Check Connection button can be used to check if the update server is accessible.
UM2373
Network update settings
Figure 12. Network Update Settings window
UM2373 - Rev 9
page 9/53

3 Using AlgoBuilder

The AlgoBuilder main window contains:
a central Workspace where the algorithm is designed using function blocks
a Library dock with a list of available libraries and their function blocks which can be dragged and dropped to the workspace window
a Subdesigns dock with a list of available subdesigns and subdesign templates
a Description dock which displays information about the selected component (function block, connection, etc.)
a Properties dock which displays all available properties of the selected function block
a Console dock which displays messages from the AlgoBuilder or an external compiler
The AlgoBuilder application has a standard menu and a toolbar to speed up access to frequently used functions.
Note: You can change the position of all docks and the toolbar. Docks can be opened and closed in the View menu.
UM2373
Using AlgoBuilder
Figure 13. AlgoBuilder main window
UM2373 - Rev 9
page 10/53

3.1 Workspace

The developed algorithm design is created in the workspace area.
Step 1. Place the necessary function blocks on the workspace
Note: Function blocks can be simply dragged from the library dock and dropped in the workspace.
Step 2. Set their properties
Step 3. Connect them by clicking and holding the mouse left button on the output you want to connect and
move the cursor to the input where the connection should be made. The connection can be created also in the opposite way from input to output.
Note: You can connect only inputs and outputs of the same type and size. If you try to connect different types or sizes, the console displays an error message.
You can change the number of inputs for some function blocks (e.g. MUX, Sum, And, Or...).
Step 4. Use Delete to remove any component, Cut, Copy and Paste for any part of the design through the
Edit menu, the Toolbar or the shortcut.
Step 5. Align the function blocks to the right, left, top or bottom.
The last selected function block determines the final position.
Step 6. Use Do and Undo to go back and forward in the performed operations in the workspace.
UM2373
Workspace
Step 7. To Zoom In or Zoom Out use Ctrl and the mouse wheel or the appropriate function in View menu or in
Toolbar.
Step 8. Select Fit All to fit the whole design on the screen.
Step 9. Select Zoom 1:1 to set zoom factor to 1.
Step 10. Right click and hold on the workspace area to explore the content of the design.
3.2

Library dock

The Library dock gives you access to all the available libraries and function blocks located in a particular library.
AlgoBuilder scans [Install path]/Library/ and the user's home directory \STMicroelectronics\AlgoBuilder\Library
during startup and loads all valid libraries located there.
The Graphics library is not stored in an xml file but it is automatically added by AlgoBuilder.

3.3 Subdesigns dock

The Subdesigns dock gives you access to all the available subdesigns.
AlgoBuilder scans [Install path]/Subdesigns/ and the user's home directory \STMicroelectronics\AlgoBuilder
\Subdesigns during startup and loads all valid subdesigns located there. The subdesign templates are located in the [Install path]/Subdesigns/ directory.

3.4 Description dock

The Description dock provides information about the component selected in the Workspace or in the Library dock.
If you select a function block, the following information is shown:
Name
Version
Description of the function block functionality
Type, size and functionality of all inputs
Type, size and functionality of all outputs
Description of all function block properties
UM2373 - Rev 9
page 11/53

3.5 Properties dock

If a function block has a property or properties, they are displayed in the Properties dock.
Each property has name, value and type fields.
The values can be modified.
The AlgoBuilder automatically checks if the value is valid and does not allow setting an invalid one (for example, a value out of an available range).
For the STRING type, the % character is forbidden and is automatically deleted.
UM2373
Properties dock
UM2373 - Rev 9
page 12/53

3.6 Toolbar

The Toolbar provides quick access to the most commonly used functions. The position of the toolbar and the order of the function can be adjusted.
Toolbar icon Function
UM2373
Toolbar
Table 1. AlgoBuilder toolbar default functions
Creates new design
Open existing design
Save design (subdesign)
Save design (subdesign) as different file
Open Application Settings window
Zoom In
Zoom Out
Set zoom to 1:1 ratio
Fit all design into screen
Undo
Redo
Copy
Paste
Cut
UM2373 - Rev 9
Align to the left
Align to the right
Align to the top
Align to the bottom
page 13/53
Toolbar icon Function
Align to center horizontally
Align to center vertically
Open Firmware Settings window
Generates C Code from the graphical design
Build firmware / Validate subdesign
Show the design xml source file in the default text editor
Show C Code in the default text editor
UM2373
Toolbar
Arrange Toolbox Buttons
Program Target
Run Unicleo-GUI application
Input Data & Output Data Monitor & AWS Connectivity
Open Function Block Creator
Open About window
UM2373 - Rev 9
page 14/53

4 Data types

AlgoBuilder works with four data types:
FLOAT represents real numbers and is used for floating-point arithmetic (for example, in the acceleration function block output). In C code, the representation float variable is used. The size is 4 bytes.
INT represents integer numbers (for example, in the counter function block). In C code, int32_t variable is used. The size is 4 bytes.
VARIANT is used for inputs of a set of function blocks; the variant changes its type on the basis of the type of output connected to this input (for example, the variant type is used for inputs of comparison function blocks).
VOID is used exclusively for the connection between Sensor Hub and its data outputs. This type cannot be visualized.
Each input or output is characterized by its type and size: the thickness of the connection line indicates the size of input and output and color of the connection line indicated the type.
The size value can be changed in the properties.
Important: Only input and output with the exact same type and size can be connected together. The only exception is the VARIANT input which gets the type of connected output.
It is not possible to connect the input and output of the same function block. If this is desired, the Feedback function block for the particular data type needs to be used. The Feedback function block has an Init value, which defines the output value of the block for the first run.
UM2373
Data types
Figure 14. Using the Feedback function block
UM2373 - Rev 9
page 15/53

5 Conditional Execution

In some cases, it is needed to execute the function block operation only if a certain condition is valid. For this case it is possible to add Conditional Execution Input to the selected function block. This input then defines if the function block code will be executed or not. This is represented as an if statement in the generated C code. To add or remove the conditional execution input, click on the function block using the right mouse button.
UM2373
Conditional Execution
Figure 15. Conditional Execution
UM2373 - Rev 9
page 16/53
Loading...
+ 37 hidden pages