Other Parts Discussed in Thread: TM4C1294NCPDT
Hi,
the linker script I have been using has a major issue: It makes the startup code "initialize" global variables with constants that are supposed to be written at higher addresses following the .data section. This can easily be reproduced by adding initialized global variables and constants to a project and observing the resulting memory contents at the beginning of main. I can create a minimal working example if need be, but it should be pretty clear...
The fix for the issue is trivial: the .data and .rodata sections in the linker scripts need to be swapped. The correct order of the respective sections in the linker file are as follows:
.data : ALIGN (4) {
__data_load__ = LOADADDR (.data);
__data_start__ = .;
KEEP (*(.data))
KEEP (*(.data*))
. = ALIGN (4);
__data_end__ = .;
} > REGION_DATA AT> REGION_TEXT
.rodata : {
*(.rodata)
*(.rodata*)
} > REGION_TEXT
I am currently using CCS 6.0.1.00040 and TivaWare 2.1.0.12573. The linker script with the bug is located in ccs_base/arm/include/tm4c1294ncpdt.lds but I have not checked if other devices are affected!
Side question: is it enough to replace the file in ccs_base to make newly created projects use the fixed file?