Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 initialisation problem

    BMI270 initialisation problem

    victorheca01
    Established Member

    victorheca01_0-1689009625703.png

    Hi, All,

       This is the initialisation flowchart in the datasheet of BMI270. However, in the sourcecode of bmi2.c, there is no command send to register 7c and 59 before  rslt = write_config_file(dev), why? Thanks in advance.

    3 REPLIES 3

    victorheca01
    Established Member

    victorheca01_0-1689009936978.png

    btw, my datasheet is version 1.4.

    Minhwan
    Community Moderator
    Community Moderator

    Hi Victor, 

     

    First, please keep your datasheet as latestone. Right now is 1.5 🙂 

    Back to your question, we did all processes for configuration download in our API. 

    When you check write_config_file, first thing we do is 

    rslt = bmi2_set_adv_power_save(BMI2_DISABLE, dev);

    You can chec that we control 0x7C register inside. 0x59 is same in rslt = set_config_load(BMI2_DISABLE, dev);

    Thank you. 

    Thank you very much. The following is the code in file of accel_gyro.c. As you can see write_config_file() is called in bmi270_init() which is before bmi270_sensor_enable() is called, while in bmi270_sensor_enable() ,  bmi2_set_adv_power_save() is called. 

    does it mean my baseline software of bmi270 is wrong?

    {
    /* Status of api are returned to this variable. */
    int8_t rslt;

    /* Variable to define limit to print accel data. */
    uint16_t limit = 10000;

    /* Assign accel and gyro sensor to variable. */
    uint8_t sensor_list[2] = { BMI2_ACCEL, BMI2_GYRO };

    /* Sensor initialization configuration. */
    struct bmi2_dev bmi2_dev;

    /* Create an instance of sensor data structure. */
    struct bmi2_sens_data sensor_data = { { 0 } };

    /* Initialize the interrupt status of accel and gyro. */
    uint16_t int_status = 0;

    uint8_t indx = 1;

    float x = 0, y = 0, z = 0;
    int16_t angle_speed;

    /* Interface reference is given as a parameter
    * For I2C : BMI2_I2C_INTF
    * For SPI : BMI2_SPI_INTF
    */
    rslt = bmi2_interface_init(&bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    /* Initialize bmi270. */
    rslt = bmi270_init(&bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    if (rslt == BMI2_OK)
    {
    /* Accel and gyro configuration settings. */
    rslt = set_accel_gyro_config(&bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    if (rslt == BMI2_OK)
    {
    /* NOTE:
    * Accel and Gyro enable must be done after setting configurations
    */
    rslt = bmi270_sensor_enable(sensor_list, 2, &bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    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