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
... View more