Skip to content

drivers/imu/bmi270: Improved and extended BMI270 drivers. - #1164

Open
easytarget wants to merge 1 commit into
micropython:masterfrom
easytarget:bmi270-drivers
Open

easytarget wants to merge 1 commit into
micropython:masterfrom
easytarget:bmi270-drivers

Conversation

@easytarget

Copy link
Copy Markdown

Summary

Two drivers for the popular BMI270 IMU


The first replaces the existing bmi270 driver with a updated version using a much smaller device configuration and timings. This results in a 'drop in' replacement driver that is 25x faster to load and 5x smaller in size.

  • The existing driver loads a 8Kb 'full configuration' during init via I2C with extremely conservative timings, taking over 2 seconds to load.
  • This new version now uses a minimal (340b) configuration with an improved uploader which respects the Bosch specified timings, and can upload partial config fragments.
  • These 'device configurations' are actually the ASIC firmware for the sensor unit; Bosch provide several different public configurations with feature sets for specific scenarios.

In addition this version of the driver has been extended to allow sensor scaling and data rates to be adjusted after init.

  • The device powersave modes can also now be set.
  • It also and exposes the internal temperature sensor.

The second is a a greatly extended bmi270_legacy driver; this uses the 'legacy' device config from Bosch.

  • This has all the features of the basic driver
  • Adds many Tablet and Phone related features:
    • Orientation, Motion, Drop detection, Step counting, Tap detection and more.
    • Allows setting and detecting interrupts based on the above features
  • It is larger than the original driver but due to improved upload timings still has a fast init() time.

Both drivers have extensive in-line documentation; dedicated examples and extended README files

This is based on the work I did earlier this year here: https://codeberg.org/easytarget/bmi270-micropython

Testing

Both of these drivers have been extensively tested during development on a M5Stack Tab5 (ESP32P4 based) which has a BMI270 device on board.

Generative AI

I did not use generative AI tools when creating this PR.

Replaces existing `bmi270` driver with a version using the a much smaller
device configuration loaded using improved timings. This results in a
drop in replacement driver that is 25x faster to load and 5x smaller
in size.

The driver has been extended to allow sensor scaling changes and
data rates to be adjusted after init, powersave modes to be set,
and exposes the internal temperature sensor.

An additional `bmi270_legacy` driver is also included; this uses the
full 'legacy' device config from Bosch and brings access to many
Tablet and Phone related features: orientation, drop detection, step
counting, tap detection and more.

Signed-off-by: Owen <owen@easytarget.org>
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