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;
I compiled your example and didn't have any problems. I would like to allocate the structure starting at the RAM 2nd Meg location. Suggestions? There is a knowledgebase article on that: http://www.keil.com/support/docs/586.htm Regards, - mike
I compiled the project using uVision 2, with default settings in the C166 page under the "Options for Target" selection (right click on Project name in File window). How did you compile the example? (command line, what option settings, etc.) Thanks, Phong
I compiled the project using uVision 2, with default settings in the C166 page under the "Options for Target" selection You MUST specify your memory layout in the "Options for Target" (ROM and RAM memory ranges). That insformation will be used by the linker to allocate memory. Memory configuration in Start167.a66 is used for initializing the BUSCONx and ADDRSELx registers; it is not known to the linker. I compiled the following code:
typedef struct CodeTiming_tag { char code_id; char algo_id; int timing_parameter[32770]; }CodeTimingType; CodeTimingType xhuge current_code; CodeTimingType xhuge next_code; void main() { }
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