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: Functions running in CLA seems to be inline by default

Part Number: TMS320F28388D


Tool/software:

Hi,
We have developed a board to control 2 bldc motors using FOC.
The FOC is running in 2 tasks in CLA. The FOC algorithm & state machine are described in a function in shared.h file. Everything works fine.
As I want to see some variables for debug, I have copied them from RAMLS to CLA_to_DMA_mem to be send next throw USB.


If I do the copy from a function in shared.h the total size of my code running in CLA is 0x2640.
If I do it directly in the tasks (so twice), the total size of my code running in CLA is 0x25b6.
Duplicating the code provide a smaller code than using a function (strange).

My question is, are the functions in shared.h by default inline?
My function is not declared inline.
Sincerely.

Jérôme

  • Hi Jérôme,

    The functions should not default to inline, they will only be inline if specified as inline in the function signature. I have a couple clarifying questions:

    1. Do you have project optimizations turned on?
    2. Can you show the Disassembly view of the function in both cases? This will make it clear what exactly the size difference is from.
    3. If you do declare the function as inline, does it remove the size difference? This is what would be expected.

    I believe the extra space you are seeing in the function case is from the branching and context save/restore instructions required.

    Best Regards,

    Delaney