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

Problem: SRAM region is full

Note: This was originally posted on 12th December 2008 at http://forums.arm.com

Hello!

I am getting the compiler error that "sram region is full", and I am trying to identify the possible causes. I know this is basic problem, but I am a newbie!

I am using the AT91SAM7S256 (ARM7), which has 256K flash and 64K SRAM. I know that flash hold the program memory initially. What data is then transferred to SRAM? Is it all global data? If so, then that might be my problem.

I am using a couple large global buffer arrays that take up 50K. I am using these buffer arrays to hold audio data before I write to an external flash (and since writes to external flash take a long time, I have a lot of data to hold). Is there an alternative solution that someone can think of, other than having a large global buffer array?

Thanks for the help!
  • Note: This was originally posted on 12th December 2008 at http://forums.arm.com

    Please check your linker scripts.
    Add appropriate range values (depending on your hardware configuration) for various sections (.data, .text and .bss) and then try to link.
    The linker will tell you which section is overusing its given space. Also
    verify where in SRAM is your code getting copied to. And after copying the code how much space is left for the data section (i.e. your global buffers).
  • Note: This was originally posted on 12th December 2008 at http://forums.arm.com

    Being honest, if you have a 64KB SRAM, and a 50KB scratch buffer in it, it is likely you running out of memory for other writable objects in your program (stack, heap, etc).

    Try reducing the size of the writable memory you are using, or getting a microcontroller with a bigger memory.
  • Note: This was originally posted on 12th December 2008 at http://forums.arm.com

    Hello!

    I am getting the compiler error that "sram region is full", and I am trying to identify the possible causes. I know this is basic problem, but I am a newbie!

    Thanks for the help!


    Is it a run time error or compile/link time error? its a linker error. isn't it?
    if its linker time error then you should check your linker file, and probably try to add more space for 'sram' section there.
    cheers
    Aj