Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    ASIC initialization fails on BMI270 Shuttle Board 3.0 with NRF52832 Development kit

    ASIC initialization fails on BMI270 Shuttle Board 3.0 with NRF52832 Development kit

    Srisurya
    New Poster

    Hi, 

    I am using NRF52832 with BMI270 Shuttle Board 3.0. I am able to read Chip ID Register correct value 0x24. With this I confirmed that I2C is working fine between the NRF & BMI. But now When I load the Config file successfully onto the BMI using Bosch BMI270 Library without any modifications, after minimum of 150ms, still the internal register of the BMI270 reads 0x00 which means ASIC is not initialized when internal status register read is done. I have tried with multiple read_write_lens, played with delays inbetween read writes etc.

    I am attaching the Files which i used to connect the I2C in common.c. And the Config write is same as bmi2.c. Here is my main.c code.

     

    /*For I2C on BMI270, Pull CS - HIGH, SDO - LOW */
    /* Set INT1 & INT2 as INPUT */
    nrf_gpio_cfg_output(BMI_SDO);
    nrf_gpio_cfg_output(BMI_CS);
    nrf_gpio_pin_clear(BMI_SDO);
    nrf_gpio_pin_set(BMI_CS);
    nrf_gpio_cfg_input(BMI_INT1, GPIO_PIN_CNF_PULL_Pullup);
    nrf_gpio_cfg_input(BMI_INT2, GPIO_PIN_CNF_PULL_Pullup);

    /* Status of api are returned to this variable. */
    int8_t rslt;
    /* Variable to define limit to print accel data. */
    uint8_t limit = 20;
    /* Assign accel sensor to variable. */
    uint8_t sensor_list = BMI2_ACCEL;
    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. */
    uint16_t int_status = 0;
    uint8_t indx = 0;
    float x = 0, y = 0, z = 0;

    rslt = bmi2_interface_init(&bmi2_dev, BMI2_I2C_INTF);
    bmi2_error_codes_print_result(rslt);
    nrf_delay_ms(500);

    /* Initialize bmi270. */
    printf("BMI270 Init\r\n");
    rslt = bmi270_init(&bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    if (rslt == BMI2_OK){
    /* Accel configuration settings. */
    printf("setting accel config \r\n");
    rslt = set_accel_config(&bmi2_dev);
    bmi2_error_codes_print_result(rslt);
    }

    if (rslt == BMI2_OK)
    {
    /* NOTE:
    * Accel enable must be done after setting configurations
    */
    printf("Enabling ACC \r\n");
    rslt = bmi270_sensor_enable(&sensor_list, 1, &bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    printf("Accel and m/s2 data \n");
    printf("Accel data collected at 2G Range with 16-bit resolution\n");

    /* Loop to print the accel data when interrupt occurs. */
    while (indx <= limit){
    /* To get the status of accel data ready interrupt. */
    rslt = bmi2_get_int_status(&int_status, &bmi2_dev);
    printf("status val : %X \r\n", int_status);
    bmi2_error_codes_print_result(rslt);

    /* To check the accel data ready interrupt status and print the status for 10 samples. */
    if (int_status & BMI2_ACC_DRDY_INT_MASK)
    {
    /* Get accelerometer data for x, y and z axis. */
    rslt = bmi2_get_sensor_data(&sensor_data, &bmi2_dev);
    bmi2_error_codes_print_result(rslt);
    printf("\nAcc_X = %d\t", sensor_data.acc.x);
    printf("Acc_Y = %d\t", sensor_data.acc.y);
    printf("Acc_Z = %d\r\n", sensor_data.acc.z);

    /* Converting lsb to meter per second squared for 16 bit accelerometer at 2G range. */
    x = lsb_to_mps2(sensor_data.acc.x, 2, bmi2_dev.resolution);
    y = lsb_to_mps2(sensor_data.acc.y, 2, bmi2_dev.resolution);
    z = lsb_to_mps2(sensor_data.acc.z, 2, bmi2_dev.resolution);

    /* Print the data in m/s2. */
    printf("\nAcc_ms2_X = %4.2f, Acc_ms2_Y = %4.2f, Acc_ms2_Z = %4.2f\n", x, y, z);

    indx++;
    }
    nrf_delay_ms(500);
    }
    }

     

     

    It is really appreciated if anyone could help me out.

     

     

    Thank you in Advance. 

     

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Srisurya,

    In the I2C read/write function and its sub functions, the code that prints logs should be masked, which affects the speed of writing configuration files.

    Hi,

    In NRF52 I2C Write API, when i send multiple bytes, it updates the register address along with every byte. So I have created seperate i2c write function which updates the same register with multiple data bytes. I think this is the correct way I am going . Still its not initializing. I have added delays when writing which didnt help. 

    Is the burst write i am doing as i said above correct?

     

     

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Srisurya,

    When writing firmware, try to transfer more bytes as quickly as possible, similar to burst write.

    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