Question:
What is the best way of sharing global data between cores?
Answer:
The recommended way of sharing data between the 3 cores is to use MCAPI - it is officially supported in CCES and we supply documentation and examples to help you get started. Although it is possible to use other methods such as the SHARED_MEMORY method or the SHARC linker's RESOLVE command, these methods are not supported by the ARM tools
If you are determined to avoid MCAPI, then using the RESOLVE() command in your LDF is probably simpler than using SHARED_MEMORY{}. This allows you to create your data structure in (for example) the L2 memory for SHARC core 1 and then link against it when building the executable for SHARC core 2. For example, SHARC core 1 might contain C/C++ code like the following
section ("seg_l2_uncached") volatile int x;
And this variable can be declared as extern for core 2 (the section qualifier does not need to be repeated here):
extern volatile int x;
(Note that 'x' is declared as volatile since it can be changed by multiple programs.)
In the PROCESSOR command of the LDF for the core 2, the symbol can then be resolved to the definition in the DXE for the core 1:
RESOLVE(x., "../../SharedMem_Core1/Debug/SharedMem_Core1.dxe")
As mentioned earlier, the ARM tools do not support RESOLVE, so will need to determine the address of the data structure and then use this address in your code. For example:
volatile int *x = (int *)0x20083000;