Linker  ERROR L1102

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

Linker  ERROR L1102

Jump to solution
4,951 Views
Sangram
Contributor I
Hello everybody,
                          I am using 9S08DZ60 microcontroller . What changes you will suggest for following .prm file of 68HC08AZ60 to mak eit work for 9S08DZ60.
 
    Z_RAM = READ_WRITE      0x0050 TO 0x005F; 
    MY_STACK = READ_WRITE    0x0070 TO 0x00DF;      
    RAM_TUC2 = READ_WRITE     0x00E0 TO 0x00EF;
    RAM_2 = READ_WRITE         0x00F0 TO 0x041F; 
    RAM_3 = READ_WRITE         0x0420 TO 0x049F; 
    RAM_4 = READ_WRITE         0x04A0 TO 0x051F; 
    RAM_5 = READ_WRITE         0x0520 TO 0x059F; 
    RAM_6 = READ_WRITE         0x05A0 TO 0x061F; 
    RAM_7a = READ_WRITE        0x0620 TO 0x069F;
    RAM_7b = READ_WRITE        0x06A0 TO 0x071F; 
    RAM_8 = READ_WRITE         0x0720 TO 0x079F; 
    RAM_H_1 = READ_WRITE       0x0A00 TO 0x0A7F;  
    RAM_H_2 = READ_WRITE       0x0A80 TO 0x0AFF; 
    RAM_H_3 = READ_WRITE       0x0B00 TO 0x0B7F;  
    RAM_H_4 = READ_WRITE       0x0B80 TO 0x0BFF;  
    RAM_H_5 = READ_WRITE       0x0C00 TO 0x0C7F; 
    RAM_H_6 = READ_WRITE       0x0C80 TO 0x0CFF; 
    RAM_H_7 = READ_WRITE       0x0D00 TO 0x0D7F; 
    RAM_H_8 = READ_WRITE       0x0D80 TO 0x0DFF; 
   
    ROM_60 = READ_ONLY         0x2000 TO 0x3FFF;   
    ROM_48 = READ_ONLY       0x4000 TO 0x7FFF;        
       
       
    ROM_RGT_TUC = READ_ONLY   0x8000 TO 0xA6FF;    
    ROM_ADAP_TUC = READ_ONLY  0xA700 TO 0xAAFF;                      
    ROM_24 = READ_ONLY      0xAB00 TO 0xB5FF; 
    
    CODE_ROM1 =READ_ONLY      0xB600 TO 0xB602;
    CODE_ROM2 =READ_ONLY      0xB603 TO 0xB605; 
    CODE_ROM3 =READ_ONLY      0xB606 TO 0xB608; 
    CODE_ROM4 =READ_ONLY      0xB609 TO 0xB60B; 
    CODE_ROM5 =READ_ONLY      0xB60C TO 0xB60E;
    CODE_ROM6 =READ_ONLY      0xB60F TO 0xB611; 
    REST_ROM  =READ_ONLY    0xB612 TO 0xB6FF;     
    MY_ROM = READ_ONLY       0xB700 TO 0xEF5F;  
           
      
    FLASH_ROM = READ_ONLY     0xEF60 TO 0xFDFF;    
 
 
