It looks like I'm not quite understanding how the .prm files work exactly with CodeWarrior. I get the following error now(when I add in more code) Link Error : L1121: Out of allocation space at address 0xEF20 for .copy section My .prm file is at the end, I have changed the ROM_C000 Section because I have a bootloader at 0xF000 I don't want to write over. Usually I have it set to 0xC000 to 0xF000(I changed it to 0xEF00, just to duplicate the error with out re-adding the code). When I added a few more functions in one of my ISR's, I would then get the L1121 link error. They are all located using a pragma as follows: #pragma CODE_SEG __NEAR_SEG NON_BANKED My S-Record never uses any of the space at 0x4000 for anything, so that section is compeletly free, why do I get this out of space error, and what can I do to deal with it? The strange part was this showed up because I changed 6 variables from char to unsigned char. Changing it back to char made it go away, but after I added in a few more lines of code it popped back up. Please teach me what I'm doing wrong! Thanks, Tim NAMES END SECTIONS RAM = READ_WRITE 0x0400 TO 0x1FFF; /* unbanked FLASH ROM */ ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF; ROM_C000 = READ_ONLY 0xC000 TO 0xEF00; /* banked FLASH ROM */ PAGE_38 = READ_ONLY 0x388000 TO 0x38BFFF; PAGE_39 = READ_ONLY 0x398000 TO 0x39BFFF; PAGE_3A = READ_ONLY 0x3A8000 TO 0x3ABFFF; PAGE_3B = READ_ONLY 0x3B8000 TO 0x3BBFFF; PAGE_3C = READ_ONLY 0x3C8000 TO 0x3CBFFF; PAGE_3D = READ_ONLY 0x3D8000 TO 0x3DBFFF; /* PAGE_3E = READ_ONLY 0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */ /* PAGE_3F = READ_ONLY 0x3F8000 TO 0x3FBFFF; not used: equivalent to ROM_C000 */ END PLACEMENT _PRESTART, STARTUP, ROM_VAR, STRINGS, VIRTUAL_TABLE_SEGMENT, NON_BANKED, COPY INTO ROM_C000, ROM_4000; DEFAULT_ROM INTO PAGE_38,PAGE_39,PAGE_3A,PAGE_3B,PAGE_3C,PAGE_3D; DEFAULT_RAM INTO RAM; END STACKSIZE 0x100 |
|
CodeWarrior Code Placement Help
Started by ●May 4, 2004
Reply by ●May 4, 20042004-05-04
Hi Tim, the problem in you case is that the COPY section cannot be split. So the linker just gives up when he reaches the end of ROM_C000. One way to avoid this is to place COPY explicitly into ROM_4000. E.g.: _PRESTART, STARTUP, ROM_VAR, STRINGS, VIRTUAL_TABLE_SEGMENT, NON_BANKED INTO ROM_C000, ROM_4000; COPY INTO ROM_4000; PS: Note that the TO address is inclusive. So your "0xC000 TO 0xEF00" does write to the 0xEF00 byte. Daniel Tim Raabe wrote: >It looks like I'm not quite understanding how the .prm files work >exactly with CodeWarrior. I get the following error now(when I add >in more code) >Link Error : L1121: Out of allocation space at address 0xEF20 >for .copy section > >My .prm file is at the end, I have changed the ROM_C000 Section >because I have a bootloader at 0xF000 I don't want to write over. >Usually I have it set to 0xC000 to 0xF000(I changed it to 0xEF00, >just to duplicate the error with out re-adding the code). When I >added a few more functions in one of my ISR's, I would then get the >L1121 link error. They are all located using a pragma as follows: >#pragma CODE_SEG __NEAR_SEG NON_BANKED > >My S-Record never uses any of the space at 0x4000 for anything, so >that section is compeletly free, why do I get this out of space >error, and what can I do to deal with it? > >The strange part was this showed up because I changed 6 variables >from char to unsigned char. Changing it back to char made it go >away, but after I added in a few more lines of code it popped back >up. > >Please teach me what I'm doing wrong! > >Thanks, > >Tim > >NAMES >END > >SECTIONS > RAM = READ_WRITE 0x0400 TO 0x1FFF; > /* unbanked FLASH ROM */ > ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF; > ROM_C000 = READ_ONLY 0xC000 TO 0xEF00; > /* banked FLASH ROM */ > PAGE_38 = READ_ONLY 0x388000 TO 0x38BFFF; > PAGE_39 = READ_ONLY 0x398000 TO 0x39BFFF; > PAGE_3A = READ_ONLY 0x3A8000 TO 0x3ABFFF; > PAGE_3B = READ_ONLY 0x3B8000 TO 0x3BBFFF; > PAGE_3C = READ_ONLY 0x3C8000 TO 0x3CBFFF; > PAGE_3D = READ_ONLY 0x3D8000 TO 0x3DBFFF; >/* PAGE_3E = READ_ONLY 0x3E8000 TO 0x3EBFFF; not used: >equivalent to ROM_4000 */ >/* PAGE_3F = READ_ONLY 0x3F8000 TO 0x3FBFFF; not used: >equivalent to ROM_C000 */ >END > >PLACEMENT > _PRESTART, STARTUP, > ROM_VAR, STRINGS, > VIRTUAL_TABLE_SEGMENT, > NON_BANKED, COPY INTO ROM_C000, ROM_4000; > DEFAULT_ROM INTO >PAGE_38,PAGE_39,PAGE_3A,PAGE_3B,PAGE_3C,PAGE_3D; > DEFAULT_RAM INTO RAM; >END > >STACKSIZE 0x100 > > >--------------------To learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu >o learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu > >Yahoo! Groups Links |
|
Reply by ●May 4, 20042004-05-04
Daniel, Doesn't that cause a: L1110 ROM_4000 appears twice in PLACEMENT block linker error? _________________________________________________________________________ | Todd Morton | | | Professor | http://eet.etec.wwu.edu/toddm | | Electronics Engineering Technology | Voice: (360)650-2918 | | Western Washington University | FAX: (360)650-4847 | _________________________________________________________________________ On Tue, 4 May 2004, Daniel Friederich wrote: > Hi Tim, > > the problem in you case is that the COPY section cannot be split. So the > linker just gives up when he reaches the end of ROM_C000. > One way to avoid this is to place COPY explicitly into ROM_4000. > E.g.: > _PRESTART, STARTUP, > ROM_VAR, STRINGS, > VIRTUAL_TABLE_SEGMENT, > NON_BANKED INTO ROM_C000, ROM_4000; > COPY INTO ROM_4000; > PS: Note that the TO address is inclusive. So your "0xC000 TO 0xEF00" > does write to the 0xEF00 byte. > > Daniel |
|
Reply by ●May 5, 20042004-05-05
Todd, It's supported by the current linker version. The linkers since CW for HC12 V3.0 do now support this. With previous linkers, L1100 was an error, however disabling/ignoring L1100 was supported also. Bye Daniel. Note: This only applies to the ELF Object File Format (which is the default anyway). Todd Morton wrote: >Daniel, > >Doesn't that cause a: > > L1110 ROM_4000 appears twice in PLACEMENT block > >linker error? > >_________________________________________________________________________ >| Todd Morton | | >| Professor | http://eet.etec.wwu.edu/toddm | >| Electronics Engineering Technology | Voice: (360)650-2918 | >| Western Washington University | FAX: (360)650-4847 | >_________________________________________________________________________ >On Tue, 4 May 2004, Daniel Friederich wrote: > >>Hi Tim, >> >>the problem in you case is that the COPY section cannot be split. So the >>linker just gives up when he reaches the end of ROM_C000. >>One way to avoid this is to place COPY explicitly into ROM_4000. >>E.g.: >> _PRESTART, STARTUP, >> ROM_VAR, STRINGS, >> VIRTUAL_TABLE_SEGMENT, >> NON_BANKED INTO ROM_C000, ROM_4000; >> COPY INTO ROM_4000; >> >> >>PS: Note that the TO address is inclusive. So your "0xC000 TO 0xEF00" >>does write to the 0xEF00 byte. >> >>Daniel >> > > >--------------------To learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu >o learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu > >Yahoo! Groups Links |