2025-03-07 3:14 AM - last edited on 2025-03-07 4:05 AM by Peter BENSCH
Hi Team,
We are working with the LSM6DSOX sensor and integrating it with two different MCUs: nRF5340 and ATSAMD51, using the I2C communication protocol. We have been able to successfully read the device ID, accelerometer data, and gyroscope data. Additionally, we've implemented our own logic for step detection and step counting.
Recently, we learned about the Machine Learning Core (MLC) feature, which provides useful capabilities like detecting activity states (idle, walk, run). We obtained the .ucf file for MLC, used the UNICO tool to generate the corresponding .h file, and attempted to integrate it into our application. We followed the documentation and tried monitoring the MLC_STATUS (0x70) register to track activity states.
Challenges faced:
First Attempt with nRF5340 MCU: Initially, we tested the MLC functionality with the nRF5340 MCU using I2C communication. However, when we read the MLC_STATUS register, we consistently received 0x00, no matter the movement or activity. Despite testing different motions, there were no changes in the register output.
Currently Testing with ATSAMD51 MCU: After facing the issue with the nRF5340, we decided to try the same MLC configuration with the ATSAMD51 MCU. After writing the generated .h conf file to the device using i2c_burst_write, we continuously monitor the MLC_STATUS (0x70) register. However, we consistently receive a value of 0x02, even when there is no movement or when attempting to walk or run. The value remains unchanged, which suggests that the activity state isn’t being updated correctly.
We would greatly appreciate any guidance or troubleshooting steps to resolve this issue, particularly in regard to:
Proper configuration of the MLC functionality on both MCUs.
The correct sequence of operations for initializing and monitoring the MLC_STATUS register.
Any additional steps or considerations to ensure the MLC feature works as expected on both platforms.
Thanks,
Ilam
2025-03-10 3:55 PM
Use MEMS Studio MLC debug to inject data from your logs and check that the output is correct (see attached screenshot)
This is assuming that MLC configuration is correct. To generate a valid configuration, again use MEMS Studio MLC tool and follow these steps (you can use MEMS Studio for all steps):
- collect multiple data logs for each class you want to identify
- clean up the logs by extracting the representative segments for each class, and discarding the irrelevant segments, typically one discards the beginning and end of the log and keep the central portion which is related to the class
- load and label the clean logs in the MLC tool
- configure the digital filters and select the relevant features (or use the AFS, automatic feature selection)
- design the decision tree and check the performance (confusion matrix, etc)
- generate the configuration file to be utilized later for sensor configuration