LSM6DS3 FIFO data corruption on random basis.
Hi everyone!
I am using LSM6DS3 in a very simple setup: For the debugging purposes I am only using accelerometer, ODR is set at 416Hz, fifo is enabled in continuous mode and set at the same freq, no decimation. Only XL data is set to be stored in fifo.
I am reading data from fifo every second while buffer is constantly being filled. In random intervals the data I am reading gets corrupt in different ways:
- One axis data is simply missing (even reading the pattern confirms that there is an entry missing)
- Value from one axis is read out at another axis (pattern) (e.g. if device is standing still on the table, and normal reading is 10,10,-990, one of the readings can be -990,10,-990 or 10,10,10, while pattern values are always 0,1 and 2.
- Sometimes it even happens that the pattern is an invalid value (>2).
I have tried reading values in a numerous ways (reading fifo_status 1,2,3,4 and then fifo L and fifo H) and all possible combination of those. I have also tried reading whole fifo in a single shot, but regardless of the reading method the same problems are appearing. The errors appear randomly, sometimes a every few seconds, sometimes I have to wait for a few minutes. I have tried changing clock (from 100kHz to 300kHz), adding delays between reads, but nothing helps.
I have confirmed readings on a scope with I2C decoder so I am pretty sure that everything I read is actually sent from the LSM6DS3. Signals are clean, scope is not detecting any I2C errors at all.
My config (read from the chip):
CTRL9_XL = 0x38
CTRL1_XL = 0x60
FIFO_CTRL1 = 0x00
FIFO_CTRL2 = 0x00
FIFO_CTRL3 = 0x01
FIFO_CTRL4 = 0x00
FIFO_CTRL5 = 0x36I am aware that my case is somehow similar to this one: https://community.st.com/s/question/0D50X00009hmIZiSAM/lsm6dsl-fifo-data-set-corrupted
I have spent a whole week on this problem but I am not making any progress. I would really appreciate any hint that would bring me closer to the solution of this problem.
Best regards,
Matic
