cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L4CX Issues

imanushev
Visitor

Hello Everyone,

We have a custom board that utilizes 10 x VL53L4CX sensors, length of board is about 66cm. For context I am using an NRF54L15 with Zephyr. On bootup they are all configured with a different address and an attempt is made to calibrate the sensors as well. I am using the 

I have been testing for a few weeks now and I am constantly running into initialization issues, all revolving around communication to sensors, especially when I am trying to run through a calibration on the sensor. I have tried different calibration methods, but all result in errors. And if I comment out the calibration I would get a Hardware Failure error after a few reads from the sensor. 

My initialization code flow is as follows: 
Shutdown all sensors -> Boot sensor N -> change I2C address -> Wait Device Booted-> DataInit -> PerformRefSpadManagement-> SetOffsetCorrectionMode(STANDARD)->PerformOffsetZeroDistanceCalibration()-> GetDeviceInfo()->SetTuningParameter(PATCHPOWER2)->SetTUningParameter(MERGETHRESH10000)->SmudgeCorrectionEnable(NONE)-> SetMeasurementTimingBudgetMicroSeconds(100000);

When using VL53LX_PerformOffsetZeroDistanceCalibration() I get the VL53LX_ERROR_OFFSET_CAL_NO_SAMPLE_FAIL error.

[00:05:43.644,352] <dbg> VL53LX: vl53lx_initialize: [vl53l4cd10@3C] Initializing 
[00:05:43.647,107] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x3C
[00:05:47.282,863] <err> VL53LX: [vl53l4cd10@3C] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:05:47.283,134] <dbg> VL53LX: vl53lx_initialize: [vl53l4cd10@3C] VL53LX_GetDeviceInfo returned 0
[00:05:47.283,365] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:05:47.283,562] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:05:47.283,766] <dbg> VL53LX: vl53lx_initialize: [vl53lx1@2A] Initializing 
[00:05:47.286,499] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x2A
[00:05:52.095,921] <err> VL53LX: [vl53lx1@2A] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:05:52.096,187] <dbg> VL53LX: vl53lx_initialize: [vl53lx1@2A] VL53LX_GetDeviceInfo returned 0
[00:05:52.096,410] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:05:52.096,602] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:05:52.096,802] <dbg> VL53LX: vl53lx_initialize: [vl53lx2@2C] Initializing 
[00:05:52.099,523] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x2C
[00:05:57.721,579] <err> VL53LX: [vl53lx2@2C] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:05:57.721,846] <dbg> VL53LX: vl53lx_initialize: [vl53lx2@2C] VL53LX_GetDeviceInfo returned 0
[00:05:57.722,072] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:05:57.722,268] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:05:57.722,473] <dbg> VL53LX: vl53lx_initialize: [vl53lx3@2E] Initializing 
[00:05:57.725,219] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x2E
[00:06:01.341,310] <err> VL53LX: [vl53lx3@2E] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:01.341,576] <dbg> VL53LX: vl53lx_initialize: [vl53lx3@2E] VL53LX_GetDeviceInfo returned 0
[00:06:01.341,801] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:01.341,998] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:06:01.342,201] <dbg> VL53LX: vl53lx_initialize: [vl53lx4@30] Initializing 
[00:06:01.344,931] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x30
[00:06:05.347,655] <err> VL53LX: [vl53lx4@30] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:05.347,921] <dbg> VL53LX: vl53lx_initialize: [vl53lx4@30] VL53LX_GetDeviceInfo returned 0
[00:06:05.348,146] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:05.348,342] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:06:05.348,545] <dbg> VL53LX: vl53lx_initialize: [vl53lx5@32] Initializing 
[00:06:05.351,299] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x32
[00:06:09.758,685] <err> VL53LX: [vl53lx5@32] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:09.758,951] <dbg> VL53LX: vl53lx_initialize: [vl53lx5@32] VL53LX_GetDeviceInfo returned 0
[00:06:09.759,176] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:09.759,372] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:06:09.759,576] <dbg> VL53LX: vl53lx_initialize: [vl53lx6@34] Initializing 
[00:06:09.762,306] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x34
[00:06:15.747,776] <err> VL53LX: [vl53lx6@34] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:15.748,042] <dbg> VL53LX: vl53lx_initialize: [vl53lx6@34] VL53LX_GetDeviceInfo returned 0
[00:06:15.748,267] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:15.748,465] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:06:15.748,665] <dbg> VL53LX: vl53lx_initialize: [vl53lx7@36] Initializing 
[00:06:15.751,394] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x36
[00:06:19.365,388] <err> VL53LX: [vl53lx7@36] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:19.365,654] <dbg> VL53LX: vl53lx_initialize: [vl53lx7@36] VL53LX_GetDeviceInfo returned 0
[00:06:19.365,880] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:19.366,077] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:06:19.366,280] <dbg> VL53LX: vl53lx_initialize: [vl53lx8@38] Initializing 
[00:06:19.369,026] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x38
[00:06:24.196,120] <err> VL53LX: [vl53lx8@38] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:24.196,386] <dbg> VL53LX: vl53lx_initialize: [vl53lx8@38] VL53LX_GetDeviceInfo returned 0
[00:06:24.196,611] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:24.196,804] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1
[00:06:24.197,004] <dbg> VL53LX: vl53lx_initialize: [vl53lx9@3A] Initializing 
[00:06:24.199,746] <dbg> VL53LX: vl53lx_initialize: I2C address set to: 0x3A
[00:06:29.016,783] <err> VL53LX: [vl53lx9@3A] VL53LX_PerformOffsetZeroDistanceCalibration return error (-24)
[00:06:29.017,049] <dbg> VL53LX: vl53lx_initialize: [vl53lx9@3A] VL53LX_GetDeviceInfo returned 0
[00:06:29.017,273] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMajor : 1
[00:06:29.017,469] <dbg> VL53LX: vl53lx_initialize:    ProductRevisionMinor : 1

