linker file is represented as follows,
default ram
into
ram,ram fd,ram fc;
You can't do this. Paged RAM can't be included in default RAM placement.
so compiler fills all the global variables in non paged ram. Once non paged ram filled, compiler will start filling paged ram ram fd and ram fc.
Linker does what you ask it, it puts stack and your variables first to non paged RAM, then to paged RAM segments FD and FC. But unfortunately this is not enough for compiler to generate proper code to access objects in paged memory.
You need to restore PRM file to original and use #pragma DATA_SEG to tell compiler 1) what objects are paged, 2) how compiler should access them, 3) and what placement to allocate object to.
1) To tell what variables, declare and define variables between these pragmas
#pragma DATA_SEG ...
// put your paged variables here
#pragma DATA_SEG DEFAULT
2) to tell how compiler should access them, use either __RPAGE_SEG or __GPAGE_SEG attribute (which I missed in my previous message). Paged RAM is accessed either switching RPAGE register, or using global memory addressing and switching GPAGE register. So
#pragma DATA_SEG __RPAGE_SEG ...
// put your paged variables here
#pragma DATA_SEG DEFAULT
3) to tell what PRM PLACEMENT to use:
#pragma DATA_SEG __RPAGE_SEG PAGED_RAM
// put your paged variables here
#pragma DATA_SEG DEFAULT