Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Getting error in bme680 calibration function.

    Getting error in bme680 calibration function.

    Sudeep1310
    Member

    Hi,

    I am trying to get compile bme680_init() function only and it interfaced with the BlueNRG-2 (BLE+MCU)module. I am using  Keil compiller. Please look below for reference

    struct bme680_dev gas_sensor;

    /* You may assign a chip select identifier to be handled later */
    gas_sensor.dev_id = BME680_I2C_ADDR_PRIMARY;
    gas_sensor.intf = BME680_I2C_INTF;
    gas_sensor.read = i2c_read;
    gas_sensor.write = i2c_write;
    gas_sensor.delay_ms = delay_ms;
    /* amb_temp can be set to 25 prior to configuring the gas sensor
    * or by performing a few temperature readings without operating the gas sensor.
    */
    gas_sensor.amb_temp = 25;


    int8_t rslt = BME680_OK;
    rslt = bme680_init(&gas_sensor);
    printf("BME680 InIt Result: ");
    if(rslt==0)
    {
    printf("Success");
    }
    else
    {
    printf("Error");
    }
    printf("\n");

     

    But I am getting issue at  rslt = bme680_get_regs(BME680_COEFF_ADDR1, coeff_array, BME680_COEFF_ADDR1_LEN, dev);

    in get_calib_data () function. Here Program is stuck and getting  error in I2C reading. But I am getting proper Chip ID 0x61 while reading  chip ID . So I am assuming my I2C lines are working. Also tested with other sensor and confirm I2C line is working.  I have also checked about BME680_COEFF_ADDR1 and that is 0x89 given in bme680_def.h file. But It is not mentioned anywhere in datasheet. 

    Can you please Guide me where I am doing wrong. Please Guide. 

    31 REPLIES 31

    Hello Minhwan,

    As you suggested I have captured logic analyser data by running forced example code.  Data shows also execution stucking in internal calibration function.

    I have also given link here to download logic 2.3.44 software in which you can import  .sal file to see all log . All captured data included in zip file attached with this message. 

    Please download the software if needed from here to see .sal file also. 

    https://www.saleae.com/downloads/

    I have attached captured image files also in zip file.

    In captured log I have seen in internal calibration api in bme68x_get_regs(BME68X_REG_COEFF1, coeff_array, BME68X_LEN_COEFF1, dev) function library defines BME68X_LEN_COEFF1=25 but getting only 16 and after that it is stucking. 

    Pleaase suggest.

    Minhwan
    Community Moderator
    Community Moderator

    Hello sudeep, 

     

    Correct. All logic data is okay before get_calib_data function. 

    I feel that your maximum i2c length could be 16. That's why you can't get over it. 

    Could you check for it? 

    And, BME68X_LEN_COEFF1 is 23, so for this example 24 is enough. 

    Please let me know. 

    Thanks, 

     

    Hello Minhwan,

    I have shared here one Image of my BlueNRG2 (BLE with MCU) Module datasheet. In which it is clearly mentioned that my I2C Rx and Tx fifo max size is 16 byte. Please refer the attachment. 

     Please guide me Can I Read one by one registers with  seperate I2C read function for each register instead if multiple read registers in one shot?

    Thanks 

     

    Minhwan
    Community Moderator
    Community Moderator

    Hello Sudeep, 

     

    I will check it with HQ. 

    It will take some time, and let you know if there is any update. 

    Thanks, 

    Hello Minhwan,

    Thanks. Waiting for your response. Meanwhile I will also try to find some tricks. Please give me reply once you  check  with HQ.

    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