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.

CCS/TMS320F28035: TMS320F28035_CLA

Part Number: TMS320F28035

Tool/software: Code Composer Studio

Hi,

We are using TMS320F28035 in our application and we are implemented CLA method in our flow.

We are facing to problem as below as:

1. Inside the CLA function the values are not properly calculating and not giving proper output.

2. After we added the CLA method the UART is not working.

We are working in power sector and we called so many times TI support peoples in our area, but they are  not responding.So please help us to complete the development and help us to start production.

Regards

R.Baskar

  • Hi,

    baskar r said:
    1. Inside the CLA function the values are not properly calculating and not giving proper output.

    Are you using any of the math functions from the CLA Math library.  Could you provide some more detail on the nature of the computation and where its going wrong. Also were you able to step through the CLA code and identify where the problem begins. In case you are unfamiliar with CLA debug you can find training videos here, 

    baskar r said:
    2. After we added the CLA method the UART is not working.

    Hmm, not sure why this would happen. Are you able to configure the UART registers properly once you place the CLA code in there? How are you writing to the UART, i.e. through an ISR, or some periodic function? Is that ISR or function in RAM, and in a different RAM than where the CLA code or data resides?

  • Hi ,





    1. Please find the below statement is using in CLA function .



    SENSE_V1SumForPwm = SENSE_V1SumForPwm - (SENSE_V1SamplesForPwm[SENSE_vG1IndexForPwm] >> 2);

    SENSE_V2SumForPwm = SENSE_V2SumForPwm - (SENSE_V2SamplesForPwm[SENSE_vG1IndexForPwm] >> 2);

    SENSE_V3SumForPwm = SENSE_V3SumForPwm - SENSE_V3SamplesForPwm[SENSE_vG1IndexForPwm];

    SENSE_CurrSumForPwm = SENSE_CurrSumForPwm - (SENSE_CurrSamplesForPwm[SENSE_vG1IndexForPwm] >> 2);



    SENSE_V1SamplesForPwm[SENSE_vG1IndexForPwm] = AdcResult.ADCRESULT0 + AdcResult.ADCRESULT3 + AdcResult.ADCRESULT7 + AdcResult.ADCRESULT10;

    SENSE_V2SamplesForPwm[SENSE_vG1IndexForPwm] = AdcResult.ADCRESULT1 + AdcResult.ADCRESULT4 + AdcResult.ADCRESULT8 + AdcResult.ADCRESULT11;

    SENSE_V3SamplesForPwm[SENSE_vG1IndexForPwm] = AdcResult.ADCRESULT6;

    SENSE_CurrSamplesForPwm[SENSE_vG1IndexForPwm] = AdcResult.ADCRESULT2 + AdcResult.ADCRESULT5 + AdcResult.ADCRESULT9 + AdcResult.ADCRESULT12;

    SENSE_V1SumForPwm = SENSE_V1SumForPwm + (SENSE_V1SamplesForPwm[SENSE_vG1IndexForPwm] >> 2);

    SENSE_V2SumForPwm = SENSE_V2SumForPwm + (SENSE_V2SamplesForPwm[SENSE_vG1IndexForPwm] >> 2);

    SENSE_V3SumForPwm = SENSE_V3SumForPwm + SENSE_V3SamplesForPwm[SENSE_vG1IndexForPwm];

    SENSE_CurrSumForPwm = SENSE_CurrSumForPwm + (SENSE_CurrSamplesForPwm[SENSE_vG1IndexForPwm] >> 2);



    2. We are configured using interrupt method and is working with out CLA configuration.

    When we are enableing CLA the uart interrupt is working both Tx and Rx function.
  • I cant tell if there is an error in the CLA code. My suggestion would be to place a breakpoint in the CLA code (__mdebugstop()) and step through the code to see where the calculation is going wrong.

    As for the UART interrupt, is it in either RAML1-3? are those RAMs being configured as CLA data and program RAMs?
  • Hi,
    Please find the CMD configuration for CLA-Configured in RAML3.
    Cla1Prog : LOAD = FLASHH,
    RUN = RAML3 //RAML3,
    LOAD_START(_Cla1funcsLoadStart),
    LOAD_SIZE(_Cla1funcsLoadSize)
    RUN_START(_Cla1funcsRunStart),
    PAGE = 0

    csmpasswds : > CSM_PWL_P0 PAGE = 0
    csm_rsvd : > CSM_RSVD PAGE = 0

    /* Allocate uninitalized data sections: */
    .stack : > RAMM0 PAGE = 1
    .ebss : > RAML0 PAGE = 1
    .esysmem : > RAMM1 PAGE = 1
    .sysmem : > RAMM1 PAGE = 1
    .cio : > RAMM1 PAGE = 1

    The UART is configured in flash interrupt function not in RAM function code.

    Regards
    R.Baskar
  • Hi ,

    How to declare variable uses only in CLA function,which is access by two task task1 and task8.

    I my case the all the variables are declared using "Cla1ToCpuMsgRAM" ,so message ram is overflowed .

    Regards

    R.Baskar

  • baskar r said:
    How to declare variable uses only in CLA function,which is access by two task task1 and task8.

    Well if you declare the variables in the .cla file they are global CLA variables so they get assigned to the CLA C compiler section ".bss_cla", which you should place in one of the CLA accessible data RAMs L1/L2. Alternatively, you can define a section in the linker command file

    Cla1DataRAM0 : >  RAML1, page = 1

    and then assign variables to this section #pragma DATA_SECTION(variable, "Cla1DataRAM0 "), but once you configure RAML1 to be a CLA data RAM (through MMEMCFG) these variables will be accessible only to the CLA.

  • Hi,

    Thank for your suggestion,

    But Except RAML3 all the RAMs are  full,please give me idea to use only RAML3 for both CLA execution code and as  for CLA data ram.

    One thing we found that the CLA some times is working we are getting value and most of the time the values are not able to read by CPU code variables.

    Is it very tough and dangerous to use CLA in industrial(power control) application. 

    Regards

    R.Baskar

  • baskar r said:
    But Except RAML3 all the RAMs are  full,please give me idea to use only RAML3 for both CLA execution code and as  for CLA data ram.

    On the 28035, RAML3 is fixed as CLA programming RAM, you cannot store CLA variables here.

    baskar r said:
    One thing we found that the CLA some times is working we are getting value and most of the time the values are not able to read by CPU code variables.

    For the CPU to read variables from the CLA, they need to be in the Cla1ToCpuMsgRam. If they are in RAML1,L2 (assuming these RAMs are configured as CLA data RAMs in the MMEMCFG register) then the CPU will not have access to these. On the F28069, there is an option to make the data RAMs readable by the CPU.