LSM6DSL does not behave as expected in FIFO continous mode
Hi Everyone,
I am Using the L6MSDL chip for my application (connected to a STM32L4) in FIFO Continuous Mode and I am having some troubles understanding the FIFO pattern that we can read in FIFO_STATUS3 register.
I configured the LSM6DSL The following way :
- Accelerometer ODR = Gyroscope ODR = FIFO ODR = 413 Hz
- No decimation
- Only accelerometer and gyroscope data sets are stored in fifo
- BDU Block Update is enabled
- FIFO Is in continuous mode
I read periodically what is stored in FIFO. To know how much data is stored, I read the FIFO_STATUS1 and FIFO_STATUS2 registers. I make sure to read a multiple of 6 data sets each time (3 gyroscope data and 3 accelerometer data)
I read fast enough so no data is overwritten in fifo. I verify that by checking the overrun status.
My problem is that the pattern that I read from FIFO_STATUS3 is not always equal to 0, even though I read a multiple of 6 data sets each time.
This result in my data sets not being aligned correctly as it should be(X_GYROSCOPE, Y_GYROSCOPE, Z_GYROSCOPE, X_ACCELEROMETER, Y_ACCELEROMETER, Z_ACCELEROMETER).
I tried reading the FIFO_STATUS3 and resetting the FIFO if the pattern value is different then 0, but my data are sometimes not aligned correctly.
Is there any reason why the pattern changes in my case?
Is there any way to ensure that data are always correctly aligned before reading from fifo?
I hope my message is clear.
Thank you.
