Can _user_heap_stack be moved to m_data_20000000 section?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Can _user_heap_stack be moved to m_data_20000000 section?

跳至解决方案
2,570 次查看
mike1974
Contributor III

I'm using MK22 with 128k of RAM.  As noted in the reference manual, the memory is split into two 64k sections, SRAM upper and SRAM lower, with middle boundary at 0x20000000.

 

I have  _user_heap_stack set to 32k... but it's too big to fit in the m_data section (SRAM lower).  So I would like it to move to m_data_20000000 (SRAM upper).

 

I don't see an option for this in Processor Expert's component inspector (CPU --> Build Options --> Generate Linker).  It only allows me to change the size of the heap, not which section in RAM.

 

Another option someone suggested, is to disable m_data_20000000 section entirely, and bump up the size of m_data to use the full 128k (instead of half).  But the reference manual says you cannot do burst reads across that boundary, and others have posted saying misaligned reads/writes don't work across the boundary either.  I don't know if this would cause problems for me, but I'd rather not risk it.

 

Any help would be appreciated,

 

Thanks

 

Mike

标签 (1)
1 解答
1,879 次查看
TICS_Fiona
NXP Employee
NXP Employee

You can use the upper SRAM for .bss only and lower SRAM the others data. But this needs user to modify the link command file manually, and disable the option ‘Generate linker file’ in CPUcomponent’s build option. 

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,879 次查看
mike1974
Contributor III

By the way here is the linker error...

c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/../../../../arm-none-eabi/bin/ld.exe: M2.elf section `._user_heap_stack' will not fit in region `m_data'

c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/../../../../arm-none-eabi/bin/ld.exe: region `m_data' overflowed by 10872 bytes

0 项奖励
回复
1,880 次查看
TICS_Fiona
NXP Employee
NXP Employee

You can use the upper SRAM for .bss only and lower SRAM the others data. But this needs user to modify the link command file manually, and disable the option ‘Generate linker file’ in CPUcomponent’s build option. 

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,879 次查看
davidtietz
Contributor III

Can you all provide more detail on how this is manually done in the linker file?

0 项奖励
回复
1,879 次查看
davidtietz
Contributor III

I think I got it figured out.

This document helped a lot:

http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4367.pdf

0 项奖励
回复