cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L8CX firmware loading over SPI fails if it takes too long?

kwc
Associate III

Hi, I ran into a weird issue initializing a VL53L8CX over SPI where the firmware was seemingly failing to load correctly (the firmware checksum was wrong, and trying to read back some of the firmware from the sensor showed that it didn't match the data that was written). I found that I could get it to work if I increased the SPI frequency from 0.5 MHz to 2 MHz, and the threshold between working and not working seemed to be at around 1.1 MHz.

 

After experimenting a little more, I observed that it didn't seem to be the SPI frequency itself that matters, but rather the time that it takes to download the firmware - for example, it will fail if I add a 300 ms delay in

vl53l8cx_init() just after the comment "Download FW into VL53L8CX". It seems like the firmware download needs to finish within about 600-650 ms or it will fail.
 
This isn't a problem when using the VL53L8CX with I2C - it works even with 100 kHz, which takes much, much longer than 600 ms.
 
Can anyone confirm whether this is a real issue that effectively limits the VL53L8CX to SPI frequencies higher than about 1.1 MHz? (I am using ULD API 1.2.0)
2 REPLIES 2
Zhiyuan.Han
ST Employee

Hi kwc,

 

I did a same test and confirmed your finding, If I add delay, the sensor initiation will fail(time out). I will check this point with our R&D team. 

For your case, I suggest you go ahead for your project, config your SPI speed to avoid such failure. 

 

/* Download FW into VL53L8CX */

HAL_Delay(400);

status |= WrByte(&(p_dev->platform), 0x7fff, 0x09);
status |= WrMulti(&(p_dev->platform),0,

 

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.
kwc
Associate III

Hi, do you have an update on whether there is a solution or workaround to allow a slower SPI frequency to work?