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/TMS320F28377S: How to debug CLA code

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

Hi

I would like to step over the fir32.asm file in FIR example. I found some videos related to training for c compiler for CLA. I followed the instruction in 

__interrupt void cla1Isr7 ()

   //

   // Uncomment to halt debugger here

   //

   asm(" ESTOP0");

I connected CLA target and ran the program from CPU. It stopped and highlighted CPU1_CLA1 debug probe. But not much happens further. I can see it steps via disassembly but all the MR0-MR3 registers are 00000. And it looks like it is not connected to my assembler code. Could you please refer me to the document describing how properly debug CLA asm file?

Thanks, vadim

  • Vadim,

    I will work with you to try to resolve this issue. Let me try this at my end and see what I find, and I will get back to you.

    Thanks,
    Sira
  • Vadim,

    First, be sure to right click and run the SetupDebugEnv.js script file. After that, here's what I tried from the CCS Debug Perspective:

    1. First connect C28xx_CPU1.
    2. Then connect CPU1_CLA1.
    3. Click on C28xx_CPU1, Load Program and load the .out file for cla_adc_fir32_cpu01.
    4. Click on CPU1_CLA1, Load Symbols and load the same .out file as above.
    5. Click on C28xx_CPU1, then click the Green/Resume button. C28xx_CPU1 status will now change from Suspended to Running. After a few seconds, execution will stop at MDEBUGSTOP inside _Cla1Task8 inside fir32.asm.
    6. CPU1_CLA1 will now be highlighted. Click Green/Resume. Execution will stop at MDEBUGSTOP inside _Cla1Task7 inside fir32.asm.
    7. Now click on CTRL+Shift+F5 and you will be able to step in Assembly through this task and see the MR registers update, until you arrive at MSTOP at the end of the Task. Executing beyond this will lead to CCS errors "Can't Single Step Target Program" because you have arrived at the end of the Task. You will notice that C28xx_CPU1 is no longer Running and is Suspended.
    8. To continue execution, you have to click on C28xx_CPU1, and click Green/Resume which after a few seconds will halt at MDEBUGSTOP inside _Cla1Task7.
  • Hi Sira,

    thank you very much for your help! It works as you described up to item 8. When I try to get out of the task and highlight C28xx_CPU1 Green/Resume button is grayed and the status of CPU1 says running. Green button is available from CLA but if I press it I got this error

    CPU1_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 8.0.803.0) 

    thanks vadim

  • Hi Vadim,

    Do you have the asm( "ESTOP0") uncommented in cla1Isr7()? If it's uncommented, I see it works the way I wrote above. When CLA execution stops at MSTOP at the bottom of _Cla1Task7, C28xx_CPU1 is also Suspended (not Running). Then I go back and highlight C28xx_CPU1 and click Green/Resume, and it will go back to MDEBUGSTOP at the top of _Cla1Task7.

    Thanks,
    Sira
  • Hi Sira,
    I uncommented asm("ESTOP0). Now when I step through asm file and stop at MSTOP CPU1 switches from running to suspended state. I am highlighting CPU1 and click Green/Resume button but the debugger does not stop at asm code and highlight CLA as it did the very first time.
    thanks vadim
  • Hi Vadim,

    I did see some flakiness with this too. My CCS version is 8.2. I tried terminating the debug session and relaunching it and it seemed to help some. Please see if that helps.

    In any case, are you able to do what you set out to do with respect to debugging the CLA code?

    Thanks
    Sira
  • Hi Sira,
    I have updated for ver 8.2 but it did not help. I noticed if I do not step in assembler it works, but as soon as I step in it stops after first MSTOP. I can only debug one cycle and than have to reload everything. Thanks vadim
  • Hi Vadim,

    Please refer to www.ti.com/.../spruge6b.pdf Page 15, section 3.3, Point 4. I suspect it is related to our observations.

    MPC halts at or after the MSTOP with a task already pending
    If you are single-stepping or halted in "task A" and "task B" comes in before the MPC reaches the
    MSTOP, then "task B" will start if you continue to step through the MSTOP instruction. Basically if
    "task B" is pending before the MPC reaches MSTOP in "task A" then there is no issue in "task B"
    starting and no special action is required.

    MPC halts at or after the MSTOP with no task pending
    In this case you have single-stepped or halted in "task A" and the MPC has reached the MSTOP
    with no tasks pending. If "task B" comes in at this point, it will be flagged in the MIFR register but it
    may or may not start if you continue to single-step through the MSTOP instruction of "task A."
    It depends on exactly when the new task comes in. To reliably start "task B" perform a soft reset
    and reconfigure the MIER bits. Once this is done, you can start single-stepping "task B."

    In our example, the ADC interrupts trigger Task 7 in the CLA, and the completion of Task 7 triggers an interrupt to the C28x through the PIE which causes CLAISR7() to run on the C28x. So the CLA only executes Task 7 repeatedly (after first executing Task 8 once) through ADC interrupts.

    Here are the steps I followed:
    1. Assembly step until MSTOP. C28xx_CPU1 will be suspended, click on it and Resume Running it.
    2. Return to CPU1_CLA1, click on CPU Reset (CTRL+Shift+R). This will change MIER from 0x00C0 to 0x0000. Change it back to 0x00C0.
    3. Modify MIFRC Bit 7 to 1, this will change MIFR Bit 7 to 1, and move execution to MDEBUGSTOP at the top of _Cla1Task7. (or maybe you have to Resume again, but I didn't have to).

    This way you can assembly step through the CLA repeatedly.

    Thanks,
    Sira
  • Hi Vadim,

    Please click on "Verified Answer" if my reply resolved your issue.

    Thanks,
    Sira