@ukzw wrote:
I met exactly the same problem. By step-in to __main assembly, found the reason is that, __scatterload is trying to copy variables from load address to exec address, which include copy to external SDRAM (0xd0000000), but at this time, external SDRAM not initialized yet, this caused hard fault.
You need that SDRAM is initialized before calling the main() otherwise you will fall in Hardfault.
You can refer to the X-CUBE-H7-PERF
and see how the scatter file under: Projects\STM32H743I_EVAL\stm32h7x3_cpu_perf\MDK-ARM\scatter_file\6-M7-ITCM_rwExtSDRAM.sct
and the SDRAM is configured in SystemInit_ExtMemCtl() in system_stm32h7xx.c are made: need to activate the definition of DATA_IN_ExtSDRAM
And becarefull if you are trying to execute from 0xD0000000, you will fall also in a fault as that region is Execute-Never as described by ARM. So you need to disable it with MPU.
