VL53L8 api init function didin't work, needed additional delay
Hi, I'm hosting a VL53L8CX with a STM32F4, 48-pin instead of the 64-pin on your eval board. There's a 5" flex cable between processor and L8. The vl53l8cx_init() function was failing. Slowing the SPI baud didn't help. Increasing wait time on line 276 of the api file didn't help. The thing that fixed it was inserting a brief delay at line 274 of the api file, which was slightly before you have a delay. Source code snippet below shows my delay.
BTW, I noticed that the .ioc file that came with your ULD has the SPI bus disabled. Did you do some custom monkeying with the HAL SPI driver? I'm using the .ioc and HAL driver, as is, with my application. And it works, as long as I add the delay described here.
status |= VL53L8CX_WrByte(&(p_dev->platform), 0x000F, 0x43);
status |= VL53L8CX_WaitMs(&(p_dev->platform), 1);
status |= VL53L8CX_WrByte(&(p_dev->platform), 0x000F, 0x40);
HAL_Delay(5); //FDT NOV 2024: NEEDS A 1+MS DELAY HERE OR IT WILL WORK THE FIRST TIME BUT NOT AFTER CYCLING POWER.
status |= VL53L8CX_WrByte(&(p_dev->platform), 0x000A, 0x01);
status |= VL53L8CX_WaitMs(&(p_dev->platform), 100);//FDT NOV 2024: DOESN'T HELP TO MAKE THIS 500. NEEDS DELAY ABOVE.
/* Wait for sensor booted (several ms required to get sensor ready ) */
