Skip to main content
Associate II
May 23, 2024
Question

VL53L8CX : firmware loading over SPI fails with timeout

  • May 23, 2024
  • 2 replies
  • 1552 views

Hello,

I'm currently using VL53L8CX with an STM32U535 on a custom PCB.

I'm using X-CUBE-TOF1 package.
I'm able to identify the sensor with SPI at 2MHz using vl53l8cx_is_alive function.

I was able to successfully init and use VL53L8 on U-585I-IOT02A dev board with the same code.

there is my function to send data throught SPI :

josselin_1-1716475677011.png

And to receive data  :

josselin_2-1716475706691.png

 

The problem is in function vl53l8cx_init.

There is timeout in various function depending on SPI frequency and apb frequency

timeout can come from this line (325) or from _vl53l8cx_poll_for_mcu_boot function.

josselin_0-1716474997218.png

Often timeout appear at the third occurrence of _vl53l8cx_poll_for_mcu_boot function.

I'm clearly lost in the search for the causes of this problem. I tried to increase or decrease the SPI frequency but this only change the line where the timeout occurs.

 

I remain available for any further information.

Thx for every kind of help !

 

2 replies

Anne BIGOT
Technical Moderator
May 23, 2024

Hello,


Indeed, there was an issue within the version of the ULD embedded in the current version of the X-Cube-TOF1.

The bug has been fixed in the latest version (v1.2.2) of the ULD available here

A new version of the X-CUBE-TOF1 embedding this version of the ULD is planned in the coming months. 

Meanwhile, if you want to fix the issue you can copy all the files from the ULD drivers : STSW-IMG040\VL53L8CX_ULD_driver_1.2.2\VL53L8CX_ULD_API\ inside the Drivers\BSP\Components\vl53l8cx\modules\ repository of the X-CUBE-TOF1.

 

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'
josselinAuthor
Associate II
May 24, 2024

Hello,

Thank you for this information.

When i use this new version on the B-U585I-IOT02A board all work correctly but all was working before i change files for this newer ULD driver.

But on the U535 board there is a new error..

In the newer version of vl53l8cx_api.c crc_checksum always equal 0.

josselin_0-1716540796409.png

Do you have any information on the possible origin of this problem ?

 

Thx per advance.

John E KVAM
ST Employee
May 28, 2024

Let's open a new problem. But can you try speeding up the SPI bus. There was an issue with the really slow SPI speeds just not being fast enough. 

 

josselinAuthor
Associate II
May 30, 2024

Hello,

 

Currently i'm trying with a 2.5 MHZ SPI clock but the init is crashing here :

josselin_0-1717060350172.png