cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L5CX Initialization Timing (vl53l5cx_api)

JahKMC
Associate III

Currently I'm using some of the vl53l5cx api functions along with some custom code. I plan to have multiple ToFs used and noted, via o-scope, that the initialization function vl53l5cx_init (looks to be blocking code?? correct me if I'm wrong) takes about 2.5 seconds to complete (at 400Kbps I2C) to configure a single ToF. This means with the current initialization it would take more than 10 seconds alone for initialization to complete. 

Unfortunately, I am working in constraints that prevent me from accessing the watchdog to circumvent the issue. 

Are you aware of any ways of overcoming this? I wasn't sure of the initialization sequence was one that could be split.

1 ACCEPTED SOLUTION

Accepted Solutions
Zhiyuan.Han
ST Employee

Hi

Seeing the example code is writing 0x8000 a big size FW, you can split to two 0x4000 block size writing. 

this is just split writing to two times, the total time will be not reduced. 

 

Original code

//  status |= WrMulti(&(p_dev->platform),0, (uint8_t*)&VL53L5CX_FIRMWARE[0],0x8000);

Suggest code

status |= WrMulti(&(p_dev->platform),0,(uint8_t*)&VL53L5CX_FIRMWARE[0],0x4000);
status |= WrMulti(&(p_dev->platform),0x4000, (uint8_t*)&VL53L5CX_FIRMWARE[0x4000],0x4000);

 

 

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.

View solution in original post

4 REPLIES 4
Zhiyuan.Han
ST Employee

Hi 

When VL53l5CX initialization, there is big block of code (around 86KB) was downloaded into the device, and plus some other operation, like reboot, so the total booting time is quite long.

From my side, If I set I2C speed to 400K, it took around 2.2s, if I set to 1M, it took around 1s for single device.

There is no magical way to compress the FW currently, so you can try to speed up the I2C speed or use more I2C bus to make system works faster. 

 

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.

Thank you for the response. Is it possible to split the initialization sequence (i.e. a state machine) to execute a smaller block of code at each clock tick versus having it be a blocking function like it is in its current implementation? 

Zhiyuan.Han
ST Employee

Hi

Seeing the example code is writing 0x8000 a big size FW, you can split to two 0x4000 block size writing. 

this is just split writing to two times, the total time will be not reduced. 

 

Original code

//  status |= WrMulti(&(p_dev->platform),0, (uint8_t*)&VL53L5CX_FIRMWARE[0],0x8000);

Suggest code

status |= WrMulti(&(p_dev->platform),0,(uint8_t*)&VL53L5CX_FIRMWARE[0],0x4000);
status |= WrMulti(&(p_dev->platform),0x4000, (uint8_t*)&VL53L5CX_FIRMWARE[0x4000],0x4000);

 

 

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.

Thank you for the response,  

My goal was to see if I could split it to reduce how long the iic bus is held up to allow for other devices I'm using to initialize at the same time versus having it held up by the ToFs that will be used, not the total time.

I think the solution you provided should suffice for what I'm doing!