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.

TMS320F280049: How to call functions in CLA background loop?

Part Number: TMS320F280049

Dear Champs,

I am asking this for our customer.

The user uses below inline code in the .h included by CLA .cla file.

#pragma FUNC_ALWAYS_INLINE(Test_Function)
static inline int Test_Function()
{
volatile int A;
A = 1;
return A;
}

But it still shows below error during compling/linking, 

Description Resource Path Location Type
#99923 "xxxxxxxxxx", line 207: CLA does not permit function calls in background tasks. Try inlining function. 

Would you please show me how to solve this?

Wayne Huang

  • Hi Wayne,

    Apologies for the delayed response.

    Have you enabled optimization? Inling work inly if optimization level is 0 or higher.

    Regards,

    Veena

  • Dear Veena,

    I enabled optimization level 1, 

    Speed/size tradeoff 3

    but it could not work.

    Wayne

  • Hi Wayne,

    Sorry for the delayed response.

    I think it is because of the volatile keyword. You can refer to the Inlining Restrictions section in the compiler user guide :

    The compiler will also not inline a call if the function has features that create difficult situations for the compiler:
    • Has a variable-length argument list
    • Never returns
    • Is a recursive or non-leaf function that exceeds the depth limit
    • Is not declared inline and contains an asm() statement that is not a comment
    • Is an interrupt function
    • Is the main() function
    • Is not declared inline and will require too much stack space for local array or structure variables
    • Contains a volatile local variable or argument
    • Is a C++ function that contains a catch
    • Is not defined in the current compilation unit and -O4 optimization is not used

    Regards,

    Veena