2025-06-17 2:48 AM
Hi All,
we are currently working with both the VL53L5CX and L7CX ToF-Sensors.
In EMC testing, there are sometimes occurences of the statuses TIMEOUT_ERROR and CORRUPTED_FRAME during the acquisitons (via the Vl53lxcx_get_ranging_data uld function).
If these statuses occur, the only thing that gets the sensor back to measuring correctly seems to be a full power-on reset. Otherwise, all uld functions like get_ranging_data or get/set anything keep returning the same error code. Just resetting the i2c by toggling I2C_RST does not seem to do the trick.
My question is now: is there another way to recover from these error state of the sensor? Especially one that does not require downloading the sensor firmware again?
Thanks in Advance!
2025-06-17 3:28 PM
Corrupted_frame and timeout errors are not VL53L5 errors, but errors on the I2C bus.
The I2C bus is not very forgiving. if you do anything wrong it basically stops.
One solution is to send 8 clocks on the Clock line. This generally completes anything the sensor is looking for and you can start the transmission over.
With a stuck bus the symptom is that either the clock or the data (or both) is held low. When not in use, both lines should be high. Google 'i2c bus stuck low' for lots of information.
But the best solution is to not get into this trouble in the first place. Choose pull-up that pull the line up cleanly without too much overshoot. Limit capacitance on the bus. Shorter wires - or traces can help a lot. Twisted pair helps.
There are a zillion things that the internet will suggest but want you want to limit is noise on the bus.
It's that noise that is causing your issue. Fix that.
- john