cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply Pedometer Regression output (.ucf/.json) for SensorTile.box Pro?

joseph_binu
Associate II

Hi ST Community,

I am working on a project using the SensorTile.box Pro. My goal is to implement a highly accurate step counter using the LSM6DSV16X's embedded pedometer.

What I have done:

  1. I recorded data patterns at 30Hz and successfully ran the Pedometer Regression Tool in MEMS Studio.

  2. The tool generated the optimum configuration files (pedometer.json ).

  3. I converted these register settings into a .ucf file format.

The Problem: I need to apply these "Golden Settings" to the sensor initialization in AlgoBuilder so they persist after a reset. However, I am unable to find a standard method to load this configuration:

  • I checked the Sensor Hub block properties, but I do not see a "Load Configuration/UCF" option.

  • I searched the Library for a "Register Write" block to manually input the values, but this block seems missing or hidden in my version of AlgoBuilder (I only see Acceleration, FSM/MLC, Sensor Hub, etc. under the Sensor Hub folder).

My Question: What is the correct way to inject a custom register configuration (or load a .ucf file) for the LSM6DSV16X sensor in the SensorTile box Pro?

  • Is there a specific block I should use (e.g., the FSM/MLC block as a container)?

  • Or do I need to use a Custom Code block? If so, what is the syntax for writing registers during initialization ?

Hardware/Software Details:

  • Board: SensorTile.box Pro (STEVAL-MKBOXPRO)

  • Sensor: LSM6DSV16X

  • Software: AlgoBuilder (v2.2.0), MEMS Studio

Any guidance or a screenshot of the correct block setup would be greatly appreciated!

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Miroslav BATEK
ST Employee

Hello,

the usage of Custom Block Creator is described in MEMS Studio user manual UM3233 in chapter 7.20.

I'm attaching example of custom block for embedded pedometer, it configures the pedometer in LSM6DSV16X during initialization and in the main loop read the number of steps. You can use it as reference.

View solution in original post

6 REPLIES 6
Miroslav BATEK
ST Employee

Hello,
there is no specific block to read or write to sensor registers.
You need to create custom block with a specific code.
You can use following command to write to the sensor register:

BSP_MOTION_SENSOR_Write_Register(LSM6DSV16X_0, register_address, register_value);

In order to execute it only once during initialization it must be part of the Init code. You can create a function and add it in the Init code section.

joseph_binu
Associate II

Hi, 

Sorry for my late response. Can you explain to me the process of  creating the custom block . i tried to create the custom block in the MEMS Studio but it is not working. I don't understand what should be the inputs and outputs. Should i directly connect the custom block to the sensor hub? Please help me. 

Thank you for your understanding 

Miroslav BATEK
ST Employee

Hello,

the usage of Custom Block Creator is described in MEMS Studio user manual UM3233 in chapter 7.20.

I'm attaching example of custom block for embedded pedometer, it configures the pedometer in LSM6DSV16X during initialization and in the main loop read the number of steps. You can use it as reference.

joseph_binu
Associate II

Thank you for your help 

joseph_binu
Associate II

Hello,

I have successfully created the algorithm and the custom block using the JSON you shared with me.

The custom algorithm works perfectly when the STEVAL-MKBOXPRO is connected via USB to ST MEMS Studio. However, I am having trouble getting the data to broadcast over the BLE connection.

Here is my current AlgoBuilder setup and what I have tested so far:

  • I have the flow set up as: Sensor Hub -> Embedded Pedometer -> Value block.

  • The Sensor Hub ODR is active.

  • When I connect using the ST BLE Sensor App , the screen is blank.

  • To debug the radio, I connected using the nRF Connect app. The connection is successful, and I can see the custom ST service characteristic with the NOTIFY property.

  • The main issue: When I enable Notifications in nRF Connect, no hex values appear. The tablet is listening, but the board is not pushing any data updates.

Because the USB connection works but the BLE push does not, it seems like the BLE characteristic is being created, but the data execution loop might be freezing or failing to trigger the Bluetooth broadcast.

What should I do to ensure the custom algorithm pushes the data through the BLE connection?

Hello,
unfortunately the AlgoBuilder firmware with BLE connectivity is not compatible with ST BLE Sensor App but you can connect to MEMS Studio running on your PC over BLE.
Please check MEMS Studio user manual UM3233 chapter 2.7.