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
已解决! 转到解答。
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!
-----------------------------------------------------------------------------------------------------------------------
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
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!
-----------------------------------------------------------------------------------------------------------------------
I think I got it figured out.
This document helped a lot:
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4367.pdf