Hello,
Please find here after more details about my question:
MEMORY
{
# [...]
.xIntRam (RW) : ORIGIN = 0x0004, LENGTH = 0x1FFC
# [...]
}
SECTIONS
{
.dataInIntXRam :
{
# [...]
F_MeasureBufferLen = 256; # The size of the buffer.
. = ALIGN(F_MeasureBufferLen);
F_MeasureBufferBegin = .; # This buffer begins at the location of the address location current counter.
. = . + F_MeasureeBufferLen;
F_MeasureBufferEnd = .;
# [...]
} > .xIntRam
}
And here a sample of how they are used in the source code:
// [...]
extern _MeasureBufferLen;
extern _MeasureBufferBegin;
extern _MeasureBufferEnd;
static S16* MeasureBufferDataArea = NULL;
void init (void)
{
MeasureBufferDataArea = (S16*)&_MeasureBufferBegin;
// For the rest of the program, we use "MeasureBufferDataArea"
// [...]
}
Do you know what is the interest to declare these variables into the linker file rather than into the header file ? Maybe the reason is to have a fixed address for this buffer, but in that case why ?
In addition, despite of the datasheet of the device and the Codewarrior help, I didn't well understand the use of the "ALIGN" keyword. What is the interest to align ? What is the consequence for the RAM and the address of the variable following an "align variable" ?Thanks in advance for your help.
Best Regards.
Vincent.