This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32f429: problem with using external SDRAM as an additional data memory

Hi,

I can read/write an external sdram using fmc in stm32f429. But working with address and read/write functions is not proper for my purpose. I want to introduce external sdram as if internal sram is clearly extended and whenever I define a big variable it is projected to external sdram automatically.

I checked stm32f4 cubemx repository examples (SDRAM+DATAMEMORY) and searched a lot but it seems this is not straightforward.

Following these steps based on what I found, I get hardfault after system_init.

1) Defining external sdram address and size in the linker (off-chip ram)

2) Adding some code in startup_stm32f420xx.s

3) Defining DATA_IN_ExtSDRAM for initializing sdram before main function

4) Enabling system clock before main function

My external sdram is connected to SDRAM1 in stm32f429.

What is the correct procedure? Is SystemInit_ExtMemCtl() function implemented correctly? Is any modification needed? Is enabling clock before main function and after system_init needed?

Can anyone tell what is the correct code step by step?

Thanks in advance.

Parents Reply Children
No data