Now if I skip the calibration:
Shutdown all sensors -> Boot sensor N -> change I2C address -> Wait Device Booted-> DataInit -> PerformRefSpadManagement-> SetOffsetCorrectionMode(STANDARD)->PerformOffsetZeroDistanceCalibration()-> GetDeviceInfo()->SetTuningParameter(PATCHPOWER2)->SetTUningParameter(MERGETHRESH10000)->SmudgeCorrectionEnable(NONE)-> SetMeasurementTimingBudgetMicroSeconds(100000);

 

I get the following when reading from the sensor:

[00:00:12.202,170] <err> VL53LX: Failed to read
[00:00:12.202,346] <err> VL53LX: [vl53lx1@2A] VL53LX_WaitMeasurementDataReady return error (-5)
[00:00:12.202,885] <err> VL53LX: Failed to write
[00:00:12.203,210] <err> VL53LX: Failed to write
[00:00:12.203,366] <err> VL53LX: Failed to stop ranging
[00:00:12.403,767] <err> VL53LX: Failed to write
[00:00:12.404,127] <err> VL53LX: Failed to write
[00:00:12.404,284] <err> VL53LX: Failed to start ranging
[00:00:12.454,682] <err> VL53LX: Failed to read
[00:00:12.454,858] <err> VL53LX: [vl53lx2@2C] VL53LX_WaitMeasurementDataReady return error (-5)
[00:00:12.455,396] <err> VL53LX: Failed to write
[00:00:12.455,722] <err> VL53LX: Failed to write
[00:00:12.455,878] <err> VL53LX: Failed to stop ranging
[00:00:12.656,278] <err> VL53LX: Failed to write
[00:00:12.656,637] <err> VL53LX: Failed to write
[00:00:12.656,794] <err> VL53LX: Failed to start ranging
[00:00:12.707,194] <err> VL53LX: Failed to read

I am trying only 2 sensors but they are both failing to read. If I am lucky, I will sometimes get a 

VL53LX_RANGESTATUS_HARDWARE_FAIL

If I change the calibration to SetOffsetCorrectionMode(PERVCSEL)->PerformOffsetZeroDistanceCalibration(100mm) 

It would enter the calibration routine and hang forever inside waiting for the Measurement Data Ready. Again I would assume that it had something to do with the hardware fail I would randomly see as mentioned above.

 

Any help on the matter would be greatly appreciated.

Best,

Ivaylo

 

 

0 REPLIES 0