cancel
Showing results for 
Search instead for 
Did you mean: 

Burst Reading the LSM6DSM FIFO

Tyler Gilbert
Associate II

I am reading the LSM6DSM FIFO with the accel and gyro enabled. I burst read 12 bytes using the SPI. One output byte to say to read the fifo then 12 input bytes (6 bytes of accel and 6 bytes of gyro). That works great.

I tried reading more than 12 bytes using this method and it didn't seem to work. According to the rounding description in en.DM00352102, I should be able to burst read the entire FIFO (though the docs aren't 100% explicit about this). Am I doing something wrong or does the FIFO need to be read one frame at a time?

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @Tyler Gilbert​ , if I well understood the problem... yes, you can read the entire FIFO in burst mode. When for example the INT1_FULL_FLAG (i.e. the FIFO full flag interrupt on INT1) is raised, the FIFO is full and you can start to read all the data inside it. in FIFO_CTRL5 register you have to set the FIFO mode (Bit 2:0 --> 110), which means "stop collecting data when FIFO is full". Check also if you maybe enabled STOP_ ON_FTH bit of FIFO_CTRL4 register, which allows limiting the FIFO depth to the watermark level.

Tyler Gilbert
Associate II

@Eleon BORLINI​ I was able to get it to work (bug on my end). Thanks for confirming. It would be nice if the docs were more explicit about it (especially the datasheet) and explained the procedure for burst reading the entire FIFO.