2021-11-22 06:02 AM
I am using the exaple1 ranging basic (VL53L5CX_ULD API ) on microcontroller nrf52840.
during vl53l5cx_init(&Dev) we get stuck on "do while loop" in the below Function (vl53l5cx_poll_for_answer() line number 304 ).
I'm include the I2C driver (Read&Write) and also I attached the image of (where I got stuck with the Function)
2021-12-07 12:23 PM
Generally this happens when the I2C is mis-configured. But you got a ways before you got stuck.
Check the status of the I2C. My guess is the I2C timed out.
But then you have to figure out why the I2C timed out.
NXP (who bought Philips) still has the best info on how to 'tune' the I2C bus.
Might want to start there.
2021-12-07 02:44 PM
Or look here. VL53L5CX is notoriously fussy about I2C read/write.