cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L7CHV0GC driver not working properly

nnenadic
Associate II

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!

6 REPLIES 6
Zhiyuan.Han
ST Employee

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.

 

ZhiyuanHan_0-1761817014033.png

 

 

Br

Zhiyan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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.

 

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

If this or any post solves your issue, please mark them as "Accept as Solution". It really helps the next guy.
And if you notice anything wrong do not hesitate to "Report Inappropriate Content".
I am a recently retired ST Employee. My former username was John E KVAM.
Zhiyuan.Han
ST Employee

 

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. 

ZhiyuanHan_0-1762251641606.png

Br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
LukeMathew12
Associate II

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!

 
 

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