2023-02-08 08:10 AM
Hi, I read the question from 'Peter': VL53L5CX driver vl53l5cx_init() fails in the forum and wonder if downloading the firmware was successful. I am using a Rasberry Pi and used the Unosquare.WiringPi, C#.
There is no methode to write multiple bytes, like requested in the C demo API. So I write every firmware byte separately including the running register address, starting at 0. In the /* Check if FW correctly downloaded */ part, the _vl53l5cx_poll_for_answer returns ok (0). But in the /* Get offset NVM data and store them into the offset buffer */ part, it fails on a timeout.
How can I check if the firmware was downloaded correctly?
Wil the methode writebyte(device_address, register_address, byte) work for the firmware download?
2023-02-17 09:25 AM
This sensor is not going to work if you access it byte-by-byte. First you need to download 83Kbytes to get it started (which woud be possible), but then you need to read at least a couple thousand bytes per range at a minimum. And you'd run out of time.
I find it interesting there is no multi-byte access. Perhaps this is just a teaching environment. A RPi is a full-blown Linux machine so it can do it. I'm thinking that until you write the multi-byte access, you don't have much of a chance.
But to answer your question, yes, your call would work. But the register address has to be a 2-byte address. Lots of small devices only use 1 byte here as they have few addresses.