Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    Always receive BME680_W_NO_NEW_DATA status when trying to read measurement results from BME680 chip

    Always receive BME680_W_NO_NEW_DATA status when trying to read measurement results from BME680 chip

    CharlMN
    Member

    Hi Bosch Sensortech Community

    I'm struggling to interface the BME680 chip with the nRF52840 using the BME680 API and the BSEC library. 

    At first I only used the BME680 API, which resulted in the BME680_W_NO_NEW_DATA  status when trying to read the measurement results.

    I then saw that there was a newer version of the BME680 API (the BME68x API). Tried that and got the same results.

    I then tried using the BME680 API along with the BSEC library, hoping that this will solve my problem, but still got the same result - BME680_W_NO_NEW_DATA .

    To my knowledge my I2C functions are correct as I was checking on a digital osccilloscope to sort out initial I2C errors and I'm also not getting any errors when initialising the BME680 API and BSEC library.

    I have attached my code as reference.

    Any assistance would be much appreciated.

    Regards,

    Charl

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hello CharlMN,

    There was reference code in another ticket: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BME680-with-BSEC-produces-on-0-0s-even-a...

    For your code,  you need to check I2C write and read function. Move the I2C address one bit to the left, and refer to the I2C timing in data sheet.

     

    int8_t SensorAPI_I2Cx_Read(uint8_t slave_address7, uint8_t subaddress, uint8_t *pBuffer, uint16_t ReadNumbr)
    {
    uint16_t DevAddress = slave_address7 << 1;
    ...
    }

    int8_t SensorAPI_I2Cx_Write(uint8_t slave_address7, uint8_t subaddress, uint8_t *pBuffer, uint16_t WriteNumbr)
    {
    uint16_t DevAddress = slave_address7 << 1;
    ...
    }

    BME680 I2C Write.png

    BME680 I2C Read.png

     

    Morning BSTRobin

    Thank you for your response.

    I have checked this before by shifting the address left by one bit, that is why I'm quite certain that the I2C write function is working. When I do shift the address left by one bit, the device will give an error when trying to initialise the BME680 API (BME680_E_DEV_NOT_FOUND). The nsI2C_REG_WRITE function in my code calls other internal write functions, which shifts the address.

    I have added images below to show that the nsI2C_REG_WRITE function is working, showing the Soft Reset command write and the ACKs that I'm receiving.

    I will check if the stack size is maybe also causing my issue as you mentioned in the post that you referenced and I'm double checking that my I2C write and read functions are correct, especially when it comes to multi-byte writes and reads.

    Will revert back on this.

    CharlMN_0-1626249430701.png

    CharlMN_1-1626249463928.png

    BR,

    Charl

     

    Hi BSTRobin

    Also, to check if my multi-byte reads are correct, can you confirm that the calibration parameters are correct that was read back from the chip?

    CharlMN_0-1626250631219.png

     

    BR,

    Charl

    Hi BSTRobin

    Apologies, you would be able to see from the two scope images that my I2C write funtion was not correct. It added a second start condition between the register address and data value.

    I fixed it and now I am successfully receiving the measurement data from the BME680 sensor.

    Thank you for your assistance.

    BR,

    Charl

    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