LSM6DSO FIFO incorrectly fills with timestamp data when in Bypass-to-fifo mode with sensor hub enabled
Hello,
I am trying to implement some functionality that will fill the LSM6DSO(32)s FIFO buffer when a severe impact is detected. This is done by utilising the wake up interrupt with the slope filter enabled, when the sensor is in bypass-to-fifo mode. And it works very well when I am only recording acceleration and timestamp data.
However I also wish to record pressure data collected from the LPS22HH, by utilising the LSM6DSOs sensor hub configuration.
This is where things get odd.
I noticed that despite a severe impact not being detected, the FIFO buffer will start to fill with timestamp data. I have confirmed that the sensor is still in bypass mode, since I can still trigger the FIFO buffer to be filled by jolting the sensor. It's just that the first part of the FIFO is filled with timestamp information, and given enough time will completely fill it.
The rate at which the FIFO is filled, appears to be dictated by the sensor hub data rate and fifo timestamp decimation factor. I created a simple application to test this and it appears to support the theory. The simple firmware sets up the accelerometer to fill the FIFO on a severe impact, and cycles through various sensor hub data rates while tracking the time it takes for a fifo full interrupt to be generated without touching the board (FIFO is filled with just timestamp data). Here is a snippet of the output.
Set to 104 Hz, expect full buffer in around 2.62 mins
0:0:1: Test started
0:2:36: Interrupt detected!
Set to 52 Hz, expect full buffer in around 5.25 mins
0:2:37: Test started
0:7:48: Interrupt detected!
Set to 26 Hz, expect full buffer in around 10.5 mins
0:7:49: Test started
0:18:11: Interrupt detected!
I have attached the source file for this, which can simple be copied into a project to run on a Nucleo-F401RE board with the IKS01A3 expansion board. (to build and run, you will also need to grab driver files from here -> https://github.com/STMicroelectronics/lsm6dso/tree/ec52bc39c3aec7c03bf702c9b92698859fedae0f)
I have also confirmed that this behaviour is only seen when the FIFO is configured in the bypass-to-fifo mode. When in bypass mode only, I was unable to trigger the fifo full interrupt. So I'm assuming no timestamp data is being written.
After reading the application note on the LSM6DSO, I can see the following under the section about collecting timestamp (Auxiliary sensor) data in the FIFO.
"Auxiliary sensors cannot trigger a write in FIFO. Their registers are written when the first main sensor or the
external sensor event occurs (even if they are configured at a higher batch data rate)."
Does this mean that if I have the sensor hub enabled, I am unable to wait until the wake up event occurs to start filling the FIFO?
Or am I missing something in my configuration? (see attached c file)
Many Thanks
Calum
