Hi,
I'm trying to implement a redundancy mechanism in RAM.
For that, I use several identical memory sections, and duplicate data from the first one to the others.
With the TI compiler, I'm unable to define the sections to the appropriate size as I want to.
I usally affect my variables to the first section, then have the linker create the mirrors at the same size as it has dynamically allocated for the first one.
According to linker datasheet, I need to create holes in the mirror sections ( that I would size with the expression . += size )
which would give something like this:
ZONE1_SECTION : { *(ZONE1_SECTION) } > RAM, RUN_SIZE( Zone1Size )
ZONE2_SECTION : { . += Zone1Size } > RAM
Unfortunately, that kind of tries gives me an error, saying my Zone1Size variable is used in ZONE2_SECTION before it is initialized.
This means the variable created by the linker has a section-limited scope.
However the linker datasheet (SLAU131I) states that linker "expressions can contain global symbols". So i'm wondering if there is a way to declare the Zone1Size symbol at a global level and then use it successfully. I understand that the SIZE operator already produces a symbol that is global for my C code, still it is not understood by the next linker section.
If anyone has an idea to go around that problem...