AnsweredAssumed Answered

S12ZVM_CAN  ISR(Cpu_Interrupt)

Question asked by Katherine zhangqianqian on Feb 15, 2019
Latest reply on Feb 18, 2019 by Diana Batrlova

Dear all,

There was a problem when I implemented an interrupt handler. As shown below.

__interrupt void INT_STATUS(void){
 byte Status = CAN0RFLG;              /* Read the status register */
 if((Status & CAN_STATUS_BOFF_MASK) == CAN_STATUS_BOFF_MASK) { /* Bus-Off state */
   ErrFlag |= CAN_STATUS_BOFF_EXT_MASK;
   ErrFlag |= (Status & 0x83U);       /* Add error flags */
 }
 else {
   ErrFlag |= (Status & 0xBFU);       /* Add error flags */
 }
 CAN0RFLG = 0xFEU;                    /* Reset error flags */
 if ((Status & CAN_STATUS_BOFF_MASK) == CAN_STATUS_BOFF_MASK) { /* Is busoff error detected? */
   CAN1_OnBusOff();                   /* If yes then invoke user method */
 }
 CAN0RFLG = CAN0RFLG_CSCIF_MASK;
}
The CPU generated an error interrupt while implementing the above interrupt function.As shown below.
ISR(Cpu_Interrupt)
{
  /*lint -save -e950 Disable MISRA rule (1.1) checking. */
  asm(BGND);
  /*lint -restore Enable MISRA rule (1.1) checking. */
}
I didn't find the problem point.
I need your help.
Thanks.

Outcomes