Skip to content

fix(drivers/bmi270): correct FIFO watermark byte calculation#27875

Open
IgorKolesnikov wants to merge 1 commit into
PX4:mainfrom
IgorKolesnikov:IgorKolesnikov/bmi270-fifo-watermark-fix
Open

fix(drivers/bmi270): correct FIFO watermark byte calculation#27875
IgorKolesnikov wants to merge 1 commit into
PX4:mainfrom
IgorKolesnikov:IgorKolesnikov/bmi270-fifo-watermark-fix

Conversation

@IgorKolesnikov

Copy link
Copy Markdown

FIFO_WTM was computed as samples * sizeof(FIFO::Data), sizing the threshold from a single sensor's 6-byte frame instead of the actual 13-byte combined accel+gyro frame (1 header + 6 gyro + 6 accel) the FIFO actually stores. This made the watermark interrupt fire at the wrong byte count, so the published gyro_fifo rate and sample count no longer matched IMU_GYRO_RATEMAX.

E.g. with IMU_GYRO_RATEMAX = 400 (expected: 4 samples per FIFO batch at 1600 Hz ODR -> 400 Hz publish), the driver instead published gyro_fifo at 600 Hz with 3 samples per batch.

@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. scope:drivers Device drivers and hardware interfaces. scope:sensors Sensor pipeline, calibration, voting, or sensor validation. labels Jul 12, 2026
FIFO_WTM was computed as samples * sizeof(FIFO::Data), sizing the
threshold from a single sensor's 6-byte frame instead of the actual
13-byte combined accel+gyro frame (1 header + 6 gyro + 6 accel) the
FIFO actually stores. This made the watermark interrupt fire at the
wrong byte count, so the published gyro_fifo rate and sample count
no longer matched IMU_GYRO_RATEMAX.

E.g. with IMU_GYRO_RATEMAX = 400 (expected: 4 samples per FIFO
batch at 1600 Hz ODR -> 400 Hz publish), the driver instead
published gyro_fifo at 600 Hz with 3 samples per batch.
@IgorKolesnikov IgorKolesnikov force-pushed the IgorKolesnikov/bmi270-fifo-watermark-fix branch from c85bb1c to e5c6cea Compare July 12, 2026 14:17
@farhangnaderi

farhangnaderi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

second opinion from @dirksavage88 before we merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. scope:drivers Device drivers and hardware interfaces. scope:sensors Sensor pipeline, calibration, voting, or sensor validation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants