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.
Tool/software: Code Composer Studio
Hello everyone,
I'm working on the controlCARD TMS320F28379D. I have some questions regarding the Global Shared RAM. As I see in C2000 Ware examples "RAM_management" the data arrays are assigned to Global Shared RAM by the command #pragma DATA_SECTION(). In the cpu1 source code file, cpu1_arr is defined and #pragma(cpu1_arr,"SHARERAMGS0") is called. Then, in cpu2 code file,<#pragma DATA_SECTION(cpu2_arr,"SHARERAMGS0") is called, and cpu2_arr would be identical to cpu1_arr. Is this correct ?
However, in my program, I only need to share some variables ( 5 or 6), whose size is "unsigned int", so it should takes a very small amount of a global shared RAM block. How should I modify the linker file, or anything related, to assign only a section of RAMGS0 for example, to store the shared variables ?
Regards,
An.
Hi An,
I'm working on the controlCARD TMS320F28379D. I have some questions regarding the Global Shared RAM. As I see in C2000 Ware examples "RAM_management" the data arrays are assigned to Global Shared RAM by the command #pragma DATA_SECTION(). In the cpu1 source code file, cpu1_arr is defined and #pragma(cpu1_arr,"SHARERAMGS0") is called. Then, in cpu2 code file,<#pragma DATA_SECTION(cpu2_arr,"SHARERAMGS0") is called, and cpu2_arr would be identical to cpu1_arr. Is this correct ?
Basically sharemsg0 ram is mapped to cpu1RArray & cpu2RWArray, and in the application cpu2 writes to the array & cpu1 reads the same data synchronously. Similarly sharemsg1 ram is mapped to cpu2RArray & cpu1RWAArray and in the application cpu1 writes to the array & cpu2 reads the same data synchronously. Also cpu2 reads the data fron cpu2RArray i.e sharemsg1, modifies it and writes to cpu2RWArray i.e. sharemsg0 which in turn is read by cpu1.
However, in my program, I only need to share some variables ( 5 or 6), whose size is "unsigned int", so it should takes a very small amount of a global shared RAM block. How should I modify the linker file, or anything related, to assign only a section of RAMGS0 for example, to store the shared variables ?
You can assign multiple variables to the same data section as long as the overall size can be accommodated in the section.E.g.
uint32_t var1, var2;
#pragma DATA_SECTION(var1,"SHARERAMGS0");
#pragma DATA_SECTION(var2,"SHARERAMGS0");
Thanks
Vasudha
Hi Vasudha,
I tried your solution, but when looking at the .map file, the variables are allocated randomly, rather than in the order I want them to be. However, I found out a way to work around it by dividing the linker file's RAMGS0 into RAMGS0_1, RAMGS0_2,etc,... with the length of my variable type. Then, using the #pragma macro I assigned each variables into each section as I want. And, it worked beautifully.
Thanks for resolving my problem,
An.