Extending XGATE RAM section?

cancel
Showing results for 
Search instead for 
Did you mean: 

Extending XGATE RAM section?

4,055 Views
pittbull
Contributor III
Hello again,

I'm using Codewarrior 4.1 to write a combined S12X/XGATE application.
The .prm file defines a single XGATE RAM section...

SEGMENTS
....
RAM_XGATE = READ_WRITE 0xFB1000 TO 0xFB1FFF ALIGN 2
....
PLACEMENT
....
XGATE_CODE INTO RAM_XGATE;
....

...where the XGATE code is copied to for execution.
I want to increase this section by doing the following:

SEGMENTS
....
RAM_XGATE = READ_WRITE 0xFB1000 TO 0xFB1FFF ALIGN 2;
RAM_XGATE2 = READ_WRITE 0xFC1000 TO 0xFC1FFF ALIGN 2;
....
PLACEMENT
....
XGATE_CODE INTO RAM_XGATE, RAM_XGATE2;
....

Does this work?
In case it works, What happens when a fuction calls a function
in the other page? Does compiler/linker handle this correctly?

Thanks in advance
- pittbull
Labels (1)
0 Kudos
4 Replies

38 Views
Steve
NXP Employee
NXP Employee
Hi pittbull,
 Yes you can do what you propose but since the XGATE memory map isn't paged, you can also define a larger segment using global memory.
 
SEGMENTS
....
RAM_XGATE = READ_WRITE 0x0FB000'G TO 0x0FCFFF'G ALIGN 2
....
PLACEMENT
....
XGATE_CODE INTO RAM_XGATE;
....
If you use different ways of defining segments just be careful that you don't define the same segment twice.
0 Kudos

38 Views
pittbull
Contributor III
Hello Steve,

Thanks for the reply.

Are the global memory segments ('G) an undocumented feature? I can't find it in the manuals.
0 Kudos

38 Views
Steve
NXP Employee
NXP Employee
I don't think it is meant to be undocumented. It works in the debugger too when selecting an address in the memory window.
The options are:
default or 'L - logical address
'G - global address
'X - XGATE address (so you can define XGATE addresses in the prm file if needed)
0 Kudos

38 Views
CompilerGuru
NXP Employee
NXP Employee
When you list multiple segments to place the same section in, you might have to use the -OnBRA option as this setup can cause branch distances to increase. So when you get a fixup overload linker error, add -OnBRA.
0 Kudos