Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 self-test failed

    BME680 self-test failed

    Rolo
    Member

    Hello all,

    we want to use the BME680 sensor. We use our own board with an TI AM3354 processor. We took the software from: https://github.com/BoschSensortec/BME68x-Sensor-API.  From there (examples) we tried  firstly the "fored_mode" which always displayed out the same results. So we tried the "self_test" which ended with "API name [bme68x_selftest_check]  Error [-5] : Self test error". So I looked a bit deeper. In function "bme68x_selftest_check" in file bme68x.c line 770 comes:
    if ((data[0].idac != 0x00) && (data[0].idac != 0xFF) &&
    (data[0].status & BME68X_GASM_VALID_MSK))
    {
    rslt = BME68X_OK;
    }
    else
    {
    rslt = BME68X_E_SELF_TEST;
    }
    Looking in line 767 to see where the "data[0].*" come from I found out that "data[0].idac" is 0x0 and "date[0].status" is 0x80 which leads with bitwise "AND" BME68X_GASM_VALID_MSK (0x20) to zero. That means I got two conditions which implicated "rslt = BME68X_E_SELF_TEST;".
    So the self_test failed but why. Before "bme68x_selftest_check" failed, "bme68x_interface_init" and "bme68x_init" returned "BME68X_OK". Has anybody an idea?

    Rolo

    6 REPLIES 6

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Rolo,

    Refer BME680 self test github code https://github.com/boschsensortec/BME68x-Sensor-API/blob/master/examples/self_test/self_test.c, run it on STM32, it works well.

    BME68X self test result.png

    Please attached example code.

    Hi BSTRobin,

    yes this ist exact the file I used:

    https://github.com/boschsensortec/BME68x-Sensor-API/blob/master/examples/self_test/self_test.c 

    but with the result I wrote.  I tried to compile the files in the *.zip container but without success, because some include files are missing.

    Can you tell me why I got for example "data[0].idac == 0x00" and not "data[0].idac != 0x00"? It's one reason why I got an errror.

    Best Regards,

    Rolo

    Hi BSTRobin,

    I loaded up a file from i2cdump of device at 0x76. Please have a look on it! Is it correct!

    Best Regards,

    Rolo

    BSTRobin
    Community Moderator
    Community Moderator

    Hi Rolo,

    Run self-test example code, you need to add driver code bme68x.c, bme68x.h, bme68x_defs.h which is got from https://github.com/boschsensortec/BME68x-Sensor-API to your project.

    I uploaded 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