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.

C2000 (TMS320F28335): Unused interrupts

Guru 20045 points


Hello,

All unused ISRs in TI's example code contain an asm (" ESTOP0"); and a for(;;) (e.g. see code below)

I am trying to decide whether or not to remove the for(;;).  Also, If I remove it, I believe I should add code to acknowledge the relevant PIE group.

Does anyone, including anyone at TI, have an opinion on this issue?

Thanks,
Stephen

interrupt void NMI_ISR(void)       // Non-maskable interrupt
{
  // Insert ISR Code here

  // Next two lines for debug only to halt the processor here
  // Remove after inserting ISR Code
  asm ("      ESTOP0");

  for(;;);

}

  • It is really a system choice what you want to do with unused interrupts. The code included in TI's example is for debugging. You may want to call an error routine, as an example, or just return.
  • I agree with Lori. If an unused interrupt reaches the CPU, it's an error condition and should be handled according to the overall needs of the system.

    If you don't acknowledge the PIE interrupt before returning, you will block any further interrupts from that PIE group. If you want the MCU to reach a safe state and shut down, that could be good. If you want the MCU to try to keep running, blocking interrupts could be bad.
  • Hello Lori,

    Thanks for the reply.

    If I just return from the ISR an internet group will be effectively disabled. For example, if PIE 7.8 reserved interrupt occurs because of noise in the system and I don't acknowledge the group, none of the DMA interrupt will occur. 

    Therefore, I believe I should at least Acknowledge the relevant PIE group.  However, that will also allow the PIE 7.8 reserved interrupt to occur again and that interrupt may occur at a high rate.  Disabling that particular interrupt would mitigate that issue.  

    However, I believe adding PieCtrlRegs.PIEIER7.bit.INTx8 = 0. in the ISR won't having effect if it has been enabled prior to entering the ISR.  Also, if it wasn't enabled before entering the ISR, I believe the uC would enable it after exiting the ISR.  Am I correct to say that there isn't any way to disable a particular interrupt in an ISR?

    Stephen

  • Hello Adam,

    I didn't see your post before I posted my most recent post.  

    The system I am working with can't safely shut down.  Therefore, unless you have any other ideas, I believe I'll need to acknowledge group interrupt and alert the user after returning from the ISR.

    What do you think?

    Thanks,
    Stephen

  • Hello Adam,

    Do you agree that it is not possible to disable a particular interrupt in an ISR.

    Stephen
  • Stephen,

    The PIEIER registers are not modified when entering or exiting an ISR. So it is possible to enable and disable interrupts from inside of ISRs.
  • Hello Adam,

    I guess I got the IERx confused with the PIEIERx.y.  According to the figure 79 from sprufb0d.pdf (see figure below), the IERx is cleared before entering the ISR and re-enabled after exiting the ISR.

    Thanks,
    Stephen