Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Can not perform BMI270 manual SENS error compensation (not CRT)

    Can not perform BMI270 manual SENS error compensation (not CRT)

    DusKing
    New Poster

    Hello, I'm trying to add the ability to perform manual SENS error calibration to a 3rd party BMI270 driver I wrote myself. But when I write the 11-bit FxP data to GYR_GAIN_UPD_1 GYR_GAIN_UPD2 GYR_GAIN_UPD_3, BMI270 seems to lose its response.

    The specific driver code can be found here: https://github.com/flightng/atbetaflight/blob/add-gyro-scaler-calibrator/src/main/drivers/accgyro/ac...

    Given that tech support probably won't look at my driver code, in this case I'd like to know:
    - What is the correct timing/sequence to perform a manual SENS error calibration? In what order should I step through the registers?
    - When writing 16-bit data to any single register at address 0x34 - 0x3A, should the high or low bits of the 16-bit data be sent first?

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hi DusKing,

    You can refer to "Manual SENS Error Compensation" process described in BMI270 data sheet in Section 4.14 to configure registers, or refer to the code implementation of the following code in the sensor API.
    int8_t bmi2_set_sensor_config(struct bmi2_sens_config *sens_cfg, uint8_t n_sens, struct bmi2_dev *dev)
    {
    ...
    /* Set gyroscope user gain configuration */
    case BMI2_GYRO_GAIN_UPDATE:
    rslt = set_gyro_user_gain_config(&sens_cfg[loop].cfg.gyro_gain_update, dev);
    break;
    ...
    }

    Thank you for your reply. I carefully checked the data sheet and SDK, I think my problem may mainly appear in the read and write timing of these 16-bit registers. Suppose I want to write a 16-bit data to 0x3A by 4-wire SPI interface, the high half bit is H and the low half is L, so which of the following is the correct writing sequence?
    - W3A+H+L
    - W3A+L+H
    Similarly, which should the correct reading sequence for the same 16-bit register?
    - R3A+Dummy+H+L
    - R3A+Dummy+L+H

    Looking forward to your reply

    BSTRobin
    Community Moderator
    Community Moderator

    Hi DusKing,

    According BMI270 SPI part description, you need to configure host SPI timing with '00' or '11' mode.

    BMI270 SPI timing.png

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist