Skip to main content
litus0801
Associate III
May 5, 2010
Question

Stack outside of range

  • May 5, 2010
  • 4 replies
  • 1216 views
Posted on May 05, 2010 at 13:45

Stack outside of range

    This topic has been closed for replies.

    4 replies

    litus0801
    litus0801Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:49

    Hi,

    The 12 buffers of 512 elements were already global. If now, I add the 4 buffers of 1024 my linker says:

    Error[Lp011]: section placement failed: unable to allocate space for sections/blocks with a total estimated minimum size of 0x7240 bytes in <[0x20000000-0x20004fff]> (total uncommitted space 0x5000). 

    Which would be the correct value of my stack?

    /*-Memory Regions-*/

    define symbol __ICFEDIT_region_ROM_start__   = 0x080000EC ;

    define symbol __ICFEDIT_region_ROM_end__     = 0x0801FFFF;

    define symbol __ICFEDIT_region_RAM_start__   = 0x20000000;

    define symbol __ICFEDIT_region_RAM_end__     = 0x20004FFF;

      

    Thanks!!

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 13:49

    You current stack only has 0x200 bytes, your usage is exceeding 0x4000 (16 KB). You definitely need to make your stack much bigger, or curb your use of local variables.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    filippo2991
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:49

    Your routines exceed the stack memory reserved by linker. You can (either)

    1 - configure linker to increase the stack size (i.e. for IAR the stack limit is written into  stm32f10x_flash.icf)

    2 - create global variables to store big data

    3 - reserve heap memory chunk with malloc

    I would prefer 2.

    Best regards,

    Filippo

    litus0801
    litus0801Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:49

    Ok, that's what I finally did: I set the RAM end in 0x2000FFFF which is, according to STM32 documentation, the end of SRAM section. Now seems the program links perfect and works. Now, at least, I can debug it.

    Thanks for all folks!!