cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1X_SensorInit has an infinite loop that hangs the sensor

nico23
Senior II

The STSW-IMG009 VL53L1X ULD API (Ultra Lite Driver Application Programming Interface) has a bug in the function VL53L1X_SensorInit that blocks the code from being executed if  status |= VL53L1X_CheckForDataReady(dev, &tmp);  write 0 constantly in tmp

The block 

	while (tmp == 0) {
		status |= VL53L1X_CheckForDataReady(dev, &tmp);
	}

has no timeout implemented and, for instance, if a cable or a sensor breaks for some reason, the code will endup stuck there

Please also see this github issue exit VL53L1X_SensorInit() after timeout if no sensor / sensor doesn't work · Issue #29 · sparkfun/SparkFun_VL53L1X_Arduino_Library

where a timeout is added Add timeout to sensorInit · sparkfun/qwiic_vl53l1x_py@1154d07 · GitHub

0 REPLIES 0