Tutorials

LSM6DSOX BDU: Find Torn Samples in Direct Register Reads

Published · Updated

A single impossible jump near a byte boundary is a reason to inspect how the two register bytes are read. Direct output-register reads can straddle a sensor update.

Walk through one low-byte/high-byte race

Handsfree scope probes on a circuit board.
Handsfree scope probes on a circuit board. Bench or board context. Photo by Sensepeek AB. Photo source · CC BY-SA 4.0

Suppose consecutive values are 0x00FF and 0x0100. If the low byte FF comes from the earlier sample and the high byte 01 from the later sample, the combined value is 0x01FF. It looks like a 256-count jump from the first value when the true step was one count.

ST documents the block data update bit in CTRL3_C. With BDU active, the addressed axis register pair is held while both bytes are read. Use an ordered burst with auto-increment configured as required and observe data-ready timing when coherent multi-axis acquisition matters. Read the register values back after any driver reset.

Choose a direct read test or record history in FIFO

Sample A: 0x00FF. Sample B: 0x0100. Low from A + high from B: 0x01FF (torn read)
Sample A: 0x00FF. Sample B: 0x0100. Low from A + high from B: 0x01FF (torn read).

For an isolated test, force a deliberately long interval between reads of a single axis pair and compare the raw bytes with a normal burst. Record ODR, bus rate and BDU readback. Inspect repeated samples and missed updates as separate observations. A fixed read delay in production remains sensitive to driver and clock changes.

BDU protects a pair from a torn read. It does not reconstruct measurements that elapsed while the host slept. For a history requirement, configure the FIFO and retain tag and overrun evidence. AN5272 also specifies reading FIFO_STATUS1 before FIFO_STATUS2 when BDU is on. The status order matters even if your data burst is correctly aligned.

When a suspicious value persists with a clean burst, compare the raw bytes at the bus and at the signed conversion routine. A byte-order bug, missing sign extension or a scaled value beyond the selected range can resemble a sensor fault.

Does BDU preserve the last 100 samples while the host sleeps?

BDU protects an output byte pair during a read. Use the FIFO and an overrun budget to preserve history.

Show the three-step exampleSample A: 0x00FF. Sample B: 0x0100. Low from A + high from B: 0x01FF (torn read)

Sample A: 0x00FF. Sample B: 0x0100. Low from A + high from B: 0x01FF (torn read).

LSM6DSOX device documentation · nRF52840 host documentation · FIFO watermark and service-time budget · Motion logger project and storage worksheet · Inspect board start-up and signal checks

Bring raw low/high bytes, CTRL3_C readback and a timing trace that includes data-ready and the read burst. Prepare an engineering review.

References

ST AN5272 Rev 5, section 4.4 and FIFO status order.

Back to Tutorials

Related evidence and next tasks

Continue the task with the relevant source scope. These reading paths do not establish interchangeability or current supply.

Source addresses and citation trail

Full source addresses are retained below. Read each citation with its document revision, page, table and applicability conditions above.

  1. https://commons.wikimedia.org/wiki/File:PCBite_handsfree_oscilloscope_probes_measuring_a_circuit_board.jpg
  2. https://creativecommons.org/licenses/by-sa/4.0
  3. https://www.st.com/resource/en/application_note/an5272-lsm6dsox-alwayson-3d-accelerometer-and-3d-gyroscope-stmicroelectronics.pdf