Skip to main content
Visitor II
April 27, 2017
Question

[VL53L0X] PerformRefSpadManagement Error

  • April 27, 2017
  • 2 replies
  • 977 views
Posted on April 27, 2017 at 11:42

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!

#vl53l0x #error
    This topic has been closed for replies.

    2 replies

    Visitor II
    August 28, 2017
    Posted on August 28, 2017 at 14:56

    I have the same error when trying to change the I2C address even with only one sensor attached to my Raspberry-Pi 3

    Visitor II
    October 9, 2017
    Posted on October 09, 2017 at 05:19

    Did you solve this problem? I'm having a similar one!