Cannot read fresh Stm32H723 flash after first program + reset
I have an STM32h723, connected to the STM32CubeProgrammer via SWD. My flash image is 136672B in size and contains code to read the entire flash image, SHA3 it, and then compare that SHA3 to an SHA3 which is located, via linked script + post build scripts, at the end of flash. This code is known to work fine across many Stm32 targets, including this one when the flash image is smaller than 0x0001fec0 bytes.
However, on this stm32H723, that code generates a hardfault (bus fault, BFAR[M] = 0x0801fec0), but *only after the first bootup*. The first bootup it works fine. During investigation, I tried simply writing the image file with stm32cubeprog and then reading it back. If I verify it back right after programming it works fine. If I power cycle the board, then try to verify against the same file, I get the following error: "12:46:41 : Error: Data mismatch found at address 0x0801FEC0 (byte = 0x54 instead of 0x74)"
So both my program code and access to the Stm32 via SWD are showing that flash at this address cannot be read after a single boot cycle. This is a fresh Stm32 out of the tray, and the PCROP start = 0xff, end = 0x00, DMEP = unchecked. ROP is AA. It's my understanding that both of these features would then be disabled?
Any ideas on what is going on here?
Thanks!
