Skip to content

Add BMI160 and external BMM150 support for hardware 2.1.0 - #276

Open
TobiasRoeddiger wants to merge 2 commits into
mainfrom
codex/bmi160-bmm150-pcb
Open

TobiasRoeddiger wants to merge 2 commits into
mainfrom
codex/bmi160-bmm150-pcb

Conversation

@TobiasRoeddiger

@TobiasRoeddiger TobiasRoeddiger commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

This adds sensor support for OpenEarable hardware revision 2.1.0, which replaces the integrated BMX160 with a standalone BMI160 and an external BMM150 magnetometer.

  • Detect the standalone BMI160 at its alternate I2C address (0x69) during boot while retaining support for BMX160/BMI160 devices at 0x68.
  • Configure the external BMM150 through the BMI160 auxiliary I2C interface.
  • Decode the packed BMM150 samples correctly and apply the sensor factory-trim compensation.
  • Preserve the compensated BMM150 axis order consistently across hardware revisions; paired multi-pose measurements show that hardware 2.1 must not receive a separate Y/Z inversion.
  • Automatically report detected 2.1 hardware as at least 2.1.x when its stored revision is 2.0.x.
  • Persist 2.1.0 when the UICR hardware-revision field is blank; use a runtime revision floor for programmed 2.0.x values because UICR cannot change those bits without erasing the page.

The changes are intentionally limited to IMU/magnetometer support and hardware-version detection; audio/ADAU behavior is unchanged. BMM150 factory compensation is distinct from unit-specific hard-/soft-iron calibration, so no prototype-specific magnetic offsets are hard-coded.

Validation

  • Full firmware build succeeds for openearable_v2/nrf5340/cpuapp with nRF Connect SDK 3.0.1.
  • The original hardware-support revision was flashed successfully to the hardware 2.1.0 prototype through J-Link and boot-time detection selected the BMI160 at 0x69.
  • Captured eight stationary paired poses from a rigidly coupled hardware 2.0 BMX160 board and hardware 2.1 BMI160+BMM150 board, covering all six gravity directions plus yaw and a diagonal pose.
  • Accelerometer comparison found no axis permutation or sign inversion; the fitted relative mounting angle was about 3.2 degrees.
  • BMM150 factory-compensation output matches the Bosch-style reference calculation within 0.2 microtesla across the captured dataset, with stationary per-axis noise below about 1 microtesla.
  • Paired magnetic changes show matching BMM150 axis direction between the two assemblies, invalidating the earlier hardware-2.1-only Y/Z inversion.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

@github-actions

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.elf.zip
openearable_v2_fota.zip

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