executing function in paged RAM (S12X)

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

executing function in paged RAM (S12X)

Contributor I

Hi all,


I'm using S12XEP100 in large memory model and i'm trying to use 0xFF Flash page relocate to 4 paged RAM (0xFC to 0xFF)



At startup ROM code is copyied on RAM, then code (main function) relocate in RAM is executed. 

main                                    7FCF70'G      83     131       2   .text             FCF70'G


CALL  main,PAGE(main)


CALL 0x1F70,0xFC is executing and PPAGE is setting to 0xFC but RPAGE is not manage and the code is not correctly execute.


Is it possible to use paged RAM to execute code ?




Arnaud Grégoire

Labels (1)
Tags (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport


The PC uses PPAGE and offset to address program space. The offset can be between 0000~FFFF.
On the basis of offset address the Core recognizes whether program is addresses by short or far address.
If the offset is between range 8000~BFFF then program address consist of PPAGE_OFFSET. Otherwise, near address is used.
If the address is not implemented internally then it is moved to external lines. (https://community.nxp.com/docs/DOC-93594)
If you have connected external RAM or another type of memory to the external bus and the bus is enabled then you can run the code out of external space
(00~BF)_(8000 ~ BFFF) \CS0 is active

For data access (not program) there are more accessible spaces because in this case we can use global addressing for R/W.

As a program RAM you can use internally:

- Buffer RAM 0C00-0FFF if not used for another purposes
- RAM 4000~FFFF accessible by XGATE as well as CPU
- RAM ..RPAGE address (F8~FF)_(1000~1FFF). It is visible only half of them for CPU as described in previous item. For XGATE it is visible entire but at XGATE addresses 8000~FFFF.

So if you need more RAM for code execution I would suggest you to go to XGATE and start required functions by SWI. (XGATE is interrupt driven peripheral)

If you want to see address space in global, look into attachment.

best regards,


0 Kudos