2017-10-04 10:00 PM
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 0x800c44aThe 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); // FAILSI'm communicating fine with the device with I2C.
#vl53l0x2018-01-02 08:02 AM
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
2018-02-11 12:17 PM
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?
2018-02-15 10:19 AM
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