2025-07-07 3:06 PM
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
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
2025-07-14 8:30 AM
Bump
2025-07-15 2:48 AM
Hi
Form you information you shared, I think two points to be checked.
1st is the offset calibration, you are using Zoer distance calibration, which is not proposed by default, we suggest you use VL53LX_PerformOffsetSimpleCalibration, put the parameter CalDistanceMilliMeter the correct distance when you do offset calibration.
refer to A guide to using the VL53L4CX Time-of-Flight sensor with extended distance measurement - User manual
2nd thing is your I2C link is 66cm, which could be too long, the I2C signal will be degraded with the link increase, you can use an oscilloscope to check the I2C VS the I2C SPEC.
Br
Zhiyuan.Han
2025-07-15 6:12 AM
Good Morning Zhiyuan,
Thank you for your suggestions, I have tried using the Simple calibration as well which gave the same results.
If I ignore the error from the calibration, I am able to read and get valid data from the sensor. I do not believe it is the link length. I have the same board with an array of VL54L4CD sensors, and they perform normally, including calibration. Any other suggestions on the matter would be greatly appreciated!
Best,
Ivaylo
2025-07-16 4:01 AM
Hi
Good to hear you can get ranging result when you ignore the error from the calibration.
As I don't know you patch meaning detail, can you just do a quick test with single sensor, disable the calibration and patch and settings
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); ->VL53LX_StartMeasurement()
is it works fine?
Br
Zhiyuan.Han