Hello,
I am currently testing a BMV080 module from DFRobot using the appropriate bmv080-sdk-v11-1-0 on ESP32-S3 using ESP-IDF.
The continuous mode of the sensor seems to work properly, however the duty cycle mode does not :
For a period of 15 s between each measurement, the callback function is called only once after 12 seconds, and is never called afterwards.
Following the integration guidelines, I am using serve_interrupt every second without any returned error.
Here is the code I use :
bmv080_handle_t dev_handle;
i2c_master_dev_handle_t i2c_handle; //initialized with driver/i2c_master
int meas_period_ms = 15000;
esp_err_t ret = ESP_OK;
bmv080_status_code_t bmv_stat = bmv080_open(dev_handle, i2c_handle,(bmv080_callback_read_t)bmv080_i2c_read_16bit,(bmv080_callback_write_t)bmv080_i2c_write_16bit,(bmv080_callback_delay_t)bmv080_delay);
ret = bmv080_set_parameter(dev_handle,"duty_cycling_period", (void*)&meas_period_ms);
if(ret != E_BMV080_OK) return ESP_FAIL;
ret = bmv080_start_duty_cycling_measurement(dev_handle,(bmv080_callback_tick_t)get_tick_ms, E_BMV080_DUTY_CYCLING_MODE_0);
if(ret != E_BMV080_OK) return ESP_FAIL;
TickType_t last_wake_time = xTaskGetTickCount();
while(1)
{
last_wake_time = xTaskGetTickCount();
xTaskDelayUntil(&last_wake_time, pdMS_TO_TICKS(1000));
ret = bmv080_serve_interrupt(dev_handle, (bmv080_callback_data_ready_t)callback_function, NULL);
if(ret != E_BMV080_OK) return ESP_FAIL;
}
int8_t bmv080_delay(uint32_t period)
{
vTaskDelay(pdMS_TO_TICKS(period));
return 0;
}
uint32_t get_tick_ms(void)
{
return xTaskGetTickCount() * portTICK_PERIOD_MS;
}The callback just prints a log when it is called for debug.
I believe the i2c functions are ok considering all others operations work normally.
Could you indicate me if I am missing a step in the process ?
Thank you.