I can't get the FIFO to work. The LSM6DSM is connected to a microcontroller via SPI. The sensor works fine when I use the status register and data registers to get the accel and gyro data.
But for higher ODR I want to use the FIFO to read the data in bursts of 10 data sets each. It looks like it would work properly, I do get the WaterM flag when there are 60 words in the FIFO and it takes the appropriate time for the flag to return after reading. But the data is useless. It is always the sate static data which has nothing to do with the actual sensor data.
The FIFO runs in continuous mode (110), FIFO ODR 6.66 kHz. Threshold is set to 60 (dec), accel and gyro are set to no decimation, 3rd and 4th data set are off as are all other options. I read FIFO_Status1 to check the WaterM flag and check FIFO_Status3 to see if the pattern is zero. Both accel and gyro run at the same ODR.
Reading is done by sending $BE (register $3B plus read bit) and then doing a read of 60 bytes. As I understood it the rounding function should kick in with this method?
But why do I get invalid data? It is always the same data every time I try to read from the sensor.