I set the configTOTAL_HEAP_SIZE = 4096 in freertosConfig.h ,the project can build successfully.if I set the configTOTAL_HEAP_SIZE = 8192,the project show error:S32k116_Freertos.elf section `.bss' will not fit in region `m_data_2'
region m_data_2 overflowed with stack and heap
section .stack VMA [20003600,200037ff] overlaps section .bss VMA [200020c0,200042a3]
region `m_data_2' overflowed by 0 bytes
when it is 8192 ,the ram used only almost 9 KB, less than the total ram space 16kB.why does it remind error,how to solve it?
Hi @Harold_zhou,
Do you really use the RAM linker file that you posted or is it the Flash linker file?
Anyway, there is only 0x37FF of SRAM_U.
The heap is in m_data_2 memory area. So, if you need 8kB heap, you need at least 8kB (0x1FFF) of m_data_2.
But there is BSS and the stack in m_data_2 too.
Regards,
Daniel
Hi @Harold_zhou,
The error message mentioned m_data_2 which is in the *flash.ld linker file only.
So, you use the *flash.ld linker in the project not the *ram.ld
You can increase m_data_2 but only within the size of the actual SRAM_U as I mentioned.
Regards,
Daniel
it is ram link file,so I need change the m_data_2 in linker file named flash.ld
/* SRAM_U */
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x000020C0
m_data_2 (RW) : ORIGIN = 0x200020C0, LENGTH = 0x00001740