RuntimeError: Sensor control failed on sensor.set_framesize()

Hi, I am using a Portenta that works fine when I run the following example code:

import sensor, image, time

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)

clock = time.clock()

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

but gives me an error when I change frame_size argument to sensor.set_framesize(sensor.B320X320) to the code. I’ve used this before without issue but this has started happening suddenly. Can somebody please advise on how to fix the issue and why it could be happening in the first place?

PC

Which sensor are you using? And are you using the latest firmware?

I’m using the camera. Yes, the firmware is up to date (4.5.9)

I also sometimes just get the same RuntimeError on sensor.reset(). It occurs quite randomly and sometimes reconnecting the Arduino fixes it.

PC

Which one? The IDE should tell you which one when it connects.
I remember this issue, it was caused by the camera shield missing a reset line, so the sensor some times got stuck on reset. This should have been fixed though.