VL53L8CX - Unable to use detection thresholds while in Autonomous mode.
Hello,
I have been using the this ToF sensor along an ESP32-WROOM MCU for a while without major issues. My impementation of the i2c interface seems to be working well since in most simple ranging cases everything works well.
However, recently, i have been playing around with detection thresholds. I discovered that when I enable detection thresholds while in autonomous mode, I am unable to start ranging. In fact, the sensor gets properly configured (resolution, ranging mode, integration time, frequency and detection thresholds) but when it starts ranging (function vl53l8_start_ranging), error VL53L8_STATUS_ERROR occurs. The error gets raised in this part of the function
/* Read ui range data content and compare if data size is the correct one */
status |= l8_dci_read_data(p_dev,
(uint8_t*)p_dev->temp_buffer, 0x5440, 12);
(void)memcpy(&tmp, &(p_dev->temp_buffer[0x8]), sizeof(tmp));
if(tmp != p_dev->data_read_size)
{
status |= L8_STATUS_ERROR;
}
because the data that is read has a size of zero (tmp is zero).
However, I have no clue why this is happening since the Smart Person Detection code implements such a configuration (Autonomous 4x4 with low power consumption and detection thresholds). And when i disable detection thresholds while in autonomous it works well. Also, when i enable detection thresholds while in continuous mode, it also works well.
Do you have an idea why this is happening?
Note that at first, I was using ULD driver version v1.0.4 but i also did some testing with version v2.0.0 and also with the universal driver VL53LMZ_ULD_API_v2.0.10. In all my tests, I was unable to properly configure the sensor.
