March 4, 2011 - 10:50am
Guest |
I have ported project from Cosmic to Ride7. With Cosmic I don't have errors.
With Ride7 LINKER/LOCATOR RLST7 V2.32.10.307 I have ADDRESS/DATA MEMORY OVERLAP errors.
In menu.c file I have const arrays eg. const unsigned char dot[2000]
menu.c code=2842 const=2304 page0=0 data=2304
How to port this code ?
***ERROR 107 : ADDRESS SPACE OVERFLOW
-SEGMENT: ?DT?MENU(MENU)
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28028
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28080
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28080
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28080
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28080
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28080
***WARNING 6 : DATA SPACE MEMORY OVERLAP
ADDRESS: 28080
IGNORED SEGMENT
?DT?MENU
LINK/LOCATE RUN COMPLETE, 1 ERROR - 13 WARNINGS.
|
Hi,
This is a classic topic, which is addressed in the Application note AN55: Porting Cosmic applications to Raisonance document available from our Web site.
The problem is that your large array is located in RAM, althrough you probably want it to be in Flash.
The "const" qualifier does NOT place the global variables in Flash. You have to qualify them with the "code" qualifier.
This should fix your problem. Have a look at our document anyway, this should help in the conversion process.
Best Regards,
ups.... 6.2 Constants in ROM
I should go to coffee break ;)
another problem with pointer: const to non-const assignment
I have
const code unsigned char str2[]={0x14,0x15,0x10,0x13,0xff};
with
void Draw(char x,char y,unsigned char *pt,unsigned short select)
or
void Draw(char x,char y, unsigned char const * const pt,unsigned short select)
I have:
DrawString(30,7,str2,0x0);
*** ERROR C204 IN LINE 30 OF main.c : pointer: const to non-const assignment
What is correct declatarion ?
Hi,
Your second declaration is better, although the first one is "correct enough".
Note that you called "DrawString" instead of "Draw", which may be the problem.
BR