cancel
Showing results for 
Search instead for 
Did you mean: 

vl53l8ch ULD driver for SPI interface?

Rolandash
Associate

Hello community,

I just downloaded ULD driver for vl53l8ch. However it looks only i2c interface is implemented in the driver, no SPI interface related is present. 

Is there a SPI version of the driver available? or I missed something?

 

Thank you.

/Roland

 

1 ACCEPTED SOLUTION

Accepted Solutions

Here's the trick...

The VL53L8CH is a derivative of the VL53L8CX, so to figure out how the SPI works, examine the CX code. 

The folks doing the CH focused on the histogram and did not port all the other examples from the CX when they made their delivery.  

So, steal everything you need from the CX code and bring it across to the CH code base. It will work just fine.

1. Isn't VL53l8CH preloaded with firmware on shipping from factory? - No. One has to download the firmware at boot. On the L5 chip, we made a mistake and decided to go into production with downloadable code. And it worked out well for us. We were able to add feature for our best customers and fix bugs. So, on the L7 and L8 we kept the 'feature'.

2. Does the firmware need to be loaded every time on initialization? Yes. Every single boot.

3. I did not find the firmware binary file in IMG043 package. Where should I get this binary file?

The binary file is actually tucked into a .h file. 

JohnEKVAM_0-1749584510442.png

And that const statement goes on for a LONG while.

There are some 20,000 lines in that file.

 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

View solution in original post

4 REPLIES 4
John E KVAM
ST Employee

In your distribution, do you not have the SPI example?

JohnEKVAM_0-1749565374498.png

It shows how we did it for the STM32F401RE, but to use it, you have to insure the jumpers are set the correct way. 

To really dig into how SPI works, you need the documentation on the STM32F401RE, or whichever MCU you are using. But this example was in my 2.0 version. 

As 99% of the SPI software is on the MCU this example is about all we have. 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
Rolandash
Associate

Hi John,

Thank you for the quick answer!

I am on a MacBook computer so ST's IDE is not available for me. What I have downloaded is the STSW-IMG043 for VL53l8CH from ST's official website link, and below screenshot is what I got after unpack the downloaded package,

Screenshot 2025-06-10 at 8.00.57 AM.png

The version seems to be v2.0.10, however I browsed all directories and unfortunately no signs of SPI examples, Perhaps VL53l8CH driver package is different from VL53l8CX?

The targeting MCU is a stm32H7 processor. What I needed from the driver is the SPI read/write command frame format for porting the code to selected RTOS, as these are not specified in VL53l8CH's Datasheet or user manual, only I2C interface is described somewhat there. But an example can be also good enough to carry on the wok. 

Beside, from the user manual I read that during initialization of VL53l8CH, the host needs to push binary firmware to VL53l8CH. I got few questions about this:

1. Isn't VL53l8CH preloaded with firmware on shipping from factory?

2. Does the firmware need to be loaded every time on initialization? or is there some way to check existence and skip if already loaded?

3. I did not find the firmware binary file in IMG043 package. Where should I get this binary file?

Thank you for the support.

/Roland

 

 

 

Here's the trick...

The VL53L8CH is a derivative of the VL53L8CX, so to figure out how the SPI works, examine the CX code. 

The folks doing the CH focused on the histogram and did not port all the other examples from the CX when they made their delivery.  

So, steal everything you need from the CX code and bring it across to the CH code base. It will work just fine.

1. Isn't VL53l8CH preloaded with firmware on shipping from factory? - No. One has to download the firmware at boot. On the L5 chip, we made a mistake and decided to go into production with downloadable code. And it worked out well for us. We were able to add feature for our best customers and fix bugs. So, on the L7 and L8 we kept the 'feature'.

2. Does the firmware need to be loaded every time on initialization? Yes. Every single boot.

3. I did not find the firmware binary file in IMG043 package. Where should I get this binary file?

The binary file is actually tucked into a .h file. 

JohnEKVAM_0-1749584510442.png

And that const statement goes on for a LONG while.

There are some 20,000 lines in that file.

 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
Rolandash
Associate

Thank you John, for the detailed answer. It explained everything.

I have started looking into the code. I will pop another post if I encountered other problems.

 

/Roland