HC12: declaring large data arrays in external memory

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

HC12: declaring large data arrays in external memory

Jump to solution
2,561 Views
NZ_Design
Contributor I
             BatteryRAM      = NO_INIT       0x200000'G TO 0x3FFFFF'G;  // CS1
             Bat_RAM              INTO  BatteryRAM;
typedef struct
{
 unsigned char cOutExit;
 unsigned         bOutFired:1;
 unsigned char cBatchExit;
 unsigned char cLabelPoint;
 unsigned char cFruitSize;
 unsigned int    iFruitWeight;
}BED;
 
#define MAX_BED              0x03FF
#define MAX_LANES          16
 
#pragma DATA_SEG __GPAGE_SEG Bat_RAM
 char cExt_RAM[56];
 Prog_Layout Program[9];
 BED FruitBed[MAX_LANES][MAX_BED];
#pragma DATA_SEG DEFAULT
L4100: Failed to convert address 0x200000'G of FruitBed because of 'External space area (140000..3FFFFF) has no logical address'

L4100: Failed to convert address 0x200000'G of In debug info because of 'External space area (140000..3FFFFF) has no logical
address'

L4100: Failed to convert address 0x200000'G of In debug info because of 'External space area (140000..3FFFFF) has no logical
address'

That is understandable but how do I declair my arrays so as the complier recognises them.
My old compiler wasn't able to cope with paging so I did it manuallly in my code. Putting each lane on a seperate page at the same address. I are trying to get away from this.
 
Does anybody have a good surgestion.
 
Daniel

Message Edited by CrasyCat on 2007-04-13 01:24 PM

Labels (1)
Tags (1)
0 Kudos
1 Solution
555 Views
CrasyCat
Specialist III
Hello
There seems to be something wrong in the application.
Please submit a SR for that through our on-line support web page and attach the whole project reproducing the trouble.
 
Our support people will be able to look into that and identify the problem.
 
CrasyCat

View solution in original post

0 Kudos
4 Replies
555 Views
NZ_Design
Contributor I
The processsor I are using is MCS12XDP512 and code worrier version is 5.7.0
 
I re wondering if I should be setting up indervidual pages and assigning the pages to Bat_RAM.
 
Daniel
0 Kudos
556 Views
CrasyCat
Specialist III
Hello
There seems to be something wrong in the application.
Please submit a SR for that through our on-line support web page and attach the whole project reproducing the trouble.
 
Our support people will be able to look into that and identify the problem.
 
CrasyCat
0 Kudos
555 Views
CrasyCat
Specialist III
Hello
 Which CPU are you targeting?
 Which version of CodeWarrior are you using?
 To retrieve that information:
    - Start IDE
    - Select Help -> "About Freescale CodeWarrior"
    - Click on "Installed Products"
    - Click on "Save As", save the result in a file and attach it to that post.
 
CrasyCat
0 Kudos
555 Views
CompilerGuru
NXP Employee
NXP Employee
One reason for this warning is if you do only surround the definition of the variables with a
#pragma DATA_SEG __GPAGE_SEG Bat_RAM
but not the declarations of the variables.
I recommend to always use the same #pragmas before/after both, and to include the header file declaring the variable also in the C file defining the variable so the compiler can issue a warning:
>Warning : C4200: Other segment than
>in previous declaration

in case of a inconsistency.

If the compiler does not know that an external variable should be accessed with __GPAGE_SEG,
and the debug information will refer with logical addresses to it and this does cause this message.

Note also that this is just a warning about the debug information (and not about code).

Daniel
0 Kudos