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.

TMS320F28377D: Using CLA and debugging for TMS320F28377D

Part Number: TMS320F28377D

Hi,

I am trying to use cla of cpu2. I took example code "cla_iir2p2z_dc_cpu01" & "cla_iir2p2z_dc_cpu01" as reference. When I try to debug this code, initially  "CLA_runTest();" function is executed and it is entering cla_task1 as it is expected. After its completion CLA is halted and when I  select CPU2_CLA1 and run, it is showing error as 

CPU2_CLA1: Can't Run Target CPU: (Error -2060 @ 0x0) Requested operation cannot be done while device is running. Halt the device, and retry the operation. (Emulation package 7.0.100.0)

Also, as shown in below attachment, it is showing that Cla1Task1 doesnot contain frame information.

What does this mean? How can I debug CLA?

Regards,

Lowkya

  • lowkya goli said:
    After its completion CLA is halted and when I  select CPU2_CLA1 and run, it is showing error as 

    If I understand, you are trying to start the CLA by pressing the "run" button in CCS.  If the CLA is idle it can only be started by a peripheral interrupt or by the C28x writing to the force register. 

    For guidance, the CLA hands-on-workshop is very good at describing the CLA, how to develop code for it, and also how to debug it in Code Composer Studio. I think you will find it helpful.

    Here is the link to the CLA workshop:

    Click here for more CLA FAQs and resources.

    I hope this helps. If this answers your question, please click the green "This resolved my issue" button.

    Regards,

    Lori

  • Hi Lori,

    Thanks for your response. I have gone through the workshop.

    I have tried using ADCINT1 interrupt as trigger aswell. From the start of main() I kept breakpoints at certain places while debugging and I was looking at disassembly. When code reaches "CLA_runTest()" ,  its halted at some point and when i look at disassembly it showing as below. In my code I have an ADC ISR along with CLA. Program is not going into that ISR also. Does this mean cpu2 is stuck somewhere?

    You can take a look at my initialization. 

    1563.main_cpu2.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    //
    // Included Files
    //
    #include "F28x_Project.h"
    #include "ElonCPU2_config.h"
    #include "math.h"
    #include "CLA.h"
    //
    // Defines
    //
    #define WAITSTEP asm(" RPT #255 || NOP")
    //
    // Globals
    //
    //Task 1 (C) Variables
    // NOTE: Do not initialize the Message RAM variables globally, they will be
    // reset during the message ram initialization phase in the CLA memory
    // configuration routine
    #ifdef __cplusplus
    #pragma DATA_SECTION("CpuToCla1MsgRAM");
    float timer;
    #pragma DATA_SECTION("Cla1ToCpuMsgRAM");
    float result;
    #else
    #pragma DATA_SECTION(timer,"CpuToCla1MsgRAM");
    float timer;
    #pragma DATA_SECTION(result,"Cla1ToCpuMsgRAM");
    float result;
    #endif //__cplusplus
    #ifdef __cplusplus
    #pragma DATA_SECTION("CpuToCla1MsgRAM");
    float fVal;
    #pragma DATA_SECTION("Cla1ToCpuMsgRAM");
    float fResult;
    #else
    #pragma DATA_SECTION(fVal,"CpuToCla1MsgRAM");
    float fVal;
    #pragma DATA_SECTION(fResult,"Cla1ToCpuMsgRAM");
    float fResult;
    #endif //__cplusplus
    float y[BUFFER_SIZE];
    float asin_expected[BUFFER_SIZE]={
    1.570796, 1.393789, 1.320141, 1.263401, 1.215375,
    1.172892, 1.134327, 1.098718, 1.065436, 1.034046,
    1.004232, 0.9757544, 0.9484279, 0.9221048, 0.8966658,
    0.8720123, 0.8480621, 0.8247454, 0.8020028, 0.7797828,
    0.7580408, 0.7367374, 0.7158381, 0.6953120, 0.6751316,
    0.6552721, 0.6357113, 0.6164289, 0.5974064, 0.5786270,
    0.5600753, 0.5417370, 0.5235988, 0.5056486, 0.4878751,
    0.4702678, 0.4528166, 0.4355124, 0.4183464, 0.4013104,
    0.3843968, 0.3675981, 0.3509074, 0.3343180, 0.3178237,
    0.3014185, 0.2850964, 0.2688521, 0.2526802, 0.2365756,
    0.2205333, 0.2045484, 0.1886164, 0.1727327, 0.1568929,
    0.1410927, 0.1253278, 0.1095943, 0.09388787, 0.07820469,
    0.06254076, 0.04689218, 0.03125509, 0.01562564
    };
    uint16_t pass=0;
    uint16_t fail=0;
    //
    // Function Prototypes
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello,

    It often helps to debug one thing at a time to check the configuration of each part.  

    • If you don't enable the CLA, does the C28x take ADC interrupt as you expect?
    • If you setup the CLA and have the C28x SW force the ADC CLA task, does the task execute?
    • After the case above, when the task completes, does the C28x take the associated claISR from the PIE?
    • The CLA is edge triggered (not level triggered). The task has to be enabled when the interrupt comes in for the CLA to see the edge. This means that if a interrupt has already been flagged when the CLA task is enabled, then  it will be missed by the CLA.  This may mean re-ordering of your initialization and/or making sure no interrupts are flagged when the CLA task is enabled.

    Regards

    Lori

  • Hi Lori,

    I have debugged as you suggested. I observed that when I trigger CLA using interrupt, its working fine but when I trigger task using software(by setting IACK bit), CLA seems to be not executing the task. Do I just have to set IACK bit for software trigger or anything else to be done to trigger the task?

    Thanks,

    Lowkya

  • Lowkya,

    Please see this FAQ regarding SW triggering a task. 

    https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/795549/2942520#2942520

    Regards

    Lori