2024-05-23 07:51 AM
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 :
And to receive data :
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.
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 !
2024-05-23 08:32 AM
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.
2024-05-24 01:58 AM
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.
Do you have any information on the possible origin of this problem ?
Thx per advance.
2024-05-28 12:17 PM
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.
2024-05-30 02:13 AM
Hello,
Currently i'm trying with a 2.5 MHZ SPI clock but the init is crashing here :