AnsweredAssumed Answered

How can I increase the stack size in my linker file??

Question asked by clive palmer on Jun 27, 2014
Latest reply on Jun 27, 2014 by clive palmer

Hi,

I am using a KL02Z32 (although will be using a KL02Z16) soon. I seem to have hit a limit on my stack size. If I increase it then I will get a link error (overflow) because it will not fit into m_data2.

I have messed around and to date have failed miserably with what I thought was a simple task. I'm sure I am being a little stupid. How do I increase my heap / stack allocation?

I cannot work with the stack this small.

Any help much appreciated.

A snippet of my linker file is:-

 

/* Generate a link error if heap and stack don't fit into RAM */
__heap_size = 0x100;    /* required amount of heap  */
__stack_size = 0x100;     /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
  m_interrupts (rx) : ORIGIN = 0x00000000, LENGTH = 0xC0
  m_cfmprotrom  (rx) : ORIGIN = 0x00000400, LENGTH = 0x10
  m_text   (rx) : ORIGIN = 0x00000800, LENGTH = 32K - 0x800
  m_data     (rwx) : ORIGIN = 0x1FFFFC00, LENGTH = 1K   /* Lower SRAM */
  m_data2    (rwx) : ORIGIN = 0x20000000, LENGTH = 4K   /* Upper SRAM */
}

Outcomes