Bosch Sensortec Community

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

    BSEC_E_CONFIG_VERSIONMISMATCH

    BSEC_E_CONFIG_VERSIONMISMATCH

    Mich
    New Poster

    Hello

    have the error BSEC_E_CONFIG_VERSIONMISMATCH during the config_load()

    bsec_get_version() returns version.major:1 version.minor:4 version.major_bugfix:7 version.minor_bugfix:4

    and inside the file bsec_serialized_configurations_iaq.c I have:

    const uint8_t bsec_config_iaq[454] =
    {4,7,4,1,61,0, ....

    Which seems identical...

    Integration guide indicates "Obtain a compatible string.". How could I obtain it?

    Version mismatch between what and what?

    Do you have any suggestion?

    Best regards

    Michel

    17 REPLIES 17

    fish
    Community Moderator
    Community Moderator

    Hi Mich,

    We don't have MSP430 hardware, could help with your error log to found the problem, still need yourself fix the issue.

    The mismatch is about the library version to the config string version loaded.

    So please remove load config string function and try with the lib again to see if lib is correct for integration. If so, the problem should be the config string.

    From COINES example, the content of load_config funtion is null. So please try it.

    uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer)
    {
    // ...
    // Load a library config from non-volatile memory, if available.
    //
    // Return zero if loading was unsuccessful or no config was available,
    // otherwise return length of loaded config string.
    // ...
    return 0;
    }

     

     

    Hello,

    I added your suggestion but there is still error. Which value should return bus_write and bus_read? OK is 0 or 1?

    It seems that the code is unstable. If I change a diffeent line, the problem is different.

    Could it help if I transmit the whole project to your support?

    For your information, your support found buffer size error in the bsec exemple provided on your web site.

    Best regards

    Michel

    fish
    Community Moderator
    Community Moderator

    Hi,

    My suggestion take two method, one is upload your error log info here, the other is contact local distributor and request onsite support.

    You could upload your original error log and  code before remove load_config function. Because we haven't MSP430 platform, we suggest you add print() log as more as possible, this methord would take some times.

     

    Best regards

    Hello,

    If I did as you adviced with config_load removed:

    uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer)
    {
    // ...
    // // Load a library config from non-volatile memory, if available.
    // //
    // // Return zero if loading was unsuccessful or no config was available,
    // // otherwise return length of loaded config string.
    // ...
    // debug_str("config_load()\r\n");
    //
    // memcpy(config_buffer, bsec_config_iaq, sizeof(bsec_config_iaq));
    // return sizeof(bsec_config_iaq);

    return 0;
    }

    and the init part code:

    return_values_init bsec_iot_init(float sample_rate, float temperature_offset, bme680_com_fptr_t bus_write,
    bme680_com_fptr_t bus_read, sleep_fct sleep, state_load_fct state_load, config_load_fct config_load)
    {
    return_values_init ret = {BME680_OK, BSEC_OK};
    bsec_library_return_t bsec_status = BSEC_OK;

    int bsec_state_len, bsec_config_len;


    debug_str("ici0\r\n");

    /* Fixed I2C configuration */
    bme680_g.dev_id = BME680_I2C_ADDR_PRIMARY;
    bme680_g.intf = BME680_I2C_INTF;
    /* User configurable I2C configuration */
    bme680_g.write = bus_write;
    bme680_g.read = bus_read;
    bme680_g.delay_ms = sleep;

    /* Initialize BME680 API */
    ret.bme680_status = bme680_init(&bme680_g);
    if (ret.bme680_status != BME680_OK)
    {
    debug_str("err bme680_init()\r\n 0x");
    debug_hex(ret.bme680_status);
    debug_str(" 0x");
    debug_hex(ret.bsec_status);
    debug_str("\r\n");
    return ret;
    }

    debug_str("ici1\r\n");

    /* Initialize BSEC library */
    ret.bsec_status = bsec_init();
    if (ret.bsec_status != BSEC_OK)
    {
    debug_str("err bsec_init()\r\n");
    debug_dec16(ret.bme680_status);
    debug_str("\r\n");
    return ret;
    }

    debug_str("ici2\r\n");

    /* Load library config, if available */
    bsec_config_len = config_load(bsec_config, sizeof(bsec_config));
    if (bsec_config_len != 0)
    {
    ret.bsec_status = bsec_set_configuration(bsec_config, bsec_config_len, work_buffer, sizeof(work_buffer));
    if (ret.bsec_status != BSEC_OK)
    {
    debug_str("err bsec_set_configuration()\r\n");
    debug_dec16(ret.bsec_status);
    debug_str("\r\n");
    return ret;
    }
    }
    //
    // /* Load previous library state, if available */
    // bsec_state_len = state_load(bsec_state_prop, sizeof(bsec_state_prop));
    // if (bsec_state_len != 0)
    // {
    // debug_str("ici1\r\n");
    // ret.bsec_status = bsec_set_state(bsec_state_prop, bsec_state_len, work_buffer_prop, sizeof(work_buffer_prop));
    // debug_str("ici2\r\n");
    // if (ret.bsec_status != BSEC_OK)
    // {
    // return ret;
    // }
    // }
    debug_str("ici3\r\n");


    /* Set temperature offset */
    bme680_temperature_offset_g = temperature_offset;

    TP302_ON;
    /* Call to the function which sets the library with subscription information */
    ret.bsec_status = bme680_bsec_update_subscription(sample_rate);
    TP302_OFF;
    debug_str("ici4\r\n");
    if (ret.bsec_status != BSEC_OK)
    {
    debug_str("err bme680_bsec_update_subscription()\r\n");
    return ret;
    }

    and the configuration file:

    #include "bsec_serialized_configurations_iaq.h"

    // 33v_300s_4d
    const uint8_t bsec_config_iaq[454] =
    {4,7,4,1,61,0,0,0,0,0,0,0,174,1,0,0,48,0,1,0,0,192,168,71,64,49,119,76,0,0,225,68,137,65,0,63,205,204,204,62,0,0,64,63,205,204,204,62,0,0,0,0,216,85,0,100,0,0,0,0,0,0,0,0,28,0,2,0,0,244,1,225,0,25,0,0,128,64,0,0,32,65,144,1,0,0,112,65,0,0,0,63,16,0,3,0,10,215,163,60,10,215,35,59,10,215,35,59,9,0,5,0,0,0,0,0,1,88,0,9,0,229,208,34,62,0,0,0,0,0,0,0,0,218,27,156,62,225,11,67,64,0,0,160,64,0,0,0,0,0,0,0,0,94,75,72,189,93,254,159,64,66,62,160,191,0,0,0,0,0,0,0,0,33,31,180,190,138,176,97,64,65,241,99,190,0,0,0,0,0,0,0,0,167,121,71,61,165,189,41,192,184,30,189,64,12,0,10,0,0,0,0,0,0,0,0,0,229,0,254,0,2,1,5,48,117,100,0,44,1,112,23,151,7,132,3,197,0,92,4,144,1,64,1,64,1,144,1,48,117,48,117,48,117,48,117,100,0,100,0,100,0,48,117,48,117,48,117,100,0,100,0,48,117,48,117,100,0,100,0,100,0,100,0,48,117,48,117,48,117,100,0,100,0,100,0,48,117,48,117,100,0,100,0,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,112,23,255,255,255,255,255,255,255,255,220,5,220,5,220,5,255,255,255,255,255,255,220,5,220,5,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,48,117,0,0,0,0,24,89,0,0};

     

    I have the following result:

    BSEC version: 1 4 7 4

    ici0
    bus_write
    sleep() 10
    bus_read
    bus_read
    bus_read

    bus_read
    bus_read

    bus_read
    ici1
    ici2
    ici3
    ici25
    status -16

     

    If I add the configaration:

    uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer)
    {
    // ...
    // Load a library config from non-volatile memory, if available.
    //
    // Return zero if loading was unsuccessful or no config was available,
    // otherwise return length of loaded config string.
    // ...
    debug_str("config_load()\r\n");

    memcpy(config_buffer, bsec_config_iaq, sizeof(bsec_config_iaq));
    return sizeof(bsec_config_iaq);

    return 0;
    }

    I have this error:

    BSEC version: 1 4 7 4
    ici0

    bus_write
    sleep() 10
    bus_read

    bus_read
    bus_read
    bus_read
    bus_read
    bus_read
    ici1
    ici2

    config_load()
    err bsec_set_configuration()
    -34
    bsec_status -34

     

    Do you have any suggestion?

     

    Best regards

    Mich

     

     

     

     

     

    fish
    Community Moderator
    Community Moderator

    Hi Mich,

    I have review your code.

    After remove condig_load(), a new error BSEC_E_SU_SAMPLINTVLINTEGERMULT = -16, please check you sample rate with our example code. From example code, the bsec_iot_init() as bellow.

    /* Call to the function which initializes the BSEC library
    * Switch on low-power mode and provide no temperature offset */
    ret_bsec = bsec_iot_init(BSEC_SAMPLE_RATE_LP, 0.0f, bus_write, bus_read, sleep, state_load, config_load);

    I have enclosed example code for you, please match the initial code.

    At the sametiem, could you make sure the I2C bus only have one sensor? The I2C write function is success?

    Best regards.

     

    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