s32k116 can not use all ram

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k116 can not use all ram

281 Views
Harold_zhou
Contributor I

364713ca-ed28-4d46-9d1f-da82ceb8f2a1.png 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?

0 Kudos
Reply
3 Replies

261 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

 

 
 

 

 

 

 

0 Kudos
Reply

246 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

 

0 Kudos
Reply

253 Views
Harold_zhou
Contributor I

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

Tags (1)
0 Kudos
Reply