Link errors - MC9S12DP256B

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

Link errors - MC9S12DP256B

2,905 Views
Sangy
Contributor I
HI,
I am very new to codewarrior software  version 3.1and newly working in microcontrollers, i am working on MC9S12DP256B
when i compile my code i am getting L1102 error out of allocation space in segment ROM_C000 at address 0XFD33. one more error L1119 vector allocated at absolute address 0XFFFE over laps with sections placed in segment .absseg0
 
 this is my prm file

NAMES
END
SEGMENTS 
    RAM      = READ_WRITE 0x1000 TO 0x3FFF;  /* 12K */
   
    EEPROM   = NO_INIT    0x0400 TO 0x0FFF  
         ALIGN 2 [<= 2: 2] [>2: 4]; 

    ROM_4000 = READ_ONLY  0x4000 TO 0x7FFF;  /* 16K */
    ROM_C000 = READ_ONLY  0xC000 TO 0xFEFF;  /* ~16K */
    SECURITY = READ_ONLY  0xFF00 TO 0xFF0F;   
    ROM_FF10 = READ_ONLY  0xFF10 TO 0xFF7F;
      
END

PLACEMENT
    _PRESTART, STARTUP,
    ROM_VAR, STRINGS,
    NON_BANKED, DEFAULT_ROM,  
   COPY                    INTO  ROM_4000, ROM_C000,ROM_FF10; 
    DEFAULT_RAM             INTO  RAM;
    EEPROM_DATA       INTO  EEPROM;
END

STACKSIZE 0x0400 /* 1K bytes = 1/12 of RAM */
 
VECTOR ADDRESS 0xFFFE  _Startup     
 
i tried to increse the segment size and i changed the prm file
in data sheet of MC9S12DP256B the address 8000 to BFFF is shown for page window Flash Rom
 
in order to  remove errors new prm file i used is

NAMES
END
SEGMENTS 
    RAM      = READ_WRITE 0x1000 TO 0x3FFF;  /* 12K */
   
    EEPROM   = NO_INIT    0x0400 TO 0x0FFF  
        ALIGN 2 [<= 2: 2] [>2: 4];  
                  
    ROM_4000 = READ_ONLY  0x4000 TO 0x7FFF;  /* 16K */
          ROM_C000 = READ_ONLY  0x8000 TO 0xFEFF;
          
END

PLACEMENT
    _PRESTART, STARTUP,
    ROM_VAR, STRINGS,
    NON_BANKED, DEFAULT_ROM,  
   COPY                    INTO  ROM_4000, ROM_C000;
       DEFAULT_RAM             INTO  RAM;
    EEPROM_DATA       INTO  EEPROM;
END

STACKSIZE 0x0400 /* 1K bytes = 1/12 of RAM */
 
VECTOR ADDRESS 0xFFFE  _Startup     
 
now linker error L1102 cleared but link error L1119 i.e vector allocated at absolute address 0XFFFE over laps with sections placed in segment .absseg0 still persisting
 
Please can any one suggest me what will be the corrective action. Waiting for reply
 
Thanks inadvance,
Sangy
 
 
Added p/n to subject.


Message Edited by NLFSJ on 2008-01-08 12:51 PM
Labels (1)
0 Kudos
5 Replies

632 Views
CompilerGuru
NXP Employee
NXP Employee
Hi Sangy,

I don't think that using 0x8000..0xBFFF this way is a good idea. Basically
by declaring those 48k Flash to be a single, contiguous memory area, you must never ever change PPAGE . As soon as you do, an interrupt handler may have been allocated in the 0x8000..0xBFFF area and the device may start to crash.
So basically by using those 16k for non banked code, you loose 256k-48k, > 200k of flash, so I think that's a bad thing unless you really want to waste those 200k's of Flash.

For a device with 256k flash, I think the appropriate memory model should usually be the banked one, and not the small memory model one as it appears given your prm.

About the 0xFFFE overlapping, obviously something else that the prm file is defining the reset vector at 0xFFFE in addition to the prm file line
"VECTOR ADDRESS 0xFFFE  _Startup".
Figure out what else in your application is doing this, and then either switch off (comment) the VECTOR prm command or the other location. In order to see what it is, you can just comment the VECTOR temporarily.

Daniel
0 Kudos

632 Views
JimDon
Senior Contributor III
Daniel,
If you are using CW SE (like students and hobbyists), the rest of flash is not usable anyway.
I always use small model, and use  page 8000 in this way.
As for the PPAGE register, random (incorrect) values written will crash your program anyway.
When you are using flat small model, nothing should be writing the PPAGE.
Interrupt handlers in paged memory IS and issue using banked model, as presumably you are calling routines in banked flash, and PPAGE could be set.

Using 4000 and 8000 like this is not a bad idea if you are using SE and SerMon. Other problems can result using non contiguous flash areas, and you don't lose 2K to sermon.( Like if you used C000 & 4000).






Message Edited by JimDon on 2008-01-02 02:18 PM
0 Kudos

632 Views
Sangy
Contributor I
HI,
 Jim and Daniel thanks for your reply i will check whether any other code allocaing to this address.
Sangy
0 Kudos

632 Views
Sangy
Contributor I
 Hi Jim D,
As you told the same vector being allocated two times one in prm and in code i commented in prm now the error is cleared thanks for your response.
0 Kudos

632 Views
JimDon
Senior Contributor III
Hi Sangy,

Your PRM file works fine for me.
Are you sure that you did not change something else?
You get that error when you define a vector twice.
For example if I had in my PRM
:
Code:
VECTOR ADDRESS 0xFFFE  _Startup 

 And had in my code:

Code:
__interrupt 0 void Handler(){}
Or this

typedef void near (* near tIsrFunc)(void);
const tIsrFunc _vectab[] @0xFFFA  = // one extra vector in the table.
{ 
  (tIsrFunc)handler1,
  (tIsrFunc)handler2,
  (tIsrFunc)handler3, // this one ends up at 0xFFFE  
};

 I would get that error.



0 Kudos