Thanks,
I tried this, but I suspect I found a bug in the linker.
=================
It works to extend a section in the beginning of the image.
GROUP : {
.bam LOAD(ADDR(resetvector)) : {}
} = 0xFFFF > resetvector
.fill_bam LOAD(_e_bam): {
*(.fill_bam)
. = ADDR(resetvector) + SIZEOF(resetvector);
} = 0xFFFF > resetvector
This generates a .fill_bam section which fills the resetvector
=====================
I run into the problem in the internal_flash section.
ROM Image Address and RAM Buffer Address of ROM Image are both set to 0xD00.
I can do:
GROUP : {
.text (TEXT) : {}
.rodata (CONST) : {
*(.rdata)
*(.rodata)
}
.ctors : {}
.dtors : {}
extab : {}
extabindex : {}
ROM_IMG_START = .;
} = 0xFFFF > internal_flash
GROUP : {
.data : {
__data_start__ = .;
*(.data)
}
.sdata : {
__sdata_start__ = .;
*(.sdata)
__sdata_end__ = .;
__data_end__ = .;
}
.sbss : {}
.sdata2 : {}
.sbss2 : {}
.bss : {}
ROM_IMG_END = ROMADDR(.bss);
} > internal_ram
/* calculation of ROM data image size */
ROM_DATASIZE = ROM_IMG_END - ROM_IMG_START ;
ROM_CALC = ADDR(internal_flash) + SIZEOF(internal_flash) - ROM_DATASIZE;
.unused_internal_flash : {
. = ROM_CALC;
}= 0xFFFF > internal_flash
I get an error message:
======================================
C:/Freescale/CW MCU v11.1/MCU/PA_Tools/Command_Line_Tools/mwldeppc|Linker|Warning
>Specified length of memory directive 'internal_flash' was exceeded within
>section '.unused_internal_flash': specified 0x00003200 but length is now
======================================
Note: The error message is not complete.
The map file shows that ROM_CALC is 00003ec8
If I set "ROM_CALC" to the calculated value (0x3ec8). it works.
ROM_CALC = 0x3ec8;
.unused_internal_flash : {
. = ROM_CALC;
}= 0xFFFF > internal_flash
==============
If I use the original and deduct an arbitrary value, I srill get the error message,
so there is something broken in the linker.