cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DS3 FIFO Corruption

MDSeon
Visitor

I am writing a custom linux driver module to be able to read accelerometer and gyroscope data from the LSM6DS3 FIFO in blocks.

I have set the fifo watermark to 512 words, ODR for accel, gyro and FIFO both set to 416Hz. Scale 8G and 250dps. As there is no interrupt line connected to our CPU, the driver polls the FIFO_STATUS2 register every 100ms to check if the FTH bit is set. When it is, it reads the FIFO_STATUS 1/2 to get the number of words in the FIFO, then reads the initial pattern# from FIFO_STATUS3/4. It then reads the entire FIFO in one read to improve efficiency over reading pattern# then 2 bytes FIFO in a loop. I make sure I only read the FIFO in a size that is a multiple of 12bytes (6 for gyro and 6 for accel) so full samples are read.

Often after a few seconds, there is missing data in the block from the FIFO. An example follows:

 

                    GYRO           ACCEL

                X    Y    Z     X    Y    Z

[66656.870916] 006c fd38 fffd  0054 0011 f039

[66656.870925] ffe5 fe05 ff68  0059 0010 f03d

[66656.870935] 001c fdb7 ffa2  005d 0007 f030

[66656.870945] 000a fdc8 ffaa  f044 0056 fd58

[66656.870954] ffdf 005a 0008  f03a 0041 fd6a

[66656.870964] ffc4 005a 0007  f02d 0049 fd87

[66656.870974] 0006 0065 0005  f02f 004f fd5b

[66656.870984] ffe1 0051 fff9  f031 002b fd90

 

After the 3rd line, the pattern changes (the device is sitting still on a table, so Z accel should read approx -1G). It appears that the data for X&Y axis of accelerometer data are missing in the 4th line.

 

What I am seeing is similar to the issue that was seen in this community post:

https://community.st.com/t5/mems-sensors/lsm6ds3-fifo-data-corruption-on-random-basis/td-p/270429

 

Does anyone know if there any solution or workaround that can applied to prevent this corruption?

0 REPLIES 0