Sensor control failed

Hi, I’m using Portenta H7 with Vision Shield (LoRa). I am facing a recurring issue with the onboard HM0360 camera: when I interrupt a program using the camera to run another script, it throws a RuntimeError: Sensor control failed. The only way I have managed to fix this as of now is physically reconnect the USB-C connector.

Is anyone else experiencing this? Versions: OpenMV IDE 5.0.0; OpenMV Firmware 5.0.0

PC

Using one of the basic examples as test script:

import csi
import time

csi0 = csi.CSI()
csi0.reset()
csi0.pixformat(csi.GRAYSCALE)
csi0.framesize(csi.QVGA)
csi0.snapshot(time=2000)

clock = time.clock()

while True:
    clock.tick()
    img = csi0.snapshot()
    print(clock.fps())

Another way to band-aid the issue that I just discovered: quickly commenting out csi0.reset() and running to get another error like RuntimeError: Frame buffer error. or RuntimeError: Frame size is not supported or is not set., and then running the original script works. However, I have not always been able to replicate this.

PC

This could also be a particular unit’s issue since I am not facing this problem in other Portentas with me :confused:

PC

I’ll run a regression on my HIL… but, this should normally be stable. So, it’s likely a board issue.

Thanks, looking forward to hearing from you…

PC

Hi, I get a Lora shield on Thursday. I have the other vision shield right now.

From Claude testing on the bench:

Ran 150 stop/run cycles on a Portenta + Vision Shield here (same script, Ctrl-C at random points, with and without a soft reset between runs). Zero failures. The HM0360 driver and the reset path haven’t changed since 5.0.0.

The Portenta has no reset/power line to the HM0360, so csi.reset() is just an I2C soft reset plus a poll for standby. “Sensor control failed” there means the sensor stopped answering on I2C. Firmware can’t do anything about that, which is why only replugging USB fixes it. That’s a hardware fault on that one shield/board. Swap it.

This is with the not LoRa shield though. I’ll retest when I get it.

Got ya! That makes sense and I am fairly convinced since this is what I’m experiencing too.

PC

From Claude - this time I used a board with a LoRa shield now.

Ran your exact script on my Portenta HIL node on 5.0.0: 270 stop-and-rerun cycles with the interrupt landing everywhere from inside csi.reset() to steady streaming. Zero failures. The reset path is solid on that firmware.

What line raises the error for you, and what does the other script do? On the HM0360 “Sensor control failed” is exactly what you get from set_pixformat(RGB565) — it’s a mono sensor and most examples default to RGB565. Switch those to GRAYSCALE and see if the error goes away. If it’s really your grayscale script failing on reset() and other Portentas are fine, it’s that unit.

…

So, yeah, it’s probably a bad board.