08-14-2019 05:53 PM
Hi, I already understood how to work with this sensor and compiled my project with STM32F103C8 and BSEC Lib without errors. It worked with BSEC_SAMPLE_RATE_LP mode in bsec_iot_init. It worked good for ~20 hours. However the temperature and humidity was not true, temperature was 5 degs higher than real and humidity lower from real. I made reserve copy of whole working project to other folder. Then I changed mode to BSEC_SAMPLE_RATE_ULP but sensor stopped to output data. I decided that I made something wrong with my code and opened and compiled previous working project with BSEC_SAMPLE_RATE_LP mode. But sensor did not output measurements results , however sensor is working. I can read chip ID and after bsec_iot_init function I recieve OK answers:
ret = bsec_iot_init(BSEC_SAMPLE_RATE_LP, 0.0, bus_write, bus_read, sleep, state_load, config_load);
sprintf(uart_buf,"\nBSEC Init: %i, BME680 Status: %i" , ret.bsec_status, ret.bme680_status); UART1_Transmit_string(uart_buf);
Answers in PC_terminal: BSEC Init: 0, BME680 Status: 0 that means all OK.
By debugging I found that program stops in "static uint8_t calc_heater_res(uint16_t temp, const struct bme680_dev *dev)" function. It calculates var1 and stops. Sometimes it calculates var2 and var3. I dont know what happened and why reserve working project stopped to output measured data.
08-14-2019 07:38 PM
This funciton you mentioned is convert the sensor output to the register value needed for lib.
It will take the calibration parameters during sensor initialize and the register value after each measurement then calculate it.
For your problem, i need to know detail when error happens what is the sensor read out value and if the parameters are still stored in dev structure?
08-15-2019 10:31 PM
Hi, I noticed strange behavior of program. I just uncommented #define BME680_FLOAT_POINT_COMPENSATION and project began to work again in LP mode and even in ULP mode. I cant understand why my program worked with integer version in LP mode and than stopped after I changed LP mode to ULP mode in bsec_iot_init function. bsec_serialized_configurations_iaq was not loaded at both compilations( with LP mode and ULP mode).
One more question: why measured and outputted temperature and humidity differs from real values? RAW temp and RAW humidity are same as compensated values. Such result in LP mode and ULP mode, with and without loading configs(bsec_serialized_configurations_iaq).