TMS320F28388D: Function call from CLA task getting stuck

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

We have a function call made from cla task 1

The execution does not return from the function call. (We know it as the task complete interrupt does not trigger)

The function getting called is a large algorithm (without any recursion). And we have a large enough RAM section created for it to fit.

What might be causing this issue?

(The linker file and a snap of the memory consumption are attached)

  • Hi Rhugved,

    I have a couple clarifying questions:

    • Is the function you are calling defined in a header file/is it an inline function? 
    • If you debug your code in CCS and add a __mdebugstop(); intrinsic after the function call, does it ever get hit? - just to rule out any issue with the CPU interrupt configuration
    • Which linker cmd file from C2000ware did you use as a starting point?

    As a note, in CLA programs you generally want to avoid nested function calls, as this will slow down the CLA program and the scratchpad could overflow. In older versions of the CLA peripheral, a maximum of two function calls were allowed, although this requirement has been removed on the CLA for F2838x. If you try replacing the function calls with the function contents inside the function that gets called by the CLA task, it might solve your problem.

    Best Regards,

    Delaney

    • Is the function you are calling defined in a header file/is it an inline function? 
      • No. The function getting called is NOT an inline function. But the functions getting called from within it are inline.
    • If you debug your code in CCS and add a __mdebugstop(); intrinsic after the function call, does it ever get hit? - just to rule out any issue with the CPU interrupt configuration
      • No. __mdebugstop(); does not hit if I place it just after this function call
    • Which linker cmd file from C2000ware did you use as a starting point?
      • 2838x_RAM_CLA_lnk_cpu1.cmd

    Additional information:

    - As you can see in the above images, we have combined 3 RAMLS sections (RAMLS5, RAMLS6, RAMLS7) of 2048 words earch to create a RAMLS_CLA_PROG of 6144 words.

    - The function then does fit into the RAMLS_CLA_PROG section, but it does not work, as I have described initially.

    - The observation is, if we have functions that fir within 2048 word size, they works...! But if it exceeds that boundary, it doesn't

    Is there a boundary or limitation of 2048 words of some kind??

  • Hi Rhugved,

    All limitations for the CLA are listed in the Compiler manual (linked here) CLA compiler section. According to this document, there should not be a direct limitation on the size of a function definition. However, I believe it's more likely that the CLA scratchpad (CLA's version of a stack) is overflowing when the function is called. If you try putting a __mdebugstop(); line before the function call and then stepping into the function once the debugger is paused, how far in the function are you able to step? Is there a specific line where the program fails? If you are able to identify the line that causes a failure, can you open the Disassembly window and send a screenshot of the instructions at that spot?

    Best Regards,

    Delaney