2025-10-28 1:53 AM
Hi everyone,
I’m having issues with the VL53L7CHV0GC ToF sensor drivers on Linux. The kernel module loads fine, but I can’t read any data using the userspace part. When I try to use the driver completely in userspace mode, it reports that it can’t find the device on the bus, even though the device is physically present and visible on I²C.
I use official sources from STMicroelectronics website.
Has anyone encountered the same issue or maybe has a newer / fixed version of these drivers that works correctly?
If not, at least a detailed datasheet with the I²C register description - which also doesn’t seem to be available online - would be really helpful, so we have a chance to write our own drivers.
Thanks in advance!
2025-10-30 2:40 AM
Hi
You can try to debug with user space first; make sure you are using the correct I2C bus number in the code according to you HW connection.
you can use i2cdetect -r -y 1 command to check if the device is well detected.
Br
Zhiyan.Han
2025-10-30 4:24 AM - edited 2025-10-30 4:24 AM
Did that already. It's still failing. Device is visible on i2c bus using i2c-tools.
I manage to load kernel driver and to compile userspace part of driver by enabling kernel support via Makefile.
Then I tried to run test program 12, it fails with: "VL53LMZ ULD Loading failed".
Without kernel driver by using just everything in userspace it also fails with similar message.
2025-10-31 1:42 PM
This sensor has no embedded code. At boot you basically get an I2C interface and nothing else.
The first thing one needs to do is download the 80K program. It's part of the initialization process.
So perhaps it's that download that is failing.
Not every processor can handle the admittedly huge I2C writes that are in the code.
I'd start there. Examine each of the I2C writes in the Initialization function. Make sure they succeed.
And if they do not change all the writes into smaller chunks.
- john
2025-11-04 2:23 AM
Hi
Your basic I2C read function should works as long as there is no error from vl53lmz_is_alive().
you can check you I2C signal or debug low level of I2C write, as inside vl53lmz_init(), there is 86K bye FW writing as John mentioned, so the error could come from I2C big data writing.
Br
Zhiyuan.Han
2025-11-05 3:23 AM
Thanks for outlining all the details having the driver for the VL53L7CHV0GC sensor not working properly is definitely a roadblock. A few suggestions: make sure you’re using the latest firmware version along with the correct API set for that sensor generation, and double‑check whether any initialization or calibration steps were skipped (sometimes subtle changes in newer sensors cascade into driver behaviour). For extra reading and community input, you can see the full thread here: https://community.st.com/t5/imaging-sensors/vl53l7chv0gc-driver-not-working-properly/td-p/851348 /it might spark an idea or workaround someone else uncovered. Hope you’re able to get it sorted soon!
2025-11-05 4:50 AM
I also have feeling performance is issue. On NXP kernel everything works on mainline it does not. But all other sensors are working fine on mainline so need to investigate a bit deeper.
Thanks
Nikola