Skip to main content
Visitor
Nov 25, 2026 1:34 PM UTC
Question

LSM6DS33 FIFO timestamp appears 256 ticks early at low-byte rollover

Hello,

I see a reproducible timestamp anomaly in the dataset that the LSM6DS33 stores in its FIFO, and I would like to know whether it is a known behaviour and how to mitigate it.

SETUP
- LSM6DS33 on a Pololu Romi 32U4 control board (INT1/INT2 not connected), read by a Raspberry Pi 4 over I2C (Linux).
- Accel and gyro at 104 Hz, timestamp at 25 us resolution, FIFO stores gyro, accel and timestamp/step datasets (18-byte frames, one each per ODR).
- Register configuration (written after SW_RESET, resolution set before TIMER_EN):
    CTRL1_XL  = 0x40    CTRL2_G     = 0x48    CTRL3_C   = 0x44 (BDU, IF_INC)       CTRL4_C   = 0x00
    CTRL9_XL  = 0x38    CTRL10_C    = 0x3C    WAKE_UP_DUR = 0x10 (TIMER_HR)
    TAP_CFG   = 0xC0    FIFO_CTRL1 = 0x00  FIFO_CTRL2  = 0x80    FIFO_CTRL3  = 0x09
    FIFO_CTRL4 = 0x08   FIFO_CTRL5  = 0x26 (continuous, 104 Hz)
- The timestamp counter is reset (0xAA to TIMESTAMP2_REG) while the FIFO is in bypass, and periodically before it saturates.
- Timestamp decoded as unsigned, byte order per AN4682 table 54: middle, high, unused, low, step L, step H.

SYMPTOM
In the captures below, an isolated timestamp with low byte 0x00 is preceded by a short interval and followed by a long interval. Together the two intervals span approximately two ordinary periods. The usual spacing in this setup is about 392 ticks.

  frame n-1:  EC 5A 00 78 00 00  -> 0x5AEC78
  frame n  :  ED 5A 00 00 00 00  -> 0x5AED00   (interval 136 ticks)
  frame n+1:  EF 5A 00 87 00 00  -> 0x5AEF87   (interval 647 ticks)

If the middle timestamp was captured one low-byte carry early, 0x5AED00 would instead be 0x5AEE00. Adding 256 ticks to the middle value yields intervals of 392 and 391 ticks, consistent with the surrounding cadence. This suggests a missed carry as one possible explanation.

CHECKS PERFORMED
- Raw bytes. Decoding the captured bytes independently gives the same timestamps shown above
- Stopped-FIFO test. I programmed FIFO_CTRL5 = 0x21, CTRL4_C = 0x01 (STOP_ON_FTH), FIFO_CTRL1 = 0x00, and FIFO_CTRL2 = 0x89. The programmed threshold was 2,304 words. I have observed stable FULL at 2,295 words, equivalent to 255 complete frames, and confirmed EMPTY after draining, with no overrun reported. The anomaly occurred inside the drained batches.
- Read sizes. I have observed 2 candidates in 83,385 stopped-FIFO frames using one 18-byte read per frame, and 1 in 74,205 frames using nine 2-byte reads per frame. The point of origin remains open, including timestamp capture, FIFO readout, and I²C transport.
- I2C corruption: in FIFO order the middle byte is transferred before the low byte, so a bus error cannot depend on the low byte being 0x00. The error seems to arise when the timestamp is written into the FIFO.
- Startup order: resolution is configured before TIMER_EN, and the sensors are started before timestamp batching, as recommended in the LSM6DS33 FIFO thread linked below.
 

HOW TO REPRODUCE and QUESTIONS
1. Apply the configuration above and run the FIFO in continuous mode at 104 Hz (or in FIFO mode as described above).
2. Read complete 18-byte frames and decode the timestamp dataset.
3. Within three consecutive frames in the same timestamp epoch, look for a middle timestamp whose low byte is 0x00, whose incoming interval is about 256 ticks short, and whose outgoing interval is about 256 ticks long. Check that adding 256 to the middle value brings both intervals back near the observed cadence.
 

A similar numerical pattern on a different part. ST’s reply discusses that part’s fourth FIFO dataset configuration:
https://community.st.com/mems-sensors-48/lsm6dsm-timestamp-in-fifo-occasionally-incorrect-166217
LSM6DS33 FIFO timing thread:
https://community.st.com/mems-sensors-48/lsm6ds33-fifo-continous-mode-bad-time-values-69215
 

QUESTIONS
1. Is this a known limitation (erratum) of the timestamp capture into the FIFO on the LSM6DS33?
2. Is there a configuration that avoids it, for example a different timestamp resolution, decimation or batching trigger?
3. Under what conditions, if any, can ST confirm that a +256-tick correction recovers the actual timestamp for this signature? Can the converse signature occur, with low byte 0xFF and a timestamp that appears 256 ticks too large?
4. Is this fixed in newer parts (e.g. the LSM6DSO family)?
 

Thank you.