Showing results for 
Search instead for 
Did you mean: 

LSM6DSOX: FIFO buffer not full when interrupt received.


Hey guys, I use a LSM6DSOX chip to collect data from both accelerometer and gyroscope. I used the integrated FIFO feature, with the following configurations:

  • Accelerometer/gyroscope batch ODR = 104Hz
  • FIFO mode is Continuous mode
  • Interrupt on INT2 is routed, triggered by FIFO full event

The codes follow the ST official repository: STMems_Standard_C_drivers/lsm6dsox_fifo.c at master · STMicroelectronics/STMems_Standard_C_drivers ( .

Different from the official doc based on polling, we enable hardware interrupt that is triggered every time the FIFO buffer is full. Whenever the MCU receives such an interrupt, it will read the number of remaining samples in the buffer (denoted by num) and retrieve them one by one orderly.

Ideally, num should always be 510 as the size of FIFO buffer equipped by LSM6DSOX is 512 samples. However, we find that num can be a bit random, sometimes being 510 while in other cases it can be 318, 198, etc. Please see the below figure that shows our serial port outputs. This is quite confusing as we should have followed the instructions on the datasheets.

0693W00000Y9IyXQAV.pngWe further checked whether there're other sources at the INT2 interrupt line, and the answer is no. We also calculated the actual ODRs for different num values, and have proved that the ODRs are all 104Hz. We also tried different FIFO batch ODRs, and found that the situation disappears using smaller ODR (such as 52Hz), while becoming the same serious with higher ODRs (such as 208Hz). Note that the sensor ODR is always higher than the batch ODR.

Really appreciate if anyone can provide some opinions about this! Although this is a prototype for now, it's very likely that later we'll need a large number of iNEMO sensor chips.