How to use all 4k of RAM in the GC64?

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

How to use all 4k of RAM in the GC64?

3,477 Views
Anders
Contributor I
Hi,
the data sheet says that with the map after reset, only 3k is visible. But the GC64 is specified to have 4k of RAM. Already there I'm confused; seems a bit pointless to have invisible RAM...
 
Anyway, I'm using CodeWarrior, and using the new project wizard this is what is suggested:
 
/* This is a linker parameter file for the MC9S12GC64 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS  /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
   
RAM = READ_WRITE 0x0400 TO 0x0FFF;
   /* unbanked FLASH ROM */
   ROM_4000 = READ_ONLY  0x4000 TO 0x7FFF;
   ROM_C000 = READ_ONLY  0xC000 TO 0xFEFF;
   /* banked FLASH ROM */
   PAGE_3C = READ_ONLY  0x3C8000 TO 0x3CBFFF;
   PAGE_3D = READ_ONLY  0x3D8000 TO 0x3DBFFF;
/*  PAGE_3E = READ_ONLY  0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */
/*  PAGE_3F = READ_ONLY  0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */
END
PLACEMENT  /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
   _PRESTART,                   /* Used in HIWARE format: jump to _Startup at the code start */
   STARTUP,                     /* startup data structures */
   ROM_VAR,                     /* constant variables */
   STRINGS,                     /* string literals */
   VIRTUAL_TABLE_SEGMENT,       /* C++ virtual table segment */
 //.ostext,                     /* OSEK */
   DEFAULT_ROM, NON_BANKED  ,                  /* runtime routines which must not be banked */
   COPY                         /* copy down information: how to initialize variables */
                                /* in case you want to use ROM_4000 here as well, make sure
                                   that all files (incl. library files) are compiled with the
                                   option: -OnB=b */
                                INTO  ROM_C000/*, ROM_4000*/;
   OTHER_ROM                    INTO                    PAGE_3D, PAGE_3C;
   DEFAULT_RAM                  INTO  RAM;
 //.vectors                     INTO OSVECTORS; /* OSEK */
END
ENTRIES /* keep the following unreferenced variables */
//_vectab OsBuildNumber /* OSEK */
END
STACKSIZE 0x100
VECTOR 0 _Startup /* Reset vector: this is the default entry point for a C/C++ application. */
//VECTOR 0 Entry  /* Reset vector: this is the default entry point for an Assembly application. */
//INIT Entry      /* For assembly applications: that this is as well the initialisation entry point */
 
Now, that still looks like 3k of RAM to me. Could somebody explain this to me please? (I have seen other topics slightly related, but nothing spot on. Or perhaps I didn' t understand what I was reading...)
 
Is it even possible to use all 4k?
 
Thanks,
Anders.
Labels (1)
Tags (1)
0 Kudos
Reply
5 Replies

1,029 Views
Nabla69
Contributor V
Hi Anders,

You can think about the different memories as LAYERS.
You place the start address of the layer with the initialization register (INITRM, INITEE, INITRG).

These layers have priorities: you only see the top layer when they overlap.
So by default, the REGISTER layer is above the RAM layer and you cannot access the bottom of the RAM as REGISTERS are there.
By changing INITRM, you can put the RAM elsewhere !

I hope I clarified the situation :smileyhappy:

Alfred.
0 Kudos
Reply

1,029 Views
Anders
Contributor I
Aha! (sort of)
 
Ok, so there is some way to statically map these 4k to be visible? Ideally I would like to just change something in the map above, but don't know how or what. I'd really appreciate some help there.
 
Or must I select the "layers" in runtime to be able to access all RAM?
 
Anders

Message Edited by Anders on 2007-02-1307:19 PM

0 Kudos
Reply

1,032 Views
Nabla69
Contributor V
Ok, then with numbers then :smileytongue:

You could move the RAM for it to show at 0x8000 for instance.
It will be over the low fixed Flash area. But this area is available via the paging window.
Furthermore, if you have a small software, you can locate it from 0xC000-0xFFFF, the higher 16KB fixed Flash area.

Enjoy,
A.
0 Kudos
Reply

1,032 Views
CompilerGuru
NXP Employee
NXP Employee
There is one setup which works for all HCS12's and is used by the serial monitor, for example. There is code in start12.c for this setup, search for INITRM. It does remmap the RAM so it ends at 0x3FFF, so adapt the prm file to use this area
   RAM = READ_WRITE 0x3000 TO 0x3FFF;


Daniel

PS: I don't have the start12.c in front ont of, so everything out of my memory only Smiley Happy. Also you only need the INITRM init, but the others probably wont hurt.
PPS: I would not move the RAM into the PPAGE controlled are 0x8000..0xBFFF.
0 Kudos
Reply

1,032 Views
Nabla69
Contributor V
Hello,

I also meant from 0x4000.

QUOTE: " It will be over the low fixed Flash area. But this area is available via the paging window. "

That area is starting at 0x4000 and not 0x8000 as in my previous message.

A.
0 Kudos
Reply