I'm getting `BSEC_E_CONFIG_INSUFFICIENTWORKBUFFER` from `bsec_set_state`. The docs say the worker buffer should have size `BSEC_MAX_PROPERTY_BLOB_SIZE` which expands to 454, even with a buffer length 4096 I get the same error.
Relevant code:
uint8_t bsec_state[BSEC_MAX_STATE_BLOB_SIZE] = {0};
uint8_t work_buffer[4096] = {0}; // was [BSEC_MAX_PROPERTY_BLOB_SIZE]
uint32_t bsec_state_len;
...
EEPROM.get(/* address in eeprom */, bsec_state_len); // gets bsec_state_len from non-vol storage
if (bsec_state_len != 0xFF) {
EEPROM.get(/* address in eeprom */, bsec_state); // gets bsec_state from non-vol storage
bsec_status = bsec_set_state(bsec_state, bsec_state_len, work_buffer, sizeof(work_buffer));
if (bsec_status != BSEC_OK) {
Log.error("BSEC load state error: %d", bsec_status);
} else {
Log.info("BSEC loaded state, %lu bytes", bsec_state_len);
}
}
I'm running BSEC 1.4.8.0, Cortex M4F, with a BME680
Hi adamrobcarter,
You can try to increase heap size and stack size of your platform.