AnsweredAssumed Answered

[VL53L0X] PerformRefSpadManagement Error

Question asked by paul_kajd@web.de on Apr 27, 2017
Latest reply on Oct 9, 2017 by Andrew Fletcher

Hi, I'm using the VL53L0X satellite with the STM API.

For the first time calibration I'm following the calibration flow proposed in UM2039.

DataInit() and StaticInit() work well, but after using PerformRefSpadManagement(), there occurs a Control Interface Error (-20). I tracked down the error source to the following path:

VL53L0X_PerformRefSpadManagement() -> perform_ref_signal_measurement() -> PerformSingleRangingMeasurement() 

VL53L0X_Error VL53L0X_PerformSingleRangingMeasurement(VL53L0X_DEV Dev,
VL53L0X_RangingMeasurementData_t *pRangingMeasurementData)
{
VL53L0X_Error Status = VL53L0X_ERROR_NONE;

LOG_FUNCTION_START("");

/* This function will do a complete single ranging
* Here we fix the mode! */
Status = VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_SINGLE_RANGING);

if (Status == VL53L0X_ERROR_NONE)
Status = VL53L0X_PerformSingleMeasurement(Dev);


if (Status == VL53L0X_ERROR_NONE)
Status = VL53L0X_GetRangingMeasurementData(Dev,
pRangingMeasurementData);

if (Status == VL53L0X_ERROR_NONE)
Status = VL53L0X_ClearInterruptMask(Dev, 0);
//^!!this function throws an error (I2C bus busy)!!^

LOG_FUNCTION_END(Status);
return Status;
}

 

When calling VL53L0X_PerformSingleRangingMeasurement() from the main, there is no problem, only, when it's called from PerformRefSpadManagement().

 

Thanks for your help in advance!

Outcomes