cancel
Showing results for 
Search instead for 
Did you mean: 

How to use SensorTile.box in Pro mode

LauraCx
ST Employee
This article will explain how to use SensortTile.box in Pro mode, and create a whole project from scratch with the STCube.MX standard procedure.

1. How to get the full control on ST.box - the Pro Mode

If you are a developer, or you are just moved by the sake of curiosity, you would desire to go deep in the functionality of the SensorTile.box, to get a full control on the platform. You will be glad to hear that ST.box is full Cube.MX compatible, so that you can create a whole project from scratch with the STCube.MX standard procedure.

From a hardware point of view, you need a programmer for STM32. While for now we suggest you the STLink V2 programmer with a custom cable, the compatibility with STLink V3 programming and debug (with level shifter to 1.8V; we suggest to use the STLink V3 mini, which is already equipped with the right cable) and the related connection cable will be available soon.
1575.png

2. The Pro Mode - get a full control on all ST sensors

SensorTile.box tool is an open environment under almost all points of view. You can personalize the firmware, creating your own sensor package and you own neural network, and you can also customize the smartphone application interface, having a direct access in the source code.

At firmware level, you can program your ST.box in the best way for you. You can start a project from scratch (because the platform is included in the CubeMX code generator), or you can use the existing packages, which will be deeply described in the next posts:

  • FP-SNS-STBOX1, the function pack dedicated to the Pro Mode of the SensorTile.box wireless multi sensor development kit;
  • FP-AI-SENSING1, the function pack that enables for ultra-low power IoT node with artificial intelligence (AI) application based on audio and motion sensing;
  • FP-SNS-ALLMEMS2, the classical function pack for ultra-low power IoT node with BLE connectivity, digital microphone, environmental and motion sensors.

At software level, the ST BLE Sensor application source code is open, and you can find in on Github.com --> here. Used in conjunction with a firmware compatible with the BlueST protocol, the ST BLE Sensor application allow the user to access to all the sensors data, to request and download algorithm licenses, and to update the firmware directly from a mobile device via the Bluetooth® Low Energy protocol.

3. ST.box main firmware function pack explained - overview

The purpose of the FP-SNS-STBOX1, which is the main functional pack (FP) dedicated to the ST.box, is to provide examples that show how to build custom applications for the Pro Mode at a FW level. Its flexibility allows the ease portability of this FP across different STM32 microcontrollers, so that you can build your customized app not starting from scratch.

The available pro-mode applications, a couple of which will be explained in the near future posts, are:

  • BLEFOTA: creates a BootLoader and an application for Firmware-Over-the-Air (FOTA) update;
  • BLELowPower: uses ultra-low power implementation based on an RTOS for transmitting the data via BLE connectivity;
  • BLEMLC: programs the LSM6DSOX machine learning core for activity recognition or vibration monitoring and transmits the results via BLE;
  • BLESensors: transmits sensor data in the simplest way for BLE trasmission;
  • DataLog: saves the sensor data to the SD card (with FreeRTOS).

Together with these applications, there are also a couple of examples that involves other platforms:

  • BootLoader: enables you to update the code;
  • DataLogExtended: enables you to send data via USB and visualize the sensor data with Unicleo-GUI
1576.png.

4. Pro-mode (Mode 3) at work - BootLoader and BLEFOTA explained

ST.box is on track with the most recent software solutions also in the field of Over-the-Air programming: firmware can be updated in a secure way on the ST.box. But let's see in which way.

The BLEFOTA firmware can be updated Over-The-Air (FOTA) through an Android/iOS device via Bluetooth using the STBLESensor application: in more detail, the app sends the update and associated cyclic redundancy check (CRC) value, which the BLEFOTA checks against the hardware cyclic redundancy check calculation unit on the STM32L4 processor to ensure integrity. If the CRC calculation matches the STBLESensor CRC value, the new firmware is written at the beginning of the third Flash region. A “magic number” signals to the STBLESensor that a firmware update has been received and checked, and is ready to replace the current BLEFOTA firmware.

The BootLoader checks whether the "magic number" is present and, if the case, the BootLoader replaces the content of Region 2 (previous BLEFOTA firmware) with the content of Region 3 (new BLEFOTA firmware), then deletes the "magic number" present on Region 3 and restarts itself. If the magic number is not present, the BootLoader jumps to running the actual BLEFOTA firmware present on Region 2.

1577.png
1578.png

5. Pro-mode (Mode 3) at work - Discover LSM6DSOX applications on ST.box

The LSM6DSOX is one of the most innovative products in ST MEMS Sensors portfolio. And, of course, is onboard on the ST.box. Two pro-mode application directly shows part of the capability of this product:

  • BLELowPower application: besides explaining how to use FreeRTOS and low power techniques to send the data to STBLESensor via Bluetooth, this application shows how to enable the capability of LSM6DSOX accelerometer to detect events like FreeFall, Single/Double Tap, WakeUp, Tilt and 6D orientation, also sending them to STBLESensor.
  • BLEMLC application, on the other hand, directly shows how to program the LSM6DSOX machine learning core. In particular, this sample programs the accelerometer to run an activity recognition algorithm or a vibration monitoring algorithm and to send the results to application. To enable the activity recognition algorithm on the MLC, you have to select the STBLESensor [Activity Recognition] tab. You can also work in debug mode using the STBLESensor debug console and writing the commands VibOn to initialize the vibration monitor algorithm, and VibOff to switch the vibration monitor algorithm off.

For debug purposes, as side feature, note also that both BLELowPower and BLEMLC applications enables the USB Virtual Com Port (VCP) to visualize printf to a Terminal (for example Tera Term) to control the initialization and connection phases and, at the boot, to define the name the STEVAL-MKSBOX1V1 will use for Bluetooth advertising. To enable the VCP, it is necessary to recompile the code, enabling the compilation define called STBOX1_ENABLE_PRINTF at the beginning of the BLELowPower/Inc/STBOX1_config.h or the BLEMLC/Inc/STBOX1_config.h file.

1579.png

6. Pro-mode (Mode 3) expanded - merging ST.box and Unicleo-GUI

This paragraph presents the DataLogExtended sample application. This pro-mode firmware pack implements the dialog (via USBD Virtual Com Port) with the Unicleo-GUI running on a PC connected via USB to the ST.box eval board, visualizing all the sensor data streamed from the board.

In these way all the Unicleo-GUI features described in this past post apply also to SensorTile.box platforms, allowing the user to go deep to ST.box feature. For example, it is possible to exploit all the DSOX features such as the FSM and the MLC digital features.

1580.png
1581.png

Version history
Last update:
‎2021-07-29 08:44 AM
Updated by: