@@ -21,6 +21,10 @@ This example shows how to use the `espp::Bmi270` component to initialize and com
2121 - [ Debug Tips] ( #debug-tips )
2222 - [ Performance Notes] ( #performance-notes )
2323 - [ Advanced Features] ( #advanced-features )
24+ - [ Data Ready Interrupt] ( #data-ready-interrupt )
25+ - [ Fast Offset Compensation (FOC)] ( #fast-offset-compensation-foc )
26+ - [ Component Re-Trim (CRT)] ( #component-re-trim-crt )
27+ - [ Built-in Features] ( #built-in-features )
2428 - [ References] ( #references )
2529
2630<!-- markdown-toc end -->
@@ -32,6 +36,8 @@ This example shows how to use the `espp::Bmi270` component to initialize and com
3236- ** Orientation Filtering** : Both Kalman and Madgwick filter implementations
3337- ** Real-time Data Logging** : CSV format output suitable for plotting
3438- ** Interrupt Configuration** : Data ready and motion detection interrupts
39+ - ** Fast Offset Compensation (FOC)** : Calibrate accelerometer and gyroscope offsets
40+ - ** Component Re-Trim (CRT)** : Compensate for gyroscope sensitivity changes
3541- ** Advanced Configuration** : Performance modes, bandwidth settings, power management
3642
3743## How to use example
@@ -187,6 +193,16 @@ The CSV output can be imported into analysis tools like:
187193- Consider magnetometer integration for yaw correction
188194- Check for temperature effects
189195
196+ ** Stack Overflow during Initialization** :
197+ - Device crashes or resets while calling ` bmi270.init() ` .
198+ - Uploading the configuration file uses a large stack buffer by default.
199+ - Reduce the burst write size in the configuration to limit stack usage.
200+ ``` cpp
201+ espp::Bmi270::Config config;
202+ config.burst_write_size = 128 ; // Use 128-byte chunks (default 0 = one chunk of config_file_size bytes, e.g. 8192)
203+ espp::Bmi270 imu (config);
204+ ```
205+
190206### Debug Tips
191207
1922081. **Enable verbose logging:**
@@ -218,7 +234,48 @@ The CSV output can be imported into analysis tools like:
218234
219235## Advanced Features
220236
221- The example can be extended to demonstrate:
237+ ### Data Ready Interrupt
238+
239+ The BMI270 can be configured to generate an interrupt when new data is available. This is more efficient than polling the sensor.
240+
241+ ``` cpp
242+ std::error_code ec;
243+
244+ Imu::InterruptConfig int_config{
245+ .pin = Imu::InterruptPin::INT1,
246+ .output_type = Imu::InterruptOutput::PUSH_PULL,
247+ .active_level = Imu::InterruptLevel::ACTIVE_HIGH,
248+ .enable_data_ready = true
249+ };
250+ imu.configure_interrupts(int_config, ec);
251+ ```
252+
253+ ### Fast Offset Compensation (FOC)
254+
255+ FOC allows for quick calibration of the accelerometer and gyroscope offsets.
256+
257+ ``` cpp
258+ // Accelerometer FOC (e.g., device flat on table, Z axis pointing up)
259+ Imu::AccelFocGValue accel_foc_target = {
260+ .x = 0, .y = 0, .z = 1, .sign = 0 // 1g on Z axis
261+ };
262+ imu.perform_accel_foc(accel_foc_target, ec);
263+
264+ // Gyroscope FOC (device must be stationary)
265+ imu.perform_gyro_foc(ec);
266+ ```
267+
268+ ### Component Re-Trim (CRT)
269+
270+ CRT is a feature to compensate for sensitivity changes in the gyroscope that may occur during assembly or over time.
271+
272+ ``` cpp
273+ imu.perform_crt(ec);
274+ ```
275+
276+ ### Built-in Features
277+
278+ The BMI270 also supports several on-chip features that can be demonstrated by extending this example:
222279
223280- ** Motion Detection** : Any motion, no motion, significant motion
224281- ** Step Counting** : Pedometer functionality
0 commit comments