Snapshot() - h7plus randomly hangs firmware 4.5.5

Updated to firmware 4.5.5.
Never had this issue before. (Up to incl 4.5.3)
H7 Plus with global shutter.

Happens with and without ide connected ( . Monitoring serial with or without ide (putty).

Simply taking snapshots at HQQQVGA fixed exposure 2700 grayscale and writing to a sdram stream.

Isolated the issue to the snapshot function.
Trying to catch an exception but no exception is thrown. Doesn’t happen with older releases. (1.1 MB)

Can you test this firmware?

I discovered this bug: ports: Fix accidental CPU cache invalidation. by kwagyeman · Pull Request #2232 · openmv/openmv (

However, it should just corrupt the image, not hang the system.

The only other commit that could be causing this is: ports/stm32: Reset vbuffer state when dropping frames. · openmv/openmv@64b2708 (

Loaded firmware you sent. No issue. Reloaded 4.5.5 - No issue. Dumbfounded Maybe the firmware was corrupted. It did happen randomly (1 out of 10 runs or 3 seconds) but did 30 each and no issues.

Will monitor and report back if occurs again. Never happened since I’ve been using this setup. I am an affectionate user since 2020.

Thanks for your quick support.

Yeah, just keep in mind that your FPS may be on the limit of what the STM32 can handle. You might need to adjust the horizontal sync time in the camera driver with that resolution.

See here: openmv/src/omv/sensors/mt9v0xx.c at master · openmv/openmv (

If the horizontal blank time becomes too small things go bad. HQQQVGA is a very small resolution.

Very interesting. I switched from QQQVGA to HQQQVGA some months ago because I saw I got some extra FPS.

I adjusted and calibrated positioning of the camera and have built tflite models and there is no go back now.

Would the high FPS cause the processor to hang sometimes ?

If so to ensure robustness Id like to follow your suggestion and try.

I looked to the sensor data sheet. Are you suggesting to increase these?

Horizontal Blanking (Context A): Register 0x05
Address: 0x05
Description: Number of blank columns in a row.
Default Value: 94 pixel clocks (0x5E)
Legal Values: 61–1023
Type: Read/Write
Shadowed: Yes

||•|Horizontal Blanking (Context B): Register 0xCD|
||•|Address: 0xCD|
||•|Description: Number of blank columns in a row.|
||•|Default Value: 94 pixel clocks (0x5E)|
||•|Legal Values: 61–1023|
||•|Type: Read/Write|
||•|Shadowed: No|

Can is add this line before returning the init function? Would you increase the values?

ret |= omv_i2c_writew(&sensor->i2c_bus, sensor->slv_addr, 0x05, 0x5E); // Adjust as needed

ret |= omv_i2c_writew(&sensor->i2c_bus, sensor->slv_addr, 0xCD, 0x5E); // Adjust as needed

return ret;


Is there any chance you can add a feature to access and modify those parameters via python script? Ideally when setting HQQQVGA one would like to have settings which STM32 could handle.

sensor.__write_reg() and sensor.__read_reg()

You can write whatever python code you like to modify registers.

Do this before calling snapshot() as that starts the DMA stuff and image capture. But, after doing any other sensor setup.

Note that skip_frames calls snapshot internally.