Hi (first post!)
I get a build warning, which I'd like to get rid of =), about a symbol being redefined when assigning a value to it at link time:
/common_sections.cmd", line 47: warning #10188-D:
symbol "useCacheSize" from file
"MyFile.cpp.obj" being redefined
useCacheSize = L2_CACHE_SIZE;
Hoping someone can help me out!
In my code I've defined a global symbol useCacheSize which is then used to set the L2 cache size.
volatile uint32_t useCacheSize;
..
switch (useCacheSize)
{
case use0Kcache:
CACHE_setL2Size( CACHE_0KCACHE);
break;
case use64Kcache:
CACHE_setL2Size( CACHE_64KCACHE);
break;
..
This symbol is then assigned at link time with the linker command file (common_sections.cmd) to tell our run time code how much L2 memory is available to use as cache:
useCacheSize = L2_CACHE_SIZE;
The Assembly user guide (spru186v) section 7.5.8 states that:
"The symbol should be defined externally. If it is not, the linker defines a new symbol and enters it into the symbol table."
I have tried to do exactly that, define the symbol 'externally', but I still get the aforementioned warning. Have I misunderstood something?
Thanks!