TMS320F28388D: Declaration of shared CLA / CPU variables

Part Number: TMS320F28388D

Tool/software:

Hi,

I have the habit of declaring in .cla files the variables that go in Cla1ToCpuMsgRAM, and in .c files the variables that go in CpuToCla1MsgRAM. Such variables are connected via a .h file that is included in both de .c and the .cla file. because of the .h file, I would expect it wouldn't make any difference which variable is declared where. Except it looks like it does, and I don't understand...

Here, I have a set of variables declared as such (for instance) :

Fullscreen
1
2
#pragma DATA_SECTION(BuckVoltage,"Cla1ToCpuMsgRAM");
InfLib_Mesure_t BuckVoltage;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Because the location of the variable in memory is forced, I believed the declaration in a .c or .cla file wouldn't make any difference.

If I declare all my variables in the .cla file, I get the following error message :

Fullscreen
1
#10462-D: Symbol, "BuckVoltage", referenced in "./sources/regulation/regulation_cpu1.obj\", assumes that data is blocked but is accessing non-blocked data in \"./sources/regulation/regulation_cla2.obj". Runtime failures may result.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Based on this page, I tried to declare the variables in the .c file, to see if the error goes away.

When I do so, I get another error message :

Fullscreen
1
#10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. run placement with alignment/blocking fails for section "Cla1ToCpuMsgRAM" size 0x92 page 0. Available memory ranges:",
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So ... What happened ? Are the variables not in the right location when declared in the .cla file, in spite of the pragma ? Do data take up more more memory when declared in a .c file than in an .cla file ? Is there a hidden issue not detected by the compiler when in the .cla file ? Some other issue ?

I am quite puzzled by this difference.

Thanks in advance for your help,

Best regards,

Adrien

  • Hi Adrien,

    The expert is currently out of office but will get back to you as soon as she can after her return.

    Best Regards,

    Aishwarya

  • Hi Adrien,

    I apologize for my delayed response. You cannot declare shared variables in the .cla file, see the note below from the compiler manual:

    The error message you are getting once it is declared in the C file is related to the allocation's setup in the linker. This error message means that there is not enough space in the Cla1ToCpuMsgRAM for what you are trying to put there. Keep in mind that the message RAMs between the CPU and CLA are relatively small, you can instead allocate this variable to a shared LSRAM.

    Best Regards,

    Delaney

  • Hi Delaney,

    Thanks for the explanation. I missed the part in the documentation where it said shared variables must be declared in the .c file. Previously I had the cla to cpu variables in the .cla, and cpu to cla variables in the .c.

    I only recently discovered that data could be share using LSRAM. I will have to try that at some point.

    Thanks for the explanations,

    Best regards,

    Adrien