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/TMS320F28379D: initCLA1 in TMS320f28379D

Part Number: TMS320F28379D

Tool/software: Code Composer Studio

I try to init CLA but when my program go to line 46 in below picture ; it jume to illegal interrupt and i can debug this ; please help me

thank and best regard !

my code!400Hz_NPC_CAN_BANG_TU.rar

  • Anh,

    There is nothing obvious about the line you highlighted that should cause an illegal trap.  Please try the following:

    • Comment out the breakpoint (ESTOP0 instruction) and the for(;;); loop.  Step through the ISR and return.  Where does the PC return to?  Is it where you expected?  If not, where did it end-up?
    • In the ISR inspect the stack - you should see values that align to the following.  Does the return address on the stack look correct?  Is the location of the stack where you expect? (see next question)
      T:ST0
      ACC
      P
      AR1:AR0
      DP:ST1
      DBGSTAT:IER
      Return Addr
      empty  < SP points here (even or odd address)

    • Does the stack overlap with any program memory?  Check the memory linker file (.cmd) and map file (.map)
    • Provide a screenshot of the disassembly window near the location where the ITRAP occurs (setting the CLA registers).  Does the disassembly seem reasonable for the C code?  This will tell if the RAM has been corrupted.

    Regards

    Lori

  • Dear Lori;

    -When 1 comment out Estop and for(;;) loop PC come to TIMER1_ISR() like first picture below.

    -sorry i dont understand your ideal about ( ISR inspect the stack)

    - I see linker cmd  and map file but I cant find any thing wrong.

    -in second picture below ; the illigeal interrupt occor when I step into line 46

    Thank you very very much;

    Tuan Anh

  • anh nguyen said:
    -in second picture below ; the illigeal interrupt occor when I step into line 46

    I think you mean line 40 or 41?

    Line 40 is assigning the LS4 memory block to the CLA but it is also the memory block that the C28x is fetching opcodes from (i.e. C28x program is running from 0xa1b9 which is LS4 - refer to the memory map in the device datasheet).  

    Refer to the information for local shared RAM and the CLAPGM bits (section 6.3.5.2 Local Shared RAM (LSx RAM) of the TRM).  I believe for the configuration you have LS4 is only available to the CLA and no longer available to the C28x for code execution.  Thus when the next instruction is executed the C28x takes an illegal trap.

    Regards

    Lori

  • dear MR Lori;

    That illegal trap disappeared; but NOW my CLA1 task1 not run but the CLA1_1 interrupt executed .

    I trigger CLA1 task by adcb_int1 and i see adcb_int1 flag has been set.

    Can you give me some recommend ?

    Regards

    Anh

  • Anh,

    It is strange that the CLA issued a CPU interrupt but it didn't execute. 

    How are you determining that the task didn't run?  If you put a breakpoint in the task (mdebugstop) does the CLA halt on it? 

    What is the CLA PC (MPC) value when the C28x CPU takes the interrupt?  Does it correspond to the MSTOP instruction of the CLA task?

    Regards

    Lori

  • Dear Mr Lori

    I Have explained how I determine task do not run in another post !

    Thank you very much !

    Tuan anh