I am porting some firmware from STM32F2 to STM32H743 which is known working good on STM32F205.
I am trying to reprogram internal FLASH on BANK1 while executing code from internal RAM. All routines needed in flash.c and sflash.c are placed in section .fast which is located in AXISRAM and copied at startup from FLASH to RAM.
Reading from USB memory, writing to external serial FLASH (sflash routines in RAM) works fine. After erasing the first sector using flash_EraseSector() the system crashes. I can verify that the first sector is erased using the debug tool.
Can there be a problem with cache? I am a bit lost. I have used this methode on both STM32F2, F4 and F0. Any ideas what could be wrong?
1) The main problem has been a debugger setting in Rowleys Crosswork, "RAM Software Breakpoints" should be set to "Disabled" for the STM32H743 specially when debugging code stored in RAM.
2) Since all code used during reprogramming FLASH is in RAM no calls to HAL routines can be used. (I know it could be solved more elegant and safe with switching between FLASH banks)
I attach some working files.