Skip to main content
kwc
Associate II
January 6, 2024
Question

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

  • January 6, 2024
  • 2 replies
  • 5402 views

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)
This topic has been closed for replies.

2 replies

Zhiyuan.Han
Technical Moderator
January 8, 2024

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
kwcAuthor
Associate II
January 30, 2024

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

Anne BIGOT
Technical Moderator
May 7, 2024

Please check the latest version o the package.

It may solve your issue.

 

Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised. ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'