cancel
Showing results for 
Search instead for 
Did you mean: 

lsm6dsl FIFO DATA misaligned.

cdong
Associate

hi,

     we use one LSM6DSL sensor to read 3 axis acc FIFO data each second, but after some times, the FIFO out data become misaligned. 

the sensor setting is below:

  • XL_ODR_26HZ
  • Gyro disabled.
  • FIFO ODR = 26Hz
  • FIFO threshold (water mark) = 128
  • No decimation
  • BDU Block Update enabled
  • FIFO Is in continuous modewe have a timer to trigger to read FIFO data by Zephyr I2C(frequency: 100000bits/s) each second, before data reading, we check the numbers of FIFO by checking FIFO_STATUS1 and FIFO_STATUS2 register, then we read a multiple of 3 axis sets each time, for example if the FIFO data number has 78, we will read all FIFO data one time, if the number is 76 or 77, we only read 75 data one time. it can make sure reading data is complete 3-axis data. firstly, the reading data is the right like as (X_ACC, Y_ACC, Z_ACC). but after some time (the time is not fixed) the data will become (Y_ACC, Z_ACC, X_ACC). we don't know how to fix this issue. please help us.
1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @cdong ,

It happens when you miss some word fifo.
I suggest you always check the TAG position, after the tag there are 2 bytes per axis: X Y Z.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
Federica Bossi
ST Employee

Hi @cdong ,

It happens when you miss some word fifo.
I suggest you always check the TAG position, after the tag there are 2 bytes per axis: X Y Z.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Jacob WOODRUFF
ST Employee

Hi All,

 

This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.

 

Regards,
Jake

ST Support

what is the TAG position? do you mean we need to check pattern(FIFO_STATUS3 & FIFO_STATUS4) before reading FIFO?

Hi @cdong ,

For this product it is called FIFO_PATTERN, you can refer to par 8.4 of AN5040

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

thanks for your reply, but we found that, if we don't read FIFO immediately when the water mark is set, the pattern will become not right, and the data became misaligned. for example the pattern is 2, but reading data is right like as [acc_x, acc_y, aa_z]. because our product needs to read FIFO with one second interval, so when the water mark is set, our application didn't read pattern and FIFO at once. then the issue happened. 

my email is chun.dong@murata.com, you can directly contact me by email, because this issue has troubled us for a long time, thank you.