MC9S12XEP768 RAM Section from 0xFD1000 to 0x3FFF

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

MC9S12XEP768 RAM Section from 0xFD1000 to 0x3FFF

Jump to solution
1,047 Views
_hiper_
Contributor I

Hi everyone!

 

I have an MC9S12XEP768 configured with ROMHM = 0 (Internal flash), so from FD1000 to 0xFD1FFF I have the 4k RAM page window and then the 8K non paged ram section from 0x2000 to 0x3FFF.

 

Could I configure the section in the prm file to fix somehow the RPAGE register and use that RAM as a fixed 12K of non paged ram and make it transparent to the application?

 

And some secondary questions:

 

Why in the datasheet says that the RAM page starts in 0x1000 when in 0x1000 logical there are registers?

Can I make a placement like this?

 

RAM_FD = READ_WRITE 0xFD1000 TO 0xFD1FFF

RAM_2000 = READ_WRITE 0x2000 TO 0x3FFF

 

And then ?

...

DEFAULT_RAM           

     INTO    RAM_2000, RAM_FD1800;

 

 

Thanks in advance.

 

Best regards,

 

[hiper]

Labels (1)
0 Kudos
1 Solution
796 Views
RadekS
NXP Employee
NXP Employee

Ok, thank you. Now I can understand.

I tested

DEFAULT_RAM            INTO RAM_2000, RAM_FD1800;

However it not works. RPAGE is cutted off.

Maybe there is any trick, but I think that more useful will be using custom segments and locate data trough #pragma DATA_SEG command. For example:

#pragma DATA_SEG __RPAGE_SEG MY_RAM1

unsigned int i;

#pragma DATA_SEG DEFAULT

There is obvious typo error in hcs12xadrmap.exe.

0x1000 to 0x2000 is memory window to paged RAM. Register are in range 0x0000 to 0x0800

In atachment you can find memory map for S12XEP100


View solution in original post

0 Kudos
5 Replies
795 Views
RadekS
NXP Employee
NXP Employee

MC9S12XEP768 has 48kB RAM. Fix to 12kB RAM is wasting of resources however it is possible.

Default value of RPAGE after reset is 0xFD.

You can simply define only non paged RAM as:

RAM           = READ_WRITE  DATA_NEAR            0x1000 TO   0x3FFF; /*fix 12kB RAM*/

However you must ensure that your program:

  1. will not use any paged variables/data,
  2. will never modify RPAGE register.


796 Views
_hiper_
Contributor I

Hello Radek,

I think I didn't explain myself properly.

I'm using more ram through global addressing. I just want to know if I can expand the non banked ram section using the bank window.

I am using CodeWarrior 4.6, so I can't use the DATA_NEAR directive in the prm files.

That's another doubt (asked it previously in the first post) why in the datasheet from 0x1000 LOGICAL says that it is ram when then in the hcs12xadrmap.exe HCS12X Address Mapping tool says that there are registers? And it's true, because, when I use RAM from 0x1000 logical, it starts initializing the variables over the registers and gives me a reset in the startup code.

And as we know  I cannot make this:

RAM           = READ_WRITE   0xFD1000 TO   0x3FFF;

Thanks in advance.

Best regards,

[hiper]

0 Kudos
797 Views
RadekS
NXP Employee
NXP Employee

Ok, thank you. Now I can understand.

I tested

DEFAULT_RAM            INTO RAM_2000, RAM_FD1800;

However it not works. RPAGE is cutted off.

Maybe there is any trick, but I think that more useful will be using custom segments and locate data trough #pragma DATA_SEG command. For example:

#pragma DATA_SEG __RPAGE_SEG MY_RAM1

unsigned int i;

#pragma DATA_SEG DEFAULT

There is obvious typo error in hcs12xadrmap.exe.

0x1000 to 0x2000 is memory window to paged RAM. Register are in range 0x0000 to 0x0800

In atachment you can find memory map for S12XEP100


0 Kudos
796 Views
_hiper_
Contributor I

Hello!

Just to tell you the results, finally I fixed RPAGE to FD with the compiler, and did not modify anything in the code.

And in the prm:

RAM_FD          = READ_WRITE  0xFD1000 TO 0xFD1FFF;

RAM_2000        = READ_WRITE    0x2000   TO 0x3FFF;

And then:

     DEFAULT_RAM           

          INTO    RAM_FD,RAM_2000;

And it is working!!! It was transparent to the application. So now I have 12KB of non banked ram and 36KB of banked ram through global adddressing.

Thank you very much.

Best regards,

hiper

0 Kudos
796 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

paged RAM is to allocated data. it need together with __RPAGE_SEG declariation in C code. #pragma DATA_SEG __RPAGE_SEG PAGED_RAM unsigned char paged_buf[10]="paged"; #pragma DATA_SEG DEFAULT  unsigned char * __rptr pToPagedVal; pToPagedVal = &paged_buf[0]; I will attach a sample code.