Skip to main content
Visitor II
September 7, 2021
Question

LSM6DSO FIFO incorrectly fills with timestamp data when in Bypass-to-fifo mode with sensor hub enabled

  • September 7, 2021
  • 2 replies
  • 3230 views

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

    This topic has been closed for replies.

    2 replies

    ST Employee
    September 9, 2021

    Hi Calum @CBigg.1​ ,

    >> 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?

    This means that the sensors that are connected to the sensor hub (the LPS22HH pressure sensor in your case, for example when it exceeds some threshold) are not able to trigger the FIFO and to start it filling. You can only trigger the FIFO with the LSM6DSO(32) triggers. Which wake up event are you triggering with the LPS22HH?

    Did you also check the lsm6dso_sensor_hub_lps22hh.c Github example for having a benchmark for your code?

    -Eleon

    CBigg.1Author
    Visitor II
    September 9, 2021

    Hi Eleon,

    My trigger to start filling the FIFO is the LSM6DSO(32) wake up interrupt (intention is to generate an interrupt when the product experiences an impact - spike in acceleration).

    The sensor hub is set up to continuously read the LPS22HH, and my expectation was that the FIFO buffer on the LSM6DSO(32) would not actually start to fill until the internal wake up interrupt was generated.

    This is partially true.

    No pressure data is recorded in the FIFO buffer until the wake up interrupt BUT, the FIFO does start to fill with timestamp data.

    I believe that the timestamp data is being written into the FIFO before the wake up interrupt, due to the fact that the accelerometer has been set up to continuously poll the pressure sensor.

    If this is the case, is there a way that I can avoid this?

    Thanks for example link, but I believe have seen that one before.

    Many thanks

    Calum

    ST Employee
    September 13, 2021

    Hi Calum,

    so you want to avoid that the timestamps is stored in FIFO after the wakeup event?

    And do you receive only timestamps and not sensor data?

    -Eleon

    CBigg.1Author
    Visitor II
    September 13, 2021

    Hi Eleon,

    Timestamp data after the wakeup event is wanted.

    What I want to avoid is timestamps filling the FIFO BEFORE the wake up event.

    I do get sensor data but, as it stands the FIFO is not empty when the wake up event is generated.

    And the only data that is getting written into the FIFO BEFORE the wakeup event, is timestamps.

    Many thanks

    Calum