2021-07-24 05:45 AM
Hello all,
I am using the VL53L1x ultra lite driver from ST. I have 34 VL53L1X devices currently running and two of these devices suddenly would not boot the VL53L1X sensor. Note that this device did work before.
We also have a GSM modem on the board and I have noticed RF interference that affects the sensor. I have therefore opted to switch off the modem before booting the sensor. Note also the extremely long delays when toggling the XSHUT pin.
Basically, the sensorState value stays zero until the watchdog times out (after about 30s). The whole device reboots and the sequence simply repeats.
Why would these 2 sensors (out of 34 running the same firmware) behave like this?
__HAL_IWDG_RELOAD_COUNTER(&hiwdg);
modem_off_on();//modem off
XSHUT_GPIO_Port->ODR &= (~XSHUT_Pin);
HAL_Delay(10000);
XSHUT_GPIO_Port->ODR |= XSHUT_Pin;
HAL_Delay(5000);
status = VL53L1_RdByte(DEV, 0x010F, &byteData);
status = VL53L1_RdByte(DEV, 0x0110, &byteData);
status = VL53L1_RdWord(DEV, 0x010F, &wordData);
while (sensorState == 0) {
status = VL53L1X_BootState(DEV, &sensorState);
HAL_Delay(2);
2021-08-18 01:26 PM
That's an odd one. I have no idea.
One wonders what would happen if you ignore the BootState and simply continue.
The sensor takes under 1ms to boot, so it should be up 1ms.
So one might guess that your toggling of the XSHUT line did not go as planned.
One might check the 'status' from the return of the call to BootState. Perhaps the I2C has failed somehow?
Noise on the I2C line can case a 'bus stuck low' issue that takes down the I2C.
But that is all I can think of.