This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: ebss section Assignment to global RAM to generate single executable that will be loaded on both the cores

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello,

I am trying to develop a single executable that will be loaded on to both cores. However, each core would perform different task per certain inputs.

In order to develop a single executable and to make sure there are no memory contention by other core, I have created project with command linker file where ebss section was assigned to locally shared RAM. Doing this, each core will have variables stored in the respective core local RAM maintaining the independent memory. 

Now i have a situation that, i need to assign more variables to each core and i might run out of memory in the local RAM of each code.

Could you suggest me, how would i assign the the ebss section to globally shared RAM (50% of GSRAM to Core1 and 50% of GSRAM to core2) while having only one command linker file to generate single executable.

Thanks in Advance,

Munaf

  • Munaf, 

    You can refer to the "memcfg_ex1_ram_management_cpu1 - RAM management Example " provided in C2000Ware. This example shows how to assign shared RAM for use by both the CPU02 and CPU01 core.

    Best Regards

    Siddharth

  • Hello Siddharth,

    Thanks for the replay.

    "memcfg_ex1_ram_management_cpu1 - RAM management Example" example creates two projects in the code composer studio. Each project or core have its command linker file to assign the GSRAM. I do not have this situation.

    I am creating a project (one single project) to generate the executable, that will be loaded on to both Cores. Same code image will be flashed in both cores. This mean, same copy of variables and same copy of functions will be executed in both the cores. In order to maintain the memory independency, currently i am assigning the variables in the locally shared RAM.

    More Details:

    **************

    Use LSRAM:

    Assigning the ebss in LSRAM in command linker file.

    Define the global variable "Var1" in the application code.

    Generate and flash the executable (same exe) in both the cores.

    Var1 will be stored in the LSRAM of each core. Core1 will have its own copy of Var1 and Core2 also will have its own copy of Var1 in its LSRAM.

    Having Var1 stored in LSRAM of each core, would not have any memory corruptions while using the Var1 in the application function.

     

    Use GSRAM:

    Assigning the ebss in GSRAM in command linker file.

    Define the global variable "Var1" in the application code.

    Generate and flash the executable (same exe) in both the cores.

    Var1 will be stored in the GSRAM. (ex: at memory 0x00D000). Core1 and Cor2 would access the Var1 from the same memory and both cores try to read or write the Var1. This will always be an issue and cause unexpected behavior.

    My question is: How to use the GSRAM for storing the global variables that does not cause any memory contention as said above. I would like to assign the 50% of GSRAM to Core1 and remaining 50% of GSRAM to core2 while having only on project file (one linker command file).

    Please suggest any alternate option (any linker option) that satisfy my need.

    Thanks,

    Munaf

  • Munaf, 

    Can you explain the reason for loading the same code on both the cores since in case of F2838x,  C28x1 (CPU1) core acts as the master core. The CPU2 and the CM cores must be booted by the CPU1 application. 

    Best Regards

    Siddharth

  • Siddharth,

    I am totally aware of the mastership. My application have the 95% of the code common for both core1 nd core2. With support of certain input both the core executes two different functionalities, though they have same image flashed. This is to minimize the one additional executable.

    Thanks,

    Munaf

  • Munaf, 

    Usually, we use different executables (.outs) for each of the cores and hence not aware of any such linker option

    One suggestion :  Do you have any #ifdefs in the code to identify the core specific code? If so, you can use the same in linker command file as well.

    Best Regards

    Siddharth

  • Hello Siddharth,

    Could you please talk to the technical team and let me know any suggestion on this topic. Appreciate your help.

    Also, Can you refer the suggestion (using #ifdefs in command linker file and the source file for a global variable) with an example. I would expect, each core will have its own GSRAM memory allocated for this variable.

    Thanks,

    Munaf

  • Munaf, 

    I don't think it's possibe to have the same global variable allocated to different GSRAM locations. 

    You can refer the C2000ware dual core example, where the predefined symbols CPU1 and CPU2 are used to identify the cores. We use #ifdef CPU1/CPU2 in the source files which are common to both cores. You can use the same in linker command file as well. 

    Best Regards

    Siddharth