When I try to add a small segment of code to one file, it gives me the following error, although it works perfectly when I move that code segment to another file. It seems that the code causing the error is overflowing the allocated PAGE_E3 space, and I'm not clear on how to fix it. I tried to increase the size allocated for the PAGE_E3 while reducing the space allocated for the PAGE_E4 but it gives the same error pointing the same memory address.
This is the code segment I added to the already existing code:
UI32 tempArry[10] = {0};
for (int i = 0; i < 10; i++)
{
tempArry[i] = i;
}
I have the following questions:
1. Why does the behavior change when moving the code segment between files, as both codes appear to be in the default area?
2. How can I increase the PAGE_E3 space without interfering with other pages?
3. Is there a special approach to place a specific code segment in another PAGE_XX while keeping the remaining part of the file in a different page? If so, what would be the performance impact?
The linker parameter file for the MC9S12XDP512 (R3.prm) is attached: R3.zip for your reference.
Appreciate your help to figure out the issue as I'm pretty new...
Thanks
Madushan
PS: I tried to merge pages by doing following but still I got the same error.
SEGMENTS
/* PAGE_E3 = READ_ONLY 0xE30000 TO 0xE3BFFF;
PAGE_E4 = READ_ONLY 0xE48000 TO 0xE4BFFF; */
PAGE_E3E4 = READ_ONLY 0xE30000 TO 0xE4BFFF;
PLACEMENT
VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */
STRINGS, /* string literals */
DATA_ROM,
DEFAULT_ROM,
CONST_EVENTS,
CONST_DATA,
ROM_POINTERS,
COPY /* copy down information: how to initialize variables */
INTO PAGE_FE, PAGE_FC, PAGE_FB, PAGE_FA,
PAGE_F9, PAGE_F8, PAGE_F7, PAGE_F6,
/*PAGE_F5, PAGE_F4, PAGE_F3, PAGE_F2,*/
PAGE_F5, PAGE_E3E4, PAGE_F2,
PAGE_ED, PAGE_EC, PAGE_EB, PAGE_EA,
PAGE_E9, PAGE_E8, PAGE_E7, PAGE_E6;