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.

C2000WARE: F28003x

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hii,

How to Call the function in .cla file, the function which is defined and initialized in .c or .h files in CCS workspace.

  • Part Number: C2000WARE

    Tool/software:

    Hii, I'm facing issue while calling function in .cla file which is defined in .c file. after calling this function in .cla file the task is not triggered.

    >> following code is .cla in which i'm called function

    __interrupt void Cla1Task1 ( void )
    {
    // __mdebugstop();

    clacount_u8++; // for CLA testing
    ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1);

    /* Call the system: <Root>/CLA_SUBSYSTEM */
    CLA_codegen_pfc_CLA_SUBSYSTEM();


    // __mdebugstop();
    }
    __interrupt void Cla1Task8 ( void )
    {

    }

    >following code for .c where function defined 

    #ifdef __TMS320C28XX_CLA__

    void CLA_codegen_pfc_CLA_SUBSYSTEM(void)
    {

    }

    >> .h file where the function is initialized

    /*Compiling function for CLA Compiler*/
    #ifdef __TMS320C28XX_CLA__

    extern void CLA_codegen_pfc_CLA_SUBSYSTEM(void);

    #endif
    #endif /* RTW_HEADER_CLA_codegen_pfc_private_h_ */

  • Part Number: TMS320F280039C

    Tool/software:

    Hii, TI Support 

    i'm facing issue in CLA code integration using non-reusable function method. how to call function generated in .c file into .CLA file. 

  • Hi Aishwarya,

    Is the function you are trying to use a driverlib function (contained in one of the .c or .h driverlb source files) or one you are defining yourself? What exactly is the issue you are seeing? Is there a build error or is the function just never getting branched to in the debugger?

    Best Regards,

    Delaney

  • Hii Delaney,

    I have generated the CLA code from MATLAB using Non-reusable function packaging method. This CLA code I have integrated into CCS workspace. Now the issue is I'm unable to trigger the task 1.  also how to call the function from .c file into .cla.

  • Hi Aishwarya,

    I am unfamiliar with the non-reusable function packaging method, however I would suggest comparing your code with one of the examples in C2000ware to make sure your CLA initializations and task definitions are correct. Do you have a __mdebugstop(); line in the task to verify if it is being triggered?

    In order to call a function from the .cla file, it needs to be compiled for the CLA. Only files with the .cla or .h extension can be compiled for the CLA. If you are wanting to call a function from a CLA task, you will need to put it in a .h file and make it an inline function.

    Best Regards,

    Delaney

  • Hi Aishwarya,

    I have combined your three threads here as they seem to be referring to the same issue. Please see my above response. Just to reiterate, you cannot call functions defined in .c files from a CLA file. You will need to move these functions to a .h file and define them as inline functions.

    Best Regards,

    Delaney