Other Parts Discussed in Thread: CCSTUDIO
Tool/software: Code Composer Studio
1 . I check CCS ARM assembly manual, it seems some typo in the manual. the .cinit table should be copy to .data for initialized global variables. Can you please help confirm?
2. Can you please describe more about relationship between .cinit table and .data? From link command file, .data is just allocated to RAM and its load address = run address. But if you are using GNU tool chains, .data section is loaded to Flash and run at RAM. Can we use gnu way to load .data from Flash to RAM and skip load initial value from .cinit ?
CCStudio link command file:
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
GNU linkscript:
.data : ALIGN(4)
{
FILL(0xFF)
/* This is used by the startup code to initialise the .data section */
__data_start__ = . ;
*(.data_begin .data_begin.*)
*(.data .data.*)
*(.data_end .data_end.*)
. = ALIGN(4);
/* This is used by the startup code to initialise the .data section */
__data_end__ = . ;
} >RAM AT>FLASH