Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME688 no new data found

    BME688 no new data found

    julio_cf98
    New Poster

    Hi, I'm using BME688 in a custom board with nRF52840 microcontroller running Zephyr RTOS. I modified the common.c file from bme68x API and checked the I2C transactions with a logic analizer to verify that read/write procedure is in the right format (page 46 in the datasheet).

    Here are the i2c and delay functions that I edited from the original common.c file available in GitHub. i2c_dev is a structure pointer to the i2c peripheral used by Zephyr.

     

    BME68X_INTF_RET_TYPE bme68x_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
    {
        return i2c_burst_read(i2c_dev, dev_addr, reg_addr, reg_data, len);
    }
    
    BME68X_INTF_RET_TYPE bme68x_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
    {
        uint8_t tx_buf[len + 1];
        tx_buf[0] = reg_addr;
        memcpy(tx_buf + 1, reg_data, len);
        return i2c_write(i2c_dev, tx_buf , len + 1, dev_addr);
    }
    
    void bme68x_delay_us(uint32_t period, void *intf_ptr)
    {
        k_usleep(period);
    }

     

     

    Here is a read timming example to get the chip id. Burst read also works fine.

     BME688 chip id I2C read.BME688 chip id I2C read.

    Here is a burst write example. As in datasheet's page 46,  there is no auto-increment, as you can see the register address increments by 1: 0x71, 0x72, ..., 0x75.

    BME688 multiple byte write.BME688 multiple byte write.

    The problem: 

    When I run the self-check, this message appears:

    API name [bme68x_selftest_check] Warning [2] : No new data found

    And when I try the forced mode example, I always get this output :

    API name [bme68x_init] OK [0]
    API name [bme68x_set_conf] OK [0]
    API name [bme68x_set_heatr_conf]OK [0]
    Sample, TimeStamp(ms), Temperature(deg C), Pressure(Pa), Humidity(%), Gas resistance(ohm), Status
    API name [bme68x_set_op_mode] OK [0]
    API name [bme68x_get_data] Warning [2] : No new data found
    API name [bme68x_set_op_mode] OK [0]
    API name [bme68x_get_data] OK [0]
    1, 3852, 0, 1107730122, 1200501, 1120403456, 0x80
    API name [bme68x_set_op_mode] OK [0]
    API name [bme68x_get_data] OK [0]
    2, 4010, 0, 1107730122, 1200501, 1120403456, 0x80
    API name [bme68x_set_op_mode] OK [0]
    API name [bme68x_get_data] OK [0]
    3, 4168, 0, 1107730122, 1200501, 1120403456, 0x80
    API name [bme68x_set_op_mode] OK [0]
    API name [bme68x_get_data] OK [0]
    4, 4326, 0, 1107730122, 1200501, 1120403456, 0x80
    API name [bme68x_set_op_mode] OK [0]
    API name [bme68x_get_data] OK [0]
    5, 4485, 0, 1107730122, 1200501, 1120403456, 0x80
    (...)

    This is how it looks like at the logic analizer:

    image.png

    I'm not using the FPU and I just changed the line time_ms = coines_get_millis(); to:

    time_ms = k_uptime_get_32();
     
    There are other posts with similar problems but no one seems to resolve it. What can be wrong or missing?
    1 REPLY 1

    BSTRobin
    Community Moderator
    Community Moderator

    Hi julio_cf98,

    There was attached example code on STM32 for your reference.

    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