2023-05-05 03:12 AM
MLC was working and suddenly stopped working , checked all the registers related to MLC and all the writes and read were happening properly.
Even tested accelerometer data in the same state and it was also working fine.
My device gets powered on using coin cell battery and after draining out the power , MLC started working (power dissipation in this scenario was much high than the normal scenario)
2023-05-08 04:49 AM
Hi @niccolo.ruffini
I tried to write BOOT bit also, first time it worked and after multiple writes MLC stopped working and giving out results.
One more query, I am checking the MLC enable register after writing the data from h file generated from UCF file, and it says the MLC is disabled after the write.
I had to add MLC enable write in LSM6DSOX_EMB_FUNC_EN_B register once more.
2023-05-08 04:54 AM
Now I am not really sure when the MLC is working and in what scenarios its not.
Because there`s no reliable behavior of the MLC.
Its really hard to fix on the scenarios.
Would really need help in making the MLC work reliably.
2023-05-08 05:03 AM
what are the writes you are referring to, that make the MLC stop working?
regarding the EMB_FUNC_EN_B register, please, make sure that you have selected the right page setting the FUNC_CFG_ACCESS right?
it happens that registers are read incorrectly because the page is different =)
Niccolò
2023-05-08 05:08 AM
Yeah I am selecting the right page settings in the FUNC_CFG_ACCESS.
If you want I can show you the complete configuration code of the MLC.
You can point out the mistake if I am making any.
Reliability is a major issue right now.
2023-05-08 05:25 AM
It would be more helpful to understand what is the issue that gets the MLC stuck.
that would be the turning point to find the solution, so try to get in a situation wher the MLLC works and you are able to read both mlc output and sensor data.
then, some ideas on what to investigate:
1) check whether it is a timed issue (always stops after the same amount of time), or not.
2) check whether there is a fixed number of read before the mlc gets stuck.
3) do you perform any read/write operation? if so, check the state of the MLC before and after each one of these to be sure it does not turn off for whatever reason
4) are you using a MLC network downloadable from ST.com? (a custom network can be problematic if it has some issues itself)
5) if you can work in debug mode try to use a breakpoint when the MLC is stuck to understand if the issue is at the lsm6dsox_all_sources_get or at the lsm6dsox_mlc_out_get, or maybe in some other line
sorry for the multiple questions, but this behavior is very strange
Niccolò
2023-05-08 05:38 AM
2023-05-08 06:12 AM
thank you, so the MLC does not respond as before, now I understand what it meant.
the only thing that can pose a problem in your code seems to be the RTOS implementation, that usually can stop or trigger some events that are in conflict with the normal operations.
anyway, if the mlc begins working, and then stops, you should try to understand the reason why it happens.
you can refer to the questions in my previous answer to follow the main steps to understand where the problem resides.
Niccolò
2023-05-08 07:27 AM
Ok @niccolo.ruffini
The code sequence looked ok to you which I shared?
I`ll try to debug more on this.
2023-05-08 09:09 AM
in the sequence there are some lines that I don't fully understand, like the fact that you activate the pedometer and the wake up interrupt, but I think you turn them on for some reasons regarding your goal.
otherwise it seems fine enough to not cause the problem you see.
Let me know if you find something =)
Niccolò
2023-05-09 04:10 AM
Hi @niccolo.ruffini
One more issue that I wanted to report regarding the MLC functionality.
The power consumption gets stuck around 300uA when MLC is enabled and doesn't goes back to original power even if you disable the MLC functionality.