AnsweredAssumed Answered

VL53L0X inialisation failing in PerfomRefSpadManagment

Question asked by Andrew Fletcher on Oct 5, 2017
Latest reply on Feb 15, 2018 by john kvam

Debugging shows it fails due to error in the VL53L0X_REG_RESULT_INTERRUPT_STATUS register read in VL53L0X_GetInterruptMaskStatus. 

 

Can anyone tell me what values 0x50, 0x54 and 0x4C describe and how to resolve it?

 

My stack is:

VL53L0X_GetInterruptMaskStatus() at vl53l0x_api.c:2,911 0x800510c    
VL53L0X_GetMeasurementDataReady() at vl53l0x_api.c:2,335 0x8005138    
VL53L0X_measurement_poll_for_completion() at vl53l0x_api_core.c:72 0x800591e    
VL53L0X_perform_single_ref_calibration() at vl53l0x_api_calibration.c:1,076 0x8005438    
VL53L0X_perform_vhv_calibration() at vl53l0x_api_calibration.c:1,144 0x800555a    
VL53L0X_perform_ref_calibration() at vl53l0x_api_calibration.c:1,227 0x800562c    
VL53L0X_perform_ref_spad_management() at vl53l0x_api_calibration.c:763 0x80056e8    
VL53L0X_PerformRefSpadManagement() at vl53l0x_api.c:3,034 0x800517a    
TOF_InitSensor() at main.c:287 0x800c44a    

 

The Initialisation code to that point looks like:

static const uint8_t i2cInitialAddress = 0x52; // LSB is reserved
uint8_t i2cFinalAddress = 0x60;

memset(tofSens, 0, sizeof(VL53L0X_Dev_t));
tofSens->I2cDevAddr         = i2cInitialAddress;
tofSens->comms_type         = 1;
tofSens->comms_speed_khz    = 100;

VL53L0X_SetDeviceAddress(tofSens, i2cFinalAddress);
tofSens->I2cDevAddr = i2cFinalAddress;

VL53L0X_DataInit(tofSens); //Success!
VL53L0X_StaticInit(tofSens); //Success!

uint32_t refSpadCount;
uint8_t isApertureSpads;
VL53L0X_PerformRefSpadManagement(tofSens, &refSpadCount, &isApertureSpads); // FAILS

I'm communicating fine with the device with I2C.

Outcomes