Skip to main content
N ORhan
Associate III
July 27, 2018
Question

Steps to have external SDRAM work properly!

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.

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    July 27, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    N ORhan
    N ORhanAuthor
    Associate III
    July 27, 2018

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