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.

TMS320F280039C: Why are the variable in the CLA task code not updating as expected

Part Number: TMS320F280039C

I am trying to debug the cla code in background nesting task example. But not getting why the var variable is not being updated even though both CLA and CPU are running.

    • What is the warning associated with the first line in the task?
    • The variable var has scope within the task. Set a breakpoint in the task and run the application. When the MPC in the task populate the expressions window. Step through the task to verify it changes.
    • The "Debug" window has the C28x selected.  The variable var, however, has scope within the CLA task. It is not shared with the C28x.

    -Lori

  • What is the warning associated with the first line in the task?

    It shows the warning as:  #552-D variable "var" was set but never used

    The "Debug" window has the C28x selected.  The variable var, however, has scope within the CLA task. It is not shared with the C28x.

    Set a breakpoint in the task and run the application. When the MPC in the task populate the expressions window. Step through the task to verify it changes.

    but still the variable is not getting updated as expected:

  • The message "identifier not found" usually means the variable was added to the expressions window when the variable was out of scope. Make sure you are in the task before adding the variable to the expressions window. 

  • It shows the woarning as:  #552-D variable "var" was set but never used

    Because the compiler does not see use of the variable it may have eliminated it. (why set it if it is not used?). To get around this you can either:

    Use the RETAIN pragma. For more information refer to www.ti.com/lit/spru514

    #pragma RETAIN ( var )
    
    int32_t var;

    or define it as volatile if it is actually used out of scope - this probably does not apply in this case since the variable is not global.