Showing results for 
Search instead for 
Did you mean: 

STM32F429: hardfault when moving heap and stack on SDRAM

Associate II
Posted on December 25, 2015 at 13:08


I am using STM32F429 based board with IAR tool chain for compilation. I have tested SDRAM using test program and its working fine. Now I want to move heap, stack and all readwrite variables on SDRAM hence updated default icf file. Please find attached icf file.

I have also defined DATA_IN_ExtSDRAM in system_stm32f4xx.c 

But I get hardfault interrupt after SystemInit().

Can you please help understanding whats going wrong in this icf file.




Posted on December 25, 2015 at 15:09

The initial stack pointer described in the vector table CANNOT point to SDRAM, it's not initialized when the processor starts.

If it Hard Faults after SystemInit() perhaps you need to be looking at that code rather than the .ICF? Perhaps you're not initializing the SDRAM properly? You'd want to double check that before using it.

I'm also at a bit lost as to the benefits of using the SDRAM for the STACK, as it's significantly slower, and will slow the execution of all your subroutines and local/auto variables.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..