I'm presently working on adding a ".ccmbss" section into my linker script, where I'm trying to place some uninitialized variables/structs. This is separate from the normal ".bss" section, with the key differentiator being that .ccmbss is located in the core-coupled memory RAM and .bss is located in normal RAM.
When I try placing a large uninitialized struct (~32kB) within the .ccmbss section using the C __attribute__((section(.ccmbss))) designator, I notice that it gets an allocated section of flash of the same size. However, when I don't explicitly set it to move into the .ccmbss section, it gets allocated to the .bss section (as expected) and doesn't take up any flash space.
Any ideas as to how to guarantee that the ccmbss section does not get an associated flash region of memory?
Here is the key part of the linker file that I am working on:
.ccm : {
. = ALIGN(4);
_siccmram = .;
*(.ccm)
_eiccmram = .;
. = ALIGN(4);
} >ccm AT >app
_ccm_loadaddr = LOADADDR(.ccm);
.ccmbss : {
. = ALIGN(4);
*(.ccmbss)
*(.ccmbss*)
. = ALIGN(4);
_eccmbss = .;
_eccmram = .;
} >ccm
.data : {
_data = .;
*(.data*)
. = ALIGN(4);
_edata = .;
} >ram AT >app
_data_loadaddr = LOADADDR(.data);
.bss : {
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .;
} >ram
@nobitsas in stackoverflow.com/questions/6252812/… . Looks like GCC__attribute__((section(..)))addsprogbitsby default - Eugene Sh.#as well to inject a comment into assembly output as described in the top answer to the question you linked to. - Ian Abbott