Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMP388 Self-test failure BMP3_TRIMMING_DATA_OUT_OF_BOUND

    BMP388 Self-test failure BMP3_TRIMMING_DATA_OUT_OF_BOUND

    joem
    Occasional Visitor

    I ran the self test from the BMP3-Sensor-API library and the response I am getting is BMP3_TRIMMING_DATA_OUT_OF_BOUND, because function validate_trimming_param() failed which is the CRC check on the calibration parameters. This agrees with the strange temp/pressure values I am seeing come from the `bmp3_get_sensor_data()` API.  These calibration values are set at manufacturing time I gather, so what can I do about this?

    https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/self-test/bmp3_selftest.c

    5 REPLIES 5

    shellywang
    Occasional Contributor

    The trimming values ​​are set at the time of manufacture and stored in the sensor for the following compensation calculations.

    Could you please share your trimming data so that we can look into it?

     

    (I'm answeirng for Joem since he's out for a long weekend)

    The following is the `calib_data`, as received during initialization. I verified over two reboots that the data was consistent:

    ```

    000005.468,I,BMP388,get_calib_data results:
    00 DD 6A 51 49 F6 C9 00 1E F6 23 00 55 61 CA 77 F3 F6 A3 3F 16

    ```

    Is this the right data?

    The code used to print the above data is copied below:

     

    ```

    static int8_t get_calib_data(struct bmp3_dev *dev)
    {
    int8_t rslt;
    uint8_t reg_addr = BMP3_CALIB_DATA_ADDR;

    /* Array to store calibration data */
    uint8_t calib_data[BMP3_CALIB_DATA_LEN] = { 0 };

    /* Read the calibration data from the sensor */
    rslt = bmp3_get_regs(reg_addr, calib_data, BMP3_CALIB_DATA_LEN, dev);

    LOG_C_INFO("BMP388", "get_calib_data results: ");

    for(int idx = 0; idx < BMP3_CALIB_DATA_LEN; idx++) {
    LOG_C_INFO_BASIC("%02X ", (unsigned int) calib_data[idx]);
    }
    LOG_C_INFO_BASIC("\n");

    /* Parse calibration data and store it in device structure */
    parse_calib_data(calib_data, dev);

    return rslt;
    }
    ```

     

     

    Here is it run again, but printing the parsed information

     

    000007.974,I,BMP388,get_calib_data results: 
    00 DD 6A 51 49 F6 C9 00 1E F6 23 00 55 61 CA 77 F3 F6 A3 3F 16
    000008.055,I,BMP388,get_calib_data parsed results:
    000008.059,I,BMP388,dev->calib_data.reg_calib_data.par_p1: -13834
    000008.063,I,BMP388,dev->calib_data.reg_calib_data.par_p2: 7680
    000008.067,I,BMP388,dev->calib_data.reg_calib_data.par_p3: -10
    000008.072,I,BMP388,dev->calib_data.reg_calib_data.par_p4: 35
    000008.076,I,BMP388,dev->calib_data.reg_calib_data.par_p5: 21760
    000008.080,I,BMP388,dev->calib_data.reg_calib_data.par_p6: 51809
    000008.084,I,BMP388,dev->calib_data.reg_calib_data.par_p7: 119
    000008.088,I,BMP388,dev->calib_data.reg_calib_data.par_p8: -13
    000008.092,I,BMP388,dev->calib_data.reg_calib_data.par_p9: -23562
    000008.096,I,BMP388,dev->calib_data.reg_calib_data.par_p10: 63
    000008.100,I,BMP388,dev->calib_data.reg_calib_data.par_p11: 22

     

    Code to produce this is:

     

    static int8_t get_calib_data(struct bmp3_dev *dev)
    {
    int8_t rslt;
    uint8_t reg_addr = BMP3_CALIB_DATA_ADDR;

    /* Array to store calibration data */
    uint8_t calib_data[BMP3_CALIB_DATA_LEN] = { 0 };

    /* Read the calibration data from the sensor */
    rslt = bmp3_get_regs(reg_addr, calib_data, BMP3_CALIB_DATA_LEN, dev);

    LOG_C_INFO("BMP388", "get_calib_data results: ");

    for(int idx = 0; idx < BMP3_CALIB_DATA_LEN; idx++) {
    LOG_C_INFO_BASIC("%02X ", (unsigned int) calib_data[idx]);
    }
    LOG_C_INFO_BASIC("\n");

    /* Parse calibration data and store it in device structure */
    parse_calib_data(calib_data, dev);

    LOG_C_INFO("BMP388", "get_calib_data parsed results: ");
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p1: %d", (int) dev->calib_data.reg_calib_data.par_p1);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p2: %d", (int) dev->calib_data.reg_calib_data.par_p2);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p3: %d", (int) dev->calib_data.reg_calib_data.par_p3);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p4: %d", (int) dev->calib_data.reg_calib_data.par_p4);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p5: %u", (int) dev->calib_data.reg_calib_data.par_p5);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p6: %u", (int) dev->calib_data.reg_calib_data.par_p6);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p7: %d", (int) dev->calib_data.reg_calib_data.par_p7);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p8: %d", (int) dev->calib_data.reg_calib_data.par_p8);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p9: %d", (int) dev->calib_data.reg_calib_data.par_p9);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p10: %d", (int) dev->calib_data.reg_calib_data.par_p10);
    LOG_C_INFO("BMP388", "dev->calib_data.reg_calib_data.par_p11: %d", (int) dev->calib_data.reg_calib_data.par_p11);

    return rslt;
    }

     

    shellywang, any luck with these numbers?

     

     

    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