cancel
Showing results for 
Search instead for 
Did you mean: 

Steps to have external SDRAM work properly!

N ORhan
Associate III

I'm editing linker and startup files according to the example "FMC_SDRAM_DataMemory" but i con not access SDRAM. In example, it has only 2 regions as FLASH and RAM but we have 5 regions as FLASH, DTCMRAM, SRAM1, SRAM2 and MEMORY_B1. Also how can an initialized array of size 255kB get place to external SDRAM before FMC is enabled? FMC is enabled in main. Please anyone can explain the steps to use external SDRAM properly?

I'm using STM32F746DISCO board and on-board SDRAM. IDE is Atollic TrueStudio.

Thank you.

2 REPLIES 2

Don't spend my days using GNU/GCC, not looking to spend a bunch of time implementing work product.

You'd need to add plumbing/parking in the linker script

MEMORY

{

..

SOMERAM (xrw) : ORIGIN = 0xD00000000, LENGTH = 32M

}

SECTIONS

{

..

. = ALIGN(4); /* get control */

_sisomeram = LOADADDR(.someram); /* know where it comes from */

.someram

{

. = ALIGN(4); /* get control */

.somestart = . ; /* know where it goes */

/* STUFF */

. = ALIGN(4); /* get control */

.someend = .; /* know where it ends */

} >SOMERAM AT> FLASH /* where ends up, where staged */

..

} /* SECTIONS */

Your startup code needs to initialize the memory (pins, peripheral, controller, device). In Keil we put that in code called by SystemInit(), and we call that before the statics are unpacked by runtime library code using tables the linker auto-generates. In GNU/GCC you must get you hands dirty and do it yourself.

Once the memory is functional you copy over the initial content using the symbols you have the linker create

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

OK Clive i'try, thank you so much for your knowledge you shared.