I use S32K144 CAN1, PORT PTE12 for RX and PTE13 for TX. I use MB0 for receiving and MB1 for transferring. Now I enable MB0 interrupt and disable MB1 interrupt in IMASK1 register,only enable receiving and transferring successfully interrupt by using INT_SYS_SetPriority(CAN1_ORed_0_15_MB_IRQn,2); and not enable other interrupt source.In interrupt Handler —— CAN1_ORed_0_15_MB_IRQHandler ,when I received frame,I clearing MB0 bit in IFLAG1 and sending a permanent TX frame to MB1.
Now i say my problem ,if I delete send function in CAN1_ORed_0_15_MB_IRQHandler ,everything will be ok,When I send a frame to board by using upper computer,I can successfully received a frame ,clear MB0 to IFLAG1 register and not continued enter in CAN1_ORed_0_15_MB_IRQHandler .But adding send function,when I received a RX frame ,the TX frame is sent and quit CAN1_ORed_0_15_MB_IRQHandler ,it will also continue entering in CAN1_ORed_0_15_MB_IRQHandler endlessly .When using PE debug ,I found MB0 in IFLAG1 register changed to 1,it can explain this phenomenon. But I had clean this bit by writing 1 to this bit .Why cause this?