cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L0X inialisation failing in PerfomRefSpadManagment

Andrew Fletcher
Associate II
Posted on October 05, 2017 at 07:00

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.

#vl53l0x
3 REPLIES 3
John E KVAM
ST Employee
Posted on January 02, 2018 at 17:02

A very small number of parts report this error. It appears the result of the calibration falls outside of the range allowed by the firmware, but within an acceptable range of the hardware. In our testing, the parts work just fine, but do unfortunately return this error.

Your choices are to discontinue use of that part as a failed part, or to allow that failure as acceptable.

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
Posted on February 11, 2018 at 20:17

Hi John,

I seem to have the same problem, but need to understand the solution. I can communicate to the VL53L0X upto StaticInit and then I call, VL53L0X_PerformRefSpadManagement and then VL53L0X_PerformRefCalibration but I ignore the error sent back. After that VL53L0X_SetDeviceMode works fine but I seem to have a problem with Setting the limits. Please the code snippet below.

After which I try and do a reading but then I get an error once again.

What am I doing wrong?

Best Regards,

Gary

How do I add a code snippet?

John E KVAM
ST Employee
Posted on February 15, 2018 at 19:19

To add a code snippet, I'd just cut and paste the snippet into the message. At the top, click on the rightmost icon to expand the toolbar. Then you can change the font and indent the code.

That seems to work for me.

>>>After which I try and do a reading but then I get an error once again.

Let me know what you call is and what the error is.

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.