How to set the heap address for a CodeWarrior project with the MPC5125

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

How to set the heap address for a CodeWarrior project with the MPC5125

833 Views
Tim562
Senior Contributor I

Hi All, I'm trying to figure out how to move the location of the heap in my MPC5125 project. I'm using Code Warrior for MobileGT 9.2 and when my .rodata section grew too large it grew into the section with the heap. I've looked in the Linker Control File for the project but it doesn't specify the location for the heap. The project memory.MAP file shows that the heap is located at 0x003D_FFF0 and that would conflict with the .rodata section. How do I relocate it (or insert a gap in the .rodata section)? Thanks!

~Tim

Labels (1)
0 Kudos
1 Reply

621 Views
Tim562
Senior Contributor I

If anyone needs to do this I believe I've got it working. I've added a new entry to the Linker Control File after the last GROUP entry in the ram section, like this:

GROUP :
{
__HEAP_START = .;
_heap_addr = __HEAP_START;
// __HEAP_END = __HEAP_START + __heap_size; /* Prefer not to spec the size */
} > ram

It was important to find the name "_heap_addr" as the value to be set, but once that was learned this seems to place the heap at the end of the specified data sections in the ram segment. Hope this helps!

~Tim

0 Kudos