AnsweredAssumed Answered

Issue with Linker-Defined Objects __SEG_START_

Question asked by Stephane Briand on May 22, 2012
Latest reply on May 23, 2012 by Stephane Briand



For my application, I need to know addresses of memory segments defined at link time. I manage to do it for a segment call MY_ZEROPAGE, DEFAULT_ROM and for SSTACK.

But when I try to get the start address of the DEFAULT_RAM, I get the message :


WARNING L4024: No information available for segment 'DEFAULT_RAM'


I have carefully read the help on that topic, but don't find where I am wrong.


Here is My prm file (generated by ProcessorExpert) :


NAMESENDSECTIONS    Z_RAM                    =  READ_WRITE   0x0080 TO 0x00FF;    RAM                      =  READ_WRITE   0x0100 TO 0x017F;    MY_STACK                 =  READ_WRITE   0x0180 TO 0x027F;    ROM                      =  READ_ONLY    0xE000 TO 0xFD9F FILL 0x82;    CONST_DATA               =  READ_ONLY    0xFDA0 TO 0xFDB9 FILL 0x82;ENDPLACEMENT    CONST_ROM_DATA                      INTO  CONST_DATA; /* Added manually */    DEFAULT_ROM, ROM_VAR, STRINGS       INTO  ROM;    DEFAULT_RAM                         INTO  RAM;    _DATA_ZEROPAGE,                     /* zero page variables */    MY_ZEROPAGE                         INTO  Z_RAM;    SSTACK                              INTO  MY_STACK;   /* Added manually */ENDINIT _EntryPoint                       /* The entry point of the application. This function is generated into the CPU module. */STACKTOP  0x027F                       /* Top address of the system stack. Value can be changed on the "Build options" tab */


and below, the source code :


extern char __SEG_START_MY_ZEROPAGE[];extern char __SEG_END_SSTACK[];extern char __SEG_START_DEFAULT_RAM[];void Function(void){  unsigned char * pucZRam;  /* Step 1 : write all zeros */  for (pucZRam = (unsigned char *) __SEG_START_MY_ZEROPAGE;       pucZRam < (unsigned char *) __SEG_START_DEFAULT_RAM;       pucZRam++)  {    *pucZRam = 0;  }  }


The map file confirms that ther is an issue with DEFAULT_RAM, since address value is 0 :



     __SEG_START_MY_ZEROPAGE                     80       0       0       1               
     __SEG_START_DEFAULT_RAM                      0       0       0       1 


Help is welcome.