feat(bmi270): Implement FOC and CRT calibration features for bmi270 #595
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added Fast Offset Compensation (FOC) and Component Re-Trim (CRT) calibration
features to the BMI270 inertial measurement unit driver. These features provide
hardware-level offset and sensitivity calibration for both accelerometer and
gyroscope sensors.
Motivation and Context
BMI270 sensors experience manufacturing tolerance variations that affect
measurement accuracy. The built-in calibration features compensate for:
But espp/bmi270 doesn't support these feature.
Tested and verified against Bosch Sensortec's official BMI270 Sensor API library
implementation.
How has this been tested?
Using my esp32c3 based imu board, change example codes with calibration example.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
[BMI270 Example/I][0.306]: Starting example!
[BMI270 Example/I][0.316]: Found BMI270 at address: 0x68
[Bmi270/I][0.316]: Setting low power mode to disabled
[Bmi270/I][0.326]: Loading BMI270 configuration file (8192 B), this may take some time...
[Bmi270/I][0.546]: Configuration file loaded successfully
[Bmi270/I][0.546]: BMI270 initialized successfully
[BMI270 Example/I][0.546]: Performing Accelerometer FOC...
[Bmi270/I][4.396]: Accel FOC completed. Offsets: X=-10, Y=9, Z=2
[BMI270 Example/I][4.396]: Accelerometer FOC completed successfully
[BMI270 Example/I][4.396]: Performing Gyroscope FOC...
[Bmi270/I][10.806]: Gyro FOC completed. Offsets: X=-2, Y=-1, Z=0
[BMI270 Example/I][10.806]: Gyroscope FOC completed successfully
[BMI270 Example/I][10.806]: Performing CRT...
[Bmi270/I][10.856]: CRT: After setup GYR_CRT_CONF=0x05, bit3(rdy_for_dl)=0
[Bmi270/I][10.876]: CRT: Iter[0] GYR_CRT_CONF=0x05, bit3=0
[Bmi270/I][11.056]: CRT: Iter[9] GYR_CRT_CONF=0x05, bit3=0
[Bmi270/I][11.256]: CRT: Iter[19] GYR_CRT_CONF=0x05, bit3=0
[Bmi270/W][14.856]: CRT: Ready for Download bit didn't toggle - may still continue
[Bmi270/I][14.916]: CRT: Completion detected at iteration 0
[Bmi270/I][14.916]: CRT completed successfully
[BMI270 Example/I][14.916]: CRT completed successfully
Types of changes
Checklist:
Software
.github/workflows/build.ymlfile to add my new test to the automated cloud build github action.