Skip to content

Files

Latest commit

5045f77 · Apr 8, 2025

History

History

application_examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Apr 4, 2025
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Oct 30, 2024
Apr 8, 2025
Oct 30, 2024
Apr 8, 2025
Dec 19, 2024
Dec 19, 2024
Oct 20, 2020

1 - Application examples - Introduction

The Application examples section of the Finite State Machine repository contains examples of applications ready to be used on the ST MEMS devices, and are grouped by part number.

Each folder (related to a sensor part number) contains sub-folders with examples of Finite State Machine configurations. See a typical path below:

\lsm6dsox\Shake detection\

Each example sub-folder contains:

  • A README.md file, with information about the specific application example.

  • A .ucf file (Unico Configuration File), containing the device configuration generated by Unico GUI. This file can be loaded in different software tools (Unico GUI , Unicleo GUI , AlgoBuilder GUI, etc...) in combination with different hardware tools (STEVAL-MKI109V3, STM32 Nucleo, SensorTile.box, etc...) provided by ST. The following section describes how to use the file using the different tools.

  • A .h file, containing the same information as the .ucf file, but in the format of a C programming language header (also this file is generated by Unico GUI). Examples of .h file integration in C projects are available at platform independent drivers repository for STMicroelectronics sensors.

2. How to run the application examples

Run the example with Professional MEMS tool board and Unico GUI

Unico GUI is a software tool working with STEVAL-MKI109V3, professional evaluation board for MEMS sensors, referenced as ProfiMEMS in ST docs.

To run the FSM application example in Unico GUI, the .ucf file has to be loaded as described in the following steps:

  1. Download the latest version of Unico GUI (if not already installed on your PC)

  2. Plug the DIL24 adapter (e.g. STEVAL-MKI197V1, depending on the example) to the ProfiMEMS motherboard

  3. Plug the ProfiMEMS board to your PC through a USB-microUSB cable

    • if necessary, upgrade the firmware of your board as described in the user manual UM2116
  4. Run Unico GUI selecting the desired device (adapter board, e.g. STEVAL-MKI197V1)

  5. Go to the Load/Save tab, of the Unico GUI and load the Unico Configuration File (.ucf)

  6. Once the device has been configured, press Start and you can visualize FSM results in the FSM tool of Unico GUI

Run the example with STM32 Nucleo board and Unicleo GUI

Unicleo GUI software tool works with STM32 Nucleo motherboards coupled with X-NUCLEO expansion boards (e.g. X-NUCLEO-IKS01A3). Optional sensor in form of DIL24 adapter can be plugged on top of the X-NUCLEO expansion board.

