Placement of huge array in the RAM ; MC9s12ep100  micro

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

Placement of huge array in the RAM ; MC9s12ep100  micro

Jump to solution
1,338 Views
vijay_v
Contributor I
Hi,
 
I have a problem in the placement of a huge array in the RAM. I am using MC9s12ep100 micro which has a 64k ram.
 
I have an array of size 38400 bytes which needs to be placed in the paged area of the ram.
 
Can any body please suggest me how to place this huge array in the RAM area.
 
i am using Codewarrior v5.70
 
Vijay V


Message Edited by vijay.v on 2007-12-05 10:05 PM
Labels (1)
Tags (1)
0 Kudos
1 Solution
334 Views
CrasyCat
Specialist III
Hello
 
An object cannot be allocated across a memory area (SEGMENTS) boundary.
So if you wish to allocate a big table you need to define a big memory area of at least 40K in the PRM file.
I would even recommend defining one single  big block of global memory for banked RAM. 
 
In that purpose replace :
      RAM_F0        = READ_WRITE  0xF01000 TO 0xF01FFF;
      RAM_F1        = READ_WRITE  0xF11000 TO 0xF11FFF;
      RAM_F2        = READ_WRITE  0xF21000 TO 0xF21FFF;
      RAM_F3        = READ_WRITE  0xF31000 TO 0xF31FFF;
      RAM_F4        = READ_WRITE  0xF41000 TO 0xF41FFF;
      RAM_F5        = READ_WRITE  0xF51000 TO 0xF51FFF;
      RAM_F6        = READ_WRITE  0xF61000 TO 0xF61FFF;
      RAM_F7        = READ_WRITE  0xF71000 TO 0xF71FFF;
      RAM_F8        = READ_WRITE  0xF81000 TO 0xF81FFF;
      RAM_F9        = READ_WRITE  0xF91000 TO 0xF91FFF;
      RAM_FA        = READ_WRITE  0xFA1000 TO 0xFA1FFF;
      RAM_FB        = READ_WRITE  0xFB1000 TO 0xFB1FFF;
      RAM_FC        = READ_WRITE  0xFC1000 TO 0xFC1FFF;
      RAM_FD        = READ_WRITE  0xFD1000 TO 0xFD1FFF;
by
      GLOBAL_RAM= READ_WRITE  0xF0000'G TO 0xFDFFF'G; 

Then in the PLACEMENT block change
      PAGED_RAM         INTO  /* when using banked addressing for variable data, make sure to specify
                                 the option -D__FAR_DATA on the compiler command line */
                              RAM_F0, RAM_F1, RAM_F2, RAM_F3, RAM_F4, RAM_F5, RAM_F6, RAM_F7,
                              RAM_F8, RAM_F9, RAM_FA, RAM_FB, RAM_FC, RAM_FD;
into
      PAGED_RAM         INTO  /* when using banked addressing for variable data, make sure to specify
                                 the option -D__FAR_DATA on the compiler command line */
                              GLOBAL_RAM;
That should do it.
 
CrasyCat
 

View solution in original post

0 Kudos
1 Reply
335 Views
CrasyCat
Specialist III
Hello
 
An object cannot be allocated across a memory area (SEGMENTS) boundary.
So if you wish to allocate a big table you need to define a big memory area of at least 40K in the PRM file.
I would even recommend defining one single  big block of global memory for banked RAM. 
 
In that purpose replace :
      RAM_F0        = READ_WRITE  0xF01000 TO 0xF01FFF;
      RAM_F1        = READ_WRITE  0xF11000 TO 0xF11FFF;
      RAM_F2        = READ_WRITE  0xF21000 TO 0xF21FFF;
      RAM_F3        = READ_WRITE  0xF31000 TO 0xF31FFF;
      RAM_F4        = READ_WRITE  0xF41000 TO 0xF41FFF;
      RAM_F5        = READ_WRITE  0xF51000 TO 0xF51FFF;
      RAM_F6        = READ_WRITE  0xF61000 TO 0xF61FFF;
      RAM_F7        = READ_WRITE  0xF71000 TO 0xF71FFF;
      RAM_F8        = READ_WRITE  0xF81000 TO 0xF81FFF;
      RAM_F9        = READ_WRITE  0xF91000 TO 0xF91FFF;
      RAM_FA        = READ_WRITE  0xFA1000 TO 0xFA1FFF;
      RAM_FB        = READ_WRITE  0xFB1000 TO 0xFB1FFF;
      RAM_FC        = READ_WRITE  0xFC1000 TO 0xFC1FFF;
      RAM_FD        = READ_WRITE  0xFD1000 TO 0xFD1FFF;
by
      GLOBAL_RAM= READ_WRITE  0xF0000'G TO 0xFDFFF'G; 

Then in the PLACEMENT block change
      PAGED_RAM         INTO  /* when using banked addressing for variable data, make sure to specify
                                 the option -D__FAR_DATA on the compiler command line */
                              RAM_F0, RAM_F1, RAM_F2, RAM_F3, RAM_F4, RAM_F5, RAM_F6, RAM_F7,
                              RAM_F8, RAM_F9, RAM_FA, RAM_FB, RAM_FC, RAM_FD;
into
      PAGED_RAM         INTO  /* when using banked addressing for variable data, make sure to specify
                                 the option -D__FAR_DATA on the compiler command line */
                              GLOBAL_RAM;
That should do it.
 
CrasyCat
 
0 Kudos