Hello,
I am trying to create a memory section in SRAM using the linker directives and this memory section not be initialize as it is shared memory between two applications (i.e., data stored by the first program which the next program will used when the first program vectors to the second program).
I have created a memory item in the MEMORY area of the linker directives that looks like the following:
RAM_SHARED (RW) : origin = 0x3378, length = 0x0008 // 8 bytes of shared memory between App and Boot, ommiting the "can be initialize" and "contain executable code" attributes
Then in the SECTIONS area of the linker directives I have the following item:
.shareRAM : {} > RAM_SHARED /* Shared SRAM between Boot and App */
The MEMORY item has the Read/Write, (RW), attributes and I assumed by omitting the "I" attribute the area would not be considered either an uninitialized element (i.e., part of the .bss) or an initialized element (i.e., part of the .data). This was didn't turn out to be the case. The first clue was the allocated Flash section was too small so it was being added to the .cinit tables since I had touched the code yet. Using the debugger I verified this memory section was be initialized to all 0x00's, so it was being included as part of the .bss.
My next step was to try using the pragma statement of no-init, #pargma NOINIT(SharedRAM), but I was presented with the following message.
"variable "ShareRAM" cannot be noinit and also have DATA_SECTION pragma. Without DATA_SECTION pragma, "ShareRAM" will be in section .TI.noinit:ShareRAM. With only DATA_SECTION pragma, you must mark the section noinit in the linker cmd file."
Well, I thought I had been doing this with the "(RW)" attributes in the MEMORY area. Next, I am going to try the #pragma LOCATION statement and not sure it will work or not (though I will following up once I complete the experiment.). So, how do I use the MEMORY/SECTIONS to carve out an area in SRAM though not have the crt touched this??
Thanks,
Mark