New Firmware/IDE Script Issue - H7 R2 - RuntimeError: Frame size is not supported or is not set

All last year I was running a script to do detection. I recently updated the firmware on my board and now the script won’t run with the error “RuntimeError: Frame size is not supported or is not set.”

The relevant bit of code is pasted below. Just to reiterate, this code worked on the H7 R2 all last year, and now it will only work on our PLUS boards. I’m also not sure what version of the firmware was the working one.

Was there something changed in the firmware that would have broke my script? Is it anything I can work around or edit? Just really trying not to spend another $600 on cameras. Thanks in advance for any help!

windowing = (390,180,320,240)

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.WXGA)
sensor.set_windowing(windowing)
sensor.set_framerate(10)
sensor.skip_frames(time = 2000)
sensor.set_auto_exposure(False)
sensor.set_auto_gain(False, gain_db = 3)
sensor.set_auto_whitebal(False)
sensor.skip_frames(time = 100)

Hi, the H7 could never support WXGA… I’m not sure how that code was working.

That is generated when it doesn’t pass the DMA rules: openmv/src/omv/ports/stm32/omv_csi.c at master · openmv/openmv · GitHub

dma_line_width_bytes is 1280*2=2560

Which is greater than the line buffer size of 3KB / 2. The line buffer has always been the same 3KB and that code is over 3 years old.

You can get around this by increasing the line buffer DMA size here: openmv/src/omv/boards/OPENMV4/omv_boardconfig.h at master · openmv/openmv · GitHub

You know… I’m not sure either but it definitely did lol
And that was with the code posted and no other modifications of anything. I’ll look at increasing the DMA size, but ultimately I might just buy new cameras. We prefer to keep stuff as OTS as possible since that makes troubleshooting much easier.

And are you saying the H7 PLUS also shouldn’t support WXGA (because the code works on that one as is)? Or just the H7 R2?

Just want to make sure I’m not going to hose myself if I buy 4-5 more cameras.

The line buffer size has always been 3KB on the H7 R2. This allows for two lines of 640 RGB565 (1280 bytes) buffers.

Our DMA accelerated cropping pipeline only crops on the image start/line_count in hardware. The length of a line in pixels of the uncropped resolution must be fully received. The secondary DMA controller will then copy just the x_start/x_end of the buffered lines to the final image.

As for why the code needs to receive a full line even if it’s cropped… I remember this has something to do with the behavior of the primary DMA master acting up when the line length gets too short, and crashes happen. I remember exploring making the line length dynamic based on the crop size and kept running into problems and crashes. The current implementation is what is reliable and works with 100% CPU offload for receiving the image.

The H7 Plus supports a line buffer size of 11KB: openmv/src/omv/boards/OPENMV4P/omv_boardconfig.h at master · openmv/openmv · GitHub for two 2592 RGB565 line buffers. So, it can handle 5MP resolutions.

1 Like