10-01-2019 06:32 PM - edited 10-01-2019 06:38 PM
BME680 BSEC ARM Cortex-MF4 IAR: not found new data if gas sensor enable in LP or ULP mode.
/******************************************/
ret = bsec_iot_init(BSEC_SAMPLE_RATE_LP, 0.0f, bt_bme680_bus_write , bt_bme680_bus_read, sys_cmd_delay_ms, state_load, config_load);
bsec_iot_loop(sys_cmd_delay_ms, sys_get_timestamp_us, output_ready, state_save, 100);
/***************************************/
if sensor_settings.run_gas = BME680_DISABLE_GAS_MEAS; get new data but only: T;H;P
BSEC version 1.4.7.4.
Thank you.
Solved! Go to Solution.
10-02-2019 01:53 PM
Unfortunately it is difficult to understand the root cause of this issue based on the provided information. Could you please share some more details about your difficulties? Is no data printed in your terminal? Do you see any error/warning message from any BSEC function call? Could you determine if the code is blocked or stops in any specific location in your code? Did you make any changes to the original sample code?
10-02-2019 03:13 PM - edited 10-02-2019 06:25 PM
Sample code without any modification.
No BSEC Errors or Warnings.
The code works without blocked.
My debug inject:
static void bme680_bsec_read_data(int64_t time_stamp_trigger, bsec_input_t *inputs, uint8_t *num_bsec_inputs,
int32_t bsec_process_data)
{
static struct bme680_field_data data;
int8_t bme680_status = BME680_OK;
/* We only have to read data if the previous call the bsec_sensor_control() actually asked for it */
if (bsec_process_data)
{
bme680_status = bme680_get_sensor_data(&data, &bme680_g);
print("%02X\n",data.status); -> terminal: 0x00
....
full terminal log:
run_gas:1,heater_temp:320,heater_dur:150
BME680 INIT Start
I2C W $E0 <= 0xB6,
I2C R $D0 => 0x61,
I2C R $89 => 0x00,0x45,0x66,0x03,0xE0,0x80,0x88,0x40,0xD7,0x58,0x00,0x11,0x01,0x30,0xFF,0x01,0x1E,0x00,0x00,0x08,0x01,0x00,0xF0,0x1E,0x00,
I2C R $E1 => 0x3E,0x06,0x24,0x00,0x2D,0x14,0x78,0x9C,0x40,0x66,0x1A,0xE0,0xC0,0x12,0x05,0x00,
I2C R $02 => 0x16,
I2C R $00 => 0x20,
I2C R $04 => 0x13,
BME680 OK
bme680_set_sensor_settings start
I2C W $5A <= 0x70, 0x64, 0x65,
I2C R $74 => 0x00,
I2C R $75 => 0x00,
I2C R $70 => 0x00,
I2C R $74 => 0x00,
I2C R $72 => 0x00,
I2C R $71 => 0x00,
I2C W $75 <= 0x08, 0x70, 0x00, 0x74, 0x54, 0x72, 0x01, 0x71, 0x10,
bme680_set_sensor_settings end
bme680_set_sensor_mode start
I2C R $74 => 0x54,
I2C W $74 <= 0x55,
bme680_set_sensor_mode end
Waiting (ms):193
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
Thank you.
10-02-2019 04:03 PM
Could you please also store and print the value returned by bsec_sensor_control(), as well as the value of bme680_status after each step in bme680_bsec_trigger_measurement()?
10-03-2019 02:32 PM
BME680 INIT Start
I2C W $E0 <= 0xB6,
I2C R $D0 => 0x61,
I2C R $89 => 0x00,0x45,0x66,0x03,0xE0,0x80,0x88,0x40,0xD7,0x58,0x00,0x11,0x01,0x30,0xFF,0x01,0x1E,0x00,0x00,0x08,0x01,0x00,0xF0,0x1E,0x00,
I2C R $E1 => 0x3E,0x06,0x24,0x00,0x2D,0x14,0x78,0x9C,0x40,0x66,0x1A,0xE0,0xC0,0x12,0x05,0x00,
I2C R $02 => 0x16,
I2C R $00 => 0x20,
I2C R $04 => 0x13,
BME680 OK
bsec_sensor_control result:0
I2C W $5A <= 0x70, 0x64, 0x65,
I2C R $74 => 0x00,
I2C R $75 => 0x00,
I2C R $70 => 0x00,
I2C R $74 => 0x00,
I2C R $72 => 0x00,
I2C R $71 => 0x00,
I2C W $75 <= 0x08, 0x70, 0x00, 0x74, 0x54, 0x72, 0x01, 0x71, 0x10,
bme680_set_sensor_settings result:0
I2C R $74 => 0x54,
I2C W $74 <= 0x55,
bme680_set_sensor_mode result:0
I2C R $74 => 0x00,
bme680_get_sensor_mode result:0
bme680_bsec_trigger_measurement bme680_status:0
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,
I2C R $1D => 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x04,