AnsweredAssumed Answered

m_data region overflowed on KL25Z

Question asked by Maxime Dolberg on Jun 29, 2016
Latest reply on Jul 2, 2016 by SCOTT MILLER

Hello community


I am currently working on project which use KSDKv2 and FreeRTOS on FRDM-KL25Z.  So everything look good until I got this error message on console :


... arm-none-eabi/bin/ld.exe: KL25Z-KSDK2_mvp_v0-2.elf section `.stack' will not fit in region `m_data'

... arm-none-eabi/bin/ld.exe: region m_data overflowed with stack and heap

... arm-none-eabi/bin/ld.exe: region `m_data' overflowed by 8 bytes


No joke, I overflowed m_data space of the freedom board. So, I checked the linker file MKL25Z128xxx4_flash.ld and found these lines :


/* Specify the memory areas */
  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000200
  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x0001FBF0
  m_data                (RW)  : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000


My first thought was to increase m_data LENGTH. And after modification, the compile occurred with no error but I am not very sure if it is the best way. Because between m_data ORIGIN and LENGTH there is by default a gap of 16 384 which is the RAM size of the my Freedom board (KL25) ...


So if I increase the LENGTH it will not be what I have in my RAM in reality.  Am I Right ?


Does someone can confirm this please ?