I am getting this error
Linking
Error [PM9]: Output file main.abs (Dir:c:\win16app\hiware\sourcecode\outputs\) was not generated. (doesn't exist).
 
ERROR L1102: Out of allocation space in segment RAM_2 at address 0x13F
 
As i know RAM_2 is not big enough. But, when i increase  size for that segment, It gives error for another segment.. like fix up  overflow  error L1907...
How can I cope with this kind of problem.. please suggest any document to read...
 
Thanks in advance
Sangram
Labels (1)
Tags (1)
0 Kudos
1 Solution
1,024 Views
bigmac
Specialist III
Hello Sangram,
 
The segment allocations you have shown could be problematic for the HC908AZ60 too.  The range of the read/write segments appears to exceed the available RAM in the device.  Also some of the segments cross boundaries of different types of memory.  If there have not been problems, presumably it was because the offending segments were never used.
 
To compare the AZ60 with the 9S08DZ60 -
AZ60:  RAM1 0x0050 to 0x044F; RAM2  0x0A00 to 0x0DFF (1K + 1K)
DZ60:  RAM  0x0080 to 0x107F (4K)
 
For the DZ60, Z_RAM start differs, so -
Z_RAM = READ_WRITE      0x0080 TO 0x00FF;
 
Now to put the stack segment at the top of RAM -
MY_STACK = READ_WRITE    0x1000 TO 0x107F;
 
I notice that you have a quantity of fifteen separate segments allocated, starting at RAM_3, each with a size of 0x80 (128) bytes.  Do you actually need so many segments?  This approach is likely to give "wasted" RAM unless the intended data completely fills each of these segments.
 
I might suggest that you sequentially allocate each of these segments, starting at 0x0100.  The RAM_2 segment, which I assume contains the majority of variables, could then start from where the previous segments ended, and continue to 0x0FFF, just below the stack.
 
I have not done so, but it would be a good idea to also check the ROM segments to see that they are compatible with the DZ60 device.
 
Regards,
Mac
 

View solution in original post

0 Kudos
5 Replies
1,025 Views
bigmac
Specialist III
Hello Sangram,
 
The segment allocations you have shown could be problematic for the HC908AZ60 too.  The range of the read/write segments appears to exceed the available RAM in the device.  Also some of the segments cross boundaries of different types of memory.  If there have not been problems, presumably it was because the offending segments were never used.
 
To compare the AZ60 with the 9S08DZ60 -
AZ60:  RAM1 0x0050 to 0x044F; RAM2  0x0A00 to 0x0DFF (1K + 1K)
DZ60:  RAM  0x0080 to 0x107F (4K)
 
For the DZ60, Z_RAM start differs, so -
Z_RAM = READ_WRITE      0x0080 TO 0x00FF;
 
Now to put the stack segment at the top of RAM -
MY_STACK = READ_WRITE    0x1000 TO 0x107F;
 
I notice that you have a quantity of fifteen separate segments allocated, starting at RAM_3, each with a size of 0x80 (128) bytes.  Do you actually need so many segments?  This approach is likely to give "wasted" RAM unless the intended data completely fills each of these segments.
 
I might suggest that you sequentially allocate each of these segments, starting at 0x0100.  The RAM_2 segment, which I assume contains the majority of variables, could then start from where the previous segments ended, and continue to 0x0FFF, just below the stack.
 
I have not done so, but it would be a good idea to also check the ROM segments to see that they are compatible with the DZ60 device.
 
Regards,
Mac
 
0 Kudos
1,024 Views
Sangram
Contributor I
Bravo bigmac...
Thats why they call you super contributer.. Yesterday this problem is solved by same approach.. Thanks for you support..
But still I want to know how one decide how much RAM he want to allocate...
 
Thanks in advance
Sangram:smileyhappy:
 
0 Kudos
1,024 Views
bigmac
Specialist III
Hello Sangram,


Sangram wrote:
But still I want to know how one decide how much RAM he want to allocate...

I am not quite sure of what you mean.  All the RAM within a device should be allocated to one segment, or another, otherwise any unallocated range of RAM can never be utilized.  Of course, the sections placed within each segment will determine the range of memory available to the linker.
 
Open up the map file for the project to observe the utilization of the various sections.  If any of the special ones are not used, they can probably be deleted.  Within the prm file, If any segment has no section placed within, its range might possibly be inluded within an adjacent segment.
 
Regards,
Mac
 
0 Kudos
1,024 Views
CompilerGuru
NXP Employee
NXP Employee
Looks like you did understand what the message L1102 tries to tell you. There is just not enough space for all your variables.
The L1907 on the other hand, can you provide more information?
One reason I could imagine for L1907 is that you are placing zero page variables into a non zero page area.
So your code contains something like

Code:
#pragma DATA_SEG __SHORT_SEG SEG_PLACED_IN_RAM_2
int i_short_var;

 Then when using i_short_var, the compiler uses 8 bit addresses and at link time if i_short_var ends up outside of 0..0xFF then you would get a link error like L1907.
If that's the problem, then remove the __SHORT_SEG qualifier for all sections not ending up completely in the zero page.

Moving the stack out of the zero page may give you the oportunity to place some other often used variables in there and to gain some code/speed through this.

Daniel
1,024 Views
Sangram
Contributor I
Also, where I will get details of prm file for 9S08DZ.
 
Thanks in advance
 
 
0 Kudos