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.

Compiler/TMS320F28379D: using #pragma DATA_SECTION => different arrays => same global Shared Ram

Part Number: TMS320F28379D

Tool/software: TI C/C++ Compiler

Hello there,

i wanted to ask, if it is possible to use the "pragma DATA_SECTION" to assign different arrays to the same shared RAM, if the sum of the arrays doesn´t exceed the size of the shared RAM.
For example i have an array "Uint16 myArray_0[100]" and "Uint16 myArray_1[100]" and i want them both to be assigned to global shared ram 0 - can i do

#pragma DATA_SECTION(myArray_0,"SHARERAMGS0");
#pragma DATA_SECTION(myArray_1,"SHARERAMGS0");

OR would i have to edit the .cmd file by removing the SHARERAMGS0 definition and replace ist with two custom ram sections (of the size of myArray_x) which boundarys are within the global shared ram 0 ?

THEN i´d do

#pragma DATA_SECTION(myArray_0,"myArray_0_RAMSECTION");
#pragma DATA_SECTION(myArray_1,"myArray_1_RAMSECTION");

best regards,
Justus
  • Hello, Mr. User.

    In fact, there must not be a problem with placing two arrays into one block. Linker will do its job. Just don't forget to insert this pragmas into project of other core, in same order. Maybe you should pay attention to data aligning.
    I haven't tried it on F28379D, but on Concerto (double core, Cortex M3 and C28) it's possible to use two pragmas with one Shared RAM.
  • Hi Justus,

    Here is the example code of meeting your requirement. You should put those code in c source file.

    #pragma DATA_SECTION(myArray_0,"SHARERAMGS0");
    Uint16 myArray_0[100];

    #pragma DATA_SECTION(myArray_1,"SHARERAMGS0");
    Uint16 myArray_1[100];

    You can see the symbol address in .map file after building your project, and check if the address is your expected address.

    Regards,
    Jack