Skip to main content
OKN
Associate III
October 21, 2026
Question

[STM32MP257F]  Using the ToF Sensor (VL53L5CX) with OpenSTLinux

Hello

 

I’m planning to try using the ToF sensor (VL53L5CX) on the B-CAMS-IMX (MB1854B) with OpenSTLinux on the STM32MP257F.

Looking at the kernelconfig,
> Device Drivers > Industrial I/O support > Proximity and distance sensors
lists “STMicroelectronics VL53L0X ToF ranger sensor (I2C)”;

 

can I use the VL53L5CX with this driver?

 

Or would it be better to use this driver instead?

Linux driver for VL53L5CX multi-zone sensor

 

For now, before I set up a device driver,
I’m planning to try accessing it via the I2C driver using Ultra Lite Driver (ULD) for VL53L5CX multi-zone sensor

 

Best Regards,

--
okn

1 reply

Graduate
October 21, 2026

The VL53L5 (L5) is significantly different from the VL53L0. There are a lot of years and a lot of flexibility between them. 

First the L0 uses single byte I2C register addresses - and a page register. Not ST’s fault. They built the chip basically to one customer’s specification, and he thought it was too much hassle to have a different I2C driver that uses 2-byte register addresses. But there are a LOT of registers, and this was a real problem. So ST fixed the issue on the VL53L1 and beyond. 

There are a lot of reasons the old driver won’t work for the new parts, but this is the biggest issue.

So you have two choices.   

If your device is closed enough that you don’t need to protect the devices on the I2C bus from users, you can address the sensor with user mode I2C commands. Just download the driver from ST.com and change the functions in platform.c to issue Linux I2C reads and writes. 

But if you are building something like a cell phone, and you really don’t want user mode routines to have access to your I2C bus, you are going to have to work harder. 

But it’s been done before. 

There is a cool post from a guy - 

Where he published his work. You might be able to just take this. 

Or there are others on GitHub you can look at. 

But basically these drivers are installed at bootup and take requests from the usermode program and vet them to only allow control to the L5 on the I2C bus and basically protecting the other devices on the bus from harm. 

good luck - 

  • 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."