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.

Illegal operation TRAP cause

Hi C2000 champion

My customer use F28062 in their solar inverter. They found F28062 would jump in to ILLEGAL_ISR sometime in product functions test.

Customer want to know whether CCS or C2000 registers can record which function called  that cause Illegal operation TRAP? 

Eric

South china MCU FAE

  • Eric,

    The most likely cause is the PC accessing an illegal opcode.  Possibly there is a stack overflow or the PC is running into illegal memory for come reason.

    The CPU user's guide says: "As part of its operation, the illegal-instruction trap saves the return address on the stack. Thus, you can detect the offending address by examining this saved value."  Look at the SP register after the TRAP occurs to check it's in range, and if so what return value it points to.

    Check also that your code doesn't put a branch just before an illegal memory range - see the "Pre-fetching beyond valid memory" advisory in the errata sheet.

    Regards,

    Richard 

  • Eric -

    In addition to Richard's comments, there is a wiki page that describes some tips on how to debug an ITRAP.

    processors.wiki.ti.com/.../Interrupt_FAQ_for_C2000

    Regards
    Lori
  • Thanks Richard, Lori, I will suggest customer to check follow the guide.
    Eric