Possible bug in VL53L5CX, possibly due to outdated firmware

Hi, I’m using the VL53L5CX with the Pimoroni library as downloaded a few days ago.

What’s happening is this: when distance ranging, individual cells in the grid will capture a value within range, but if subsequently a specific cell doesn’t get a reading within range it will when queried return the old value. So if I wave my hand in front of the sensor, some of the grid cells will retain the image of my hand for as long as 20-30 seconds, IFF the background distance is outside the sensor range.

The proper behaviour would be to either return the max range for the device (4m) or a None. Returning the old value is effectively indicating a ghost object at that location that doesn’t exist, and there’s no workaround at the Python level for this; the sensor is sending back an erroneous signal. The sensor will over the course of 20-30 seconds gradually clear itself of most of these ghost values, but sometimes one or two may hang around even longer.

In communicating with some other people using this sensor (not using the Pimorini product I believe), they don’t report this behaviour. I’m not sure if this is at the firmware level or in the C code. I don’t believe it’s in the Python as shutting down the script and restarting it within a few seconds one can still see those ghost values from the previous session.

I note that the version of the firmware in the SparkFun Arduino library (vl53l5cx_buffers.h) has a version number of MM1.1, whereas the ST repo currently has a version labeled MM1.2. I can’t find the firmware file in the Pimorini Python library so I’m not sure of the version, or how or where it’s being found and loaded by the sensor during startup.

Any help on this would be most welcome. I can’t really use the sensor as-is given it is indicating obstructions that aren’t there.