Skip to content

applications: gesture_recognition: use BMI270 FIFO batch mode#67

Draft
mbarchie wants to merge 1 commit intomainfrom
ncsdk-37898-gr-bmi270-fifo
Draft

applications: gesture_recognition: use BMI270 FIFO batch mode#67
mbarchie wants to merge 1 commit intomainfrom
ncsdk-37898-gr-bmi270-fifo

Conversation

@mbarchie
Copy link
Copy Markdown
Contributor

Switch IMU sampling from per-sample timer polling to FIFO watermark streaming (sensor_stream / RTIO) when CONFIG_IMU_FIFO_BATCH is set. The SoC sleeps while the BMI270 fills its FIFO and wakes only every 33 samples at 100 Hz, reducing CPU wake-ups by ~33x.

  • Add IMU_FIFO_BATCH Kconfig.
  • imu.c: RTIO streaming thread, decoder-based Q31-to-float conversion, and ring buffer for batch handoff to main loop. Shared sensor_attr_set calls extracted to imu_configure_sensor().
  • main.c: refactor sample processing into process_ready_imu_samples() to drain the ring buffer each wake; semaphore changed to K_SEM_MAX_LIMIT so no watermark events are lost.
  • DT overlays (LM20A, LM20B): add stream0 alias, irq-gpios, gpio1.
  • prj.conf (all LM20A/LM20B variants + Thingy53): enable BMI270 FIFO streaming, low-power filter mode, and RTIO dependencies.

@mbarchie mbarchie force-pushed the ncsdk-37898-gr-bmi270-fifo branch 2 times, most recently from ac80e0c to 244f45e Compare March 19, 2026 07:27
Switch IMU sampling from per-sample timer polling to FIFO watermark
streaming (sensor_stream / RTIO) when CONFIG_IMU_FIFO_BATCH is set.
The SoC sleeps while the BMI270 fills its FIFO and wakes only every
33 samples at 100 Hz, reducing CPU wake-ups by ~33x.

- Add IMU_FIFO_BATCH Kconfig.
- imu.c: RTIO streaming thread, decoder-based Q31-to-float
  conversion, and ring buffer for batch handoff to main loop.
  Shared sensor_attr_set calls extracted to imu_configure_sensor().
- main.c: refactor sample processing into process_ready_imu_samples()
  to drain the ring buffer each wake; semaphore changed to
  K_SEM_MAX_LIMIT so no watermark events are lost.
- DT overlays (LM20A, LM20B): add stream0 alias, irq-gpios, gpio1.
- prj.conf (all LM20A/LM20B variants + Thingy53): enable BMI270
  FIFO streaming, low-power filter mode, and RTIO dependencies.

Jira: NCSDK-37898

Signed-off-by: Bartosz Meus <bartosz.meus@nordicsemi.no>
@mbarchie mbarchie force-pushed the ncsdk-37898-gr-bmi270-fifo branch from 244f45e to c720b35 Compare March 19, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant