2025-06-10 2:40 AM
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
Solved! Go to Solution.
2025-06-10 12:43 PM
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.
And that const statement goes on for a LONG while.
There are some 20,000 lines in that file.
2025-06-10 7:29 AM
In your distribution, do you not have the SPI example?
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.
2025-06-10 8:23 AM
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,
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
2025-06-10 12:43 PM
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.
And that const statement goes on for a LONG while.
There are some 20,000 lines in that file.
2025-06-10 8:08 PM
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