I would now like to upgrade to the latest version, preferably by installing OpenWRT also to partition 1, which currently holds the stock firmware.
Unfortunately, when I try to flash from OpenWRT, the process starts but never completes. After waiting for 20minutes I power the device off and on, after which it boots back to the old OpenWRT partition and partition 1 still has the stock firmware.
Which image version (factory or sysupgrade) should I be using when I flash from OpenWRT but the target partition has stock fw? I have tried with both, but result is the same.
Yeah, those should be the right images.
(And the contents of the other partition should make no difference. Either OEM or OpenWrt there is equal to the process.)
For WRT3200ACM sysupgrading from 22.03.0 to 22.03.2, actually both images should work:
Sysupgrade image is the correct image, but
also the factory image should work if you override the image check that should fail and warn you.
How was your original plan to install it on partition 1?
Every time you install a system update the current working partition is moved to the other partition. So if you make a system upgrade in this case in your working openwrt partition 2, the old openwrt partition 2 becomes partition 1. And the upgraded openwrt becomes partition 2.
If you want to keep OEM you need to switch to the oem partition and install a OpenWrt factory image there. And oem goes to the other partition 2 and openwrt on partition 1.
This switching is handled automatically in hardware.
The "current" partition stays as it is. Nothing is copied/flashed to it.
New firmware is flashed to the other "Alternative" partition (overwriting the other firmware there) and settings from the current OpenWrt firmware are attached to that.
U-boot env flags are modifed so that the booting switches to the new firmware.
Partition numbering remains constant, just the booting selection varies.
That strategy holds true to both OpenWrt and OEM firmwares.
There are every now and then some similar trouble with mvebu dual firmware devices. As there are two bootflags that need to be set in sync, it is possible that sometimes you may end up with them mixed.
See e.g. discussion in
You need to check both the env variables are correct and in agreement as per the script in the linked thread. If on the CLI using sysupgrade can you get any extra output using verbose mode on a flash.