To run the FSM application example in Unicleo GUI, the .ucf file has to be loaded. Here are all the required steps:

  1. Download the latest version of Unicleo GUI (if not already installed on your PC)

  2. Download the latest version of X-CUBE-MEMS1

  3. Plug X-NUCLEO expansion board (e.g. MEMS expansion board X-NUCLEO-IKS01A3 to STM32 Nucleo board

  4. Optionally plug the DIL24 adapter with FSM feature (e.g. STEVAL-MKI197V1, depending on the example) to the DIL24 socket on X-NUCLEO expansion board

  5. Plug the STM32 Nucleo board to your PC through a USB-miniUSB cable

  6. STM32 Nucleo has to be programmed with DataLogExtended firmware from X-CUBE-MEMS1 package (if already programmed you can skip the following two steps)

    • Locate DatalogExtended.bin file in X-CUBE-MEMS1 package (STM32CubeExpansion_MEMS1_Vx.x.x\Projects\STM32xxxxxx-Nucleo\Examples\IKS0xxxx\DataLogExtended)

    • Copy the DatalogExtended.bin file to the disk drive associated with the STM32 Nucleo board

  7. Run Unicleo GUI, connect to the device, select the desired sensors, click the checkbox to enable the FSM, then click on the FSM button on the left panel, browse and load the Unico GUI Configuration File (.ucf) through the Browse button, finally click the Start button in the main window

  8. FSM results are displayed in the FSM window and User Messages Tab

Run the example with SensorTile.box and Unicleo GUI

The .ucf file can also be loaded in the SensorTile.box board through the DataLogExtended firmware available in FP-SNS-STBOX1 package. The SensorTile.box can be programmed by STM32CubeProgrammer software. Here all the steps:

  1. Download the latest version of Unicleo GUI (if not already installed on your PC)

  2. Download the latest version of FP-SNS-STBOX1

  3. SensorTile.box has to be programmed with DataLogExtended firmware from FP-SNS-STBOX1 package (if already programmed you can skip the following two steps)

    • Put the SensorTile.box in DFU mode (Direct Firmware Upgrade): disconnect the battery and unplug the USB cable, press and hold the "DFU boot" button, connect the USB cable then release the button while connecting the USB cable.

    • Run STM32CubeProgrammer, select "USB" from the pull-down menu on the right, then press "Connect". Click on the Menu button in the top-left corner. Optionally perform a full chip erase. Select "Erase & Programming", browse to select the DataLogExtended binary, set the address to 0x8000000, check "Run after Programming", then click "Start Programming".

  4. Run Unicleo GUI, connect to the device, select the desired sensors, click the checkbox to enable the FSM, then click on the FSM button on the left panel, browse and load the Unico GUI Configuration File (.ucf) through the Browse button, finally click the Start button in the main window

  5. FSM results are displayed in FSM window and User Messages Tab

Run the example with SensorTile.box and AlgoBuilder

AlgoBuilder is a software tool able to design a custom processing flow and to build the firmware for STM32 Nucleo boards coupled with the MEMS expansions, or for form-factor evaluation boards such as SensorTile.box.

You will create a firmware project using AlgoBuilder, which can be configured to use STM32CubeIDE to generate the binary file, STM32CubeProgrammer to program the SensorTile.box device, and Unicleo GUI to display the output in real-time.

  1. Configure AlgoBuilder: "File" -> "Application Settings", browse to select the path for Unicleo GUI, STM32CubeIDE, and STM32CubeProgrammer.
  2. Create a new design: "File" -> "New Design", browse and select the directory for the project, select the available IDE toolchain, select "SensorTile.box" or "SensorTile.box BLE" as target platform (the latter will support the use of a Bluetooth connection instead of the USB cable).
  3. Click and configure the default "Sensor Hub" block in the design to use the timer as data rate control, set the data rate and the full-scale of the sensors according to the example to be loaded. These settings should match the FSM settings.
  4. Expand the "Sensor Hub" library, drag and drop the "FSM / MLC" block in the design, connect it to the "Sensor Hub" block, click and configure it for 0 Finite State Machine, 1 Decision Tree in the Machine Learning core, browse and select the corresponding .ucf file.
  5. Optionally, from the "Sensor Hub" library, drag and drop the "Acceleration" block, connect it to the "Sensor Hub" block. Then, from the "Display" library, drag and drop the "Graph" block, click and configure it for the accelerometer data type, then connect it to the Acceleration block.
  6. Then, from the "Display" library, drag and drop the "Value" block, click and configure it for the custom data type, set Number of Values to 1, set Window, Value, Unit names and then connect it to the FSM output from FSM / MLC function block.
  7. Generate the project: "Firmware" -> "Generate C code". Then build the binary: "Firmware" -> "Build Firmware".
  8. Program the target: put the SensorTile.box in DFU mode, "Tools" -> "Program Target".
  9. Open Unicleo GUI: "Tools" -> "Run Unicleo-GUI application", connect to the device, press Start to display the output in real-time.

Run the example on a custom hardware using C-programming

A .h file is provided to easily include the FSM configuration in any C-programmable custom hardware.

For using the C header files (.h), it is required:

  • A standard C language compiler for the target MCU
  • A C library for the target MCU and the desired interface (i.e. SPI, I2C)

To run the example through the configuration provided in the .h file, it necessary to:

  1. Include the C header file (.h) in the desired project

  2. Use the desired interface C library for the target MCU for writing the configuration registers array contained in the C header file (.h).

Some examples of sensors integration are available at the platform independent drivers repository for STMicroelectronics sensors.



More Information: http://www.st.com

Copyright © 2020 STMicroelectronics