cancel
Showing results for 
Search instead for 
Did you mean: 

How to replicate shutdown behavior with wake-up via double tap as ALLMEMS1 firmware

Emanuel_S
Associate

Hello,

I'm working with SensorTile (STEVAL-STLKT01V1) and using the AI-SENSING1 firmware. I would like to replicate the energy saving behavior I observed in the ALLMEMS1 firmware: it goes into shutdown mode after a period of no connection and can be reactivated by a double tap event. In ALLMEMS1, this behavior happens automatically, but in AI-SENSING1, I am facing difficulties implementing this logic.

My question is: what specific steps should I follow to replicate the behavior of ALLMEMS1 in AI-SENSING1, or is there any example of implementing this shutdown with wake-up via double tap for AI-SENSING1? I would also need guidance on how to configure the timer so that the shutdown occurs automatically after a pre-determined time without connection.

Thanks in advance for any help or guidance.

1 ACCEPTED SOLUTION

Accepted Solutions
Salvatore Curti
ST Employee

Hello Emanuel,

In the last version of the ALLMEMS1 STEVAL-STLKT01V1 is not most supported.
The latest version of the ALLMEMS1 that including this harware is 4.2.0.
If you have that, in the file main.c there is this API: MCU_PowerSave
This API send the SensorTile in power mode save and, in this API, with EnableHWDoubleTap() enable double tap to wake up the module.

DO NOT DISABLE THE ACCELEROMETER as done in the MCU_PowerSave API.

That All.

regards,
Salvatore.

View solution in original post

3 REPLIES 3
Salvatore Curti
ST Employee

Hello Emanuel,

In the last version of the ALLMEMS1 STEVAL-STLKT01V1 is not most supported.
The latest version of the ALLMEMS1 that including this harware is 4.2.0.
If you have that, in the file main.c there is this API: MCU_PowerSave
This API send the SensorTile in power mode save and, in this API, with EnableHWDoubleTap() enable double tap to wake up the module.

DO NOT DISABLE THE ACCELEROMETER as done in the MCU_PowerSave API.

That All.

regards,
Salvatore.

Hello Salvatore,

Thanks for the answer!

I managed to locate the MCU_PowerSave function in version 4.2.0 of ALLMEMS1, as indicated, and I understood that it is responsible for putting the SensorTile in power saving mode and enabling double tap with the EnableHWDoubleTap() function.

However, I am facing difficulties in adapting this logic to the SENSING1 firmware (version 4.0.3). This is mainly due to significant differences in the structure and logic implemented in the main.c files of both firmwares.

In ALLMEMS1, the initialization sequence and the calling of APIs related to power management are well defined. In SENSING1, I notice that the execution flow is different, and it is not clear how or where to integrate a functionality equivalent to MCU_PowerSave.

I would like to know if there is any guidance or example to implement this functionality in SENSING1, respecting the particularities of the firmware.

Thank you in advance for your help!

Regards,
Emanuel

Hello Emanuel,

the firmware SENSING1 uses FreeRTOS (Real-time operating system for microcontrollers and small microprocessors), ALLMEMS1 uses classical infinite loop

I suggest you see FP-SNS-ALLMEMS2 firmware.

ALLMEMS2 is the same application of ALLMEMS1 but developed with FreeRTOS for power save management.

 

Regards,

Salvatore.