cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSO FSM implementation example with the mbed library

CQuin.1
Associate II

Is there an example for how to implement an FSM using the mbed library? I found an example FSM on GitHub that I would like to try, but I'm not sure how to implement with the mbed library. Links below.

https://os.mbed.com/teams/ST/code/HelloWorld_IKS01A3//file/f9a18e31c9d4/main.cpp/

https://github.com/STMicroelectronics/STMems_Finite_State_Machine/tree/master/application_examples/lsm6dso/Motion-Stationary%20detection

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @CQuin.1​ ,

I confirm you that the Github example uses the embedded finite state machine, but the (second) link you shared is based on the Unico procedure for the FSM configuration, and Unico works with STEVAL-MKI109V3 board.

To implement the C code that configures the I suggest you to use this other lsm6dso_fsm.c (in the lsm6dso example folder), that directly implements in C the LSM6DSO FSM registers settings.

If you are interested in using the IKS01A3 platform, you could base the general framework of your code on the previous file (that contains the platform-dependent functions for NUCLEO_F411RE + X_NUCLEO_IKS01A3 system) or the X-CUBE-MEMS1 firmware function pack: in this case you can find several examples based on the LSM6DSO device (even if not directly the FSM, for which you could use the above-suggested code (folder \Projects\STM32L476RG-Nucleo\Examples\IKS01A3).

Please let me know if these indications can help you and, in case, select this answer as best.

-Eleon