Firmware update using python script

I’m using OpenMV H7 plus for a project and I need to upload the firmware (only .bin) from command line by using a python script.
I found the pyopenmv.py file in the git folder and I’m wondering if it is possible to use this module to perform the update,

The idea is to extract source code from IDE ( connectClicked ), write a python script and use pyopenmv.py as library.

However, if there were more direct ways it would be better.

Thank you!

We need to make a script for this… but, right now there isn’t one. You have to copy what the IDE does from the IDE source code right now.

I’m using ‘‘pyopenmv.py’’ but I have problems when using the ‘‘bootloader_start()’’, ‘‘flash_erase(sector)’’ or ‘‘flash_write(buf)’’ functions. The first ones doesn’t return any bootloader_version but I have an error for empty array of byte. The other ones do nothing when I try to pass sectors or binary extracted from IDE.
Other functions as ''fw_version" or ‘‘reset’’ work instead.
Have you checked that the script works?

When I try to flash openmv.dfu in DFU mode another problem occurs. I’m using OpenmvIDE but the process doesn’t end. I verify that there is an error at 43% during the flash of the second address (0x08040000). I have same problem with different platform. Is it a common problem?

Thanks for your help!

You can’t flash the STM32H743 with SDRAM via DFU. ST changed the bootloader hard flashed into the chip and broke all tooling. There’s no fix for this. No DFU tools work anymore to load the whole firmware.

You can only flash the bootloader (bootloader.dfu) then after that you need to use our bootloader code to load the system.

Regarding the bootloader stuff in the pyopenmv.py script. It only works when the camera is plugged in when the green light is flashing. You have to connect then. I suggest reading the IDE code as pyopenmv.py isn’t used really.