Bank Swap works on H743 but not H745
I'm having some trouble performing a bank-swap on an STM32H745. The function works perfectly fine on an H743, but when porting over to the H745, it doesn't run the firmware that was swapped in.
Firmware 1: prints "1.0". A button press will trigger a bank-swap & reset
Firmware 2: prints "2.0". A button press will trigger a bank-swap & reset
1. Erase the chip, everything reads 0xFF
2. Flash firmware1.bin at 0x08000000 (bank 1)
3. Press user button to perform a bank swap
4. Banks are now swapped, and 0x08000000 is now empty (0xFF...)
5. Flash firmware2.bin at 0x08000000
6. Pressing the user button continuously will print "1.0" and "2.0" to the console alternately
This sequence works fine on a H743 Nucleo board, but when tried on a H745 Disco board, it will immediately stop working if another firmware is flash after step 4. And any firmware flashed after step 4 will not run until the whole chip is erased with STM32-Utility.
Does anyone know why this is happening on the H745? My only suspicion right now is that the H745 is a dual core (M7 and M4), and after reading the AN5557 manual, it seems like the M4 core is executing at flash address 0x08100000 (bank 2), so maybe it's executing the code that was swapped in from previous bank and caused some sort of timing issue.
I've tried disabling the M4 core by setting the BCM4 option byte to 0 with STM32CubeProgrammer to prevent the M4 core from booting, but no luck. So, I'm curious if there are additional steps required to carry out a Bank Swap on H745.
Currently, I'm using Mbed-OS to do this test.
