This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Allocating Data Structure to Specific Memory Location

I have data structures of >166 Kbytes of data elements. I have declared these structures as:

typedef struct CodeTiming_tag
{
ubyte code_id;
ubyte algo_id;
uword timing_parameter[MAX_TABLE_ENTRY];
}CodeTimingType;

extern CodeTimingType xhuge current_code;
extern CodeTimingType xhuge next_code;
Compiling the source file that defines the "current_code" and "next_code" structures, I get the following error:
Error C172: 'FDATA0': length exceeded: act=32770, max=16384.

MAX_TABLE_ENTRY values greater than 1024 resulted in compiler error. I also did get an 'HDATA0' error, but it went away when I specifying to the LARGE memory model.

I am not declaring any FAR data in my code. Comments?

I am using a PHYTEC C167 development board 2MRAM and 2MROM, with the following default memory layout (specified in Start167.a66):

ROM (1st Meg) 0x0-0xFFFFF
RAM (1st Meg) 0x100000-0x1FFFFF
ROM (2nd Meg) 0x200000-0x2FFFFF
RAM (2nd Meg) 0x300000-0x3FFFFF

I would like to allocate the structure starting at the RAM 2nd Meg location. Suggestions?

Thanks for your help,
Phong

Parents
  • Mike,

    I did define the memory layout. Sorry I didn't explain this correctly in previous post.

    I created a new project and retried what you did, and did not get an error during compile.

    In my old project, I do get an error whenever the array size is larger than 1024.

    In my code, I am moving data from this large structure to a smaller buffer (255 bytes) specified as sdata type, and setting the PEC source pointer to this smaller buffer for automatic PEC data transfer to a capture & compare register. Wonder if this has anything to do with it.

    Anyways thanks for the input. Will poke around some more.

    Phong

Reply
  • Mike,

    I did define the memory layout. Sorry I didn't explain this correctly in previous post.

    I created a new project and retried what you did, and did not get an error during compile.

    In my old project, I do get an error whenever the array size is larger than 1024.

    In my code, I am moving data from this large structure to a smaller buffer (255 bytes) specified as sdata type, and setting the PEC source pointer to this smaller buffer for automatic PEC data transfer to a capture & compare register. Wonder if this has anything to do with it.

    Anyways thanks for the input. Will poke around some more.

    Phong

Children
No data