# ToF examples fail on 5.0.1 and latest development firmware

**URL:** <https://forums.openmv.io/t/tof-examples-fail-on-5-0-1-and-latest-development-firmware/11903>\
**Category:** OpenMV Boards\
**Created:** [October 18, 2026, 11:24am UTC](https://forums.openmv.io/t/tof-examples-fail-on-5-0-1-and-latest-development-firmware/11903 "2026-10-18T11:24:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![biasedlogic](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@biasedlogic](https://forums.openmv.io/u/biasedlogic)\
**Post date:** [October 18, 2026, 11:24am UTC](https://forums.openmv.io/t/tof-examples-fail-on-5-0-1-and-latest-development-firmware/11903/1 "2026-10-18T11:24:27Z")

</div>

Hi,

When I try running the ToF examples (whichever one) on the AE3 with either the ‘latest release’ (5.0.1) or the ‘latest development’ firmware, the camera hangs, after some time USB reenumerates with an ‘this USB device does not work properly’ message → I need to reboot the camera.

The minimum feasible example below works, even though it takes some time to start:

```python
import tof
tof.init()
while True:
    try:
        depth, dmin, dmax = tof.read_depth()
        print(depth)
    except RuntimeError as e:
        print("tof error:", e)

```

It seems that the issue is with the output visualisation routines / snapshot of tof:

```python
# Scale the image and belnd it with the framebuffer
    tof.draw_depth(
        img,
        depth,
        x_scale=img.width() / 8,
        y_scale=img.height() / 8,
        hint=image.BILINEAR,
        alpha=100,
        scale=(0, 4000),
        color_palette=image.PALETTE_DEPTH,
    )

```

or

```python
try:
        img = tof.snapshot(
            vflip=True,
            hmirror=True,
            x_scale=IMAGE_SCALE,
            y_scale=IMAGE_SCALE,
            hint=image.BILINEAR,
            scale=(0, 4000),
            copy_to_fb=True,
            color_palette=image.PALETTE_DEPTH,
        )

```

- → running these crashes the camera immediately

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [October 18, 2026, 8:35pm UTC](https://forums.openmv.io/t/tof-examples-fail-on-5-0-1-and-latest-development-firmware/11903/2 "2026-10-18T20:35:11Z")

</div>

That’s this issue: [ports/alif: Pass the GPU CLUT by its local address. by kwagyeman · Pull Request #3288 · openmv/openmv · GitHub](https://github.com/openmv/openmv/pull/3288)

We should have a fixed merged soon.
