AnsweredAssumed Answered

MPC5744P FlexCan Tx interrupt problem

Question asked by Jeff liu on Nov 30, 2016
Latest reply on Dec 14, 2016 by Jeff liu

Hi Sirs,

 

I am using Flexcan Tx with MPC5744P platform and encounter interrupt problem.

 

When I use MB[9] transmmit data with no other slave situation and that means Flexcan Tx always gets ACK=1 .

After Can_ECR[TxERRCNT] counts to 96 the interrupt occurs successfully and entered ESR1 ISR handler Can_ESR1[TWRNINT]=1.

During ESR1 ISR handler, I have abort FlexCan CAN_MCR[AEN]=1 and MB[9] as the following setting.
CAN_0.MCR.B.AEN = 1;
CAN_0.MB[9].CS.B.CODE = 9;
CAN_0.ECR.R &= ~(0xFF) ; //clear TXERRCNT

 

Then set CAN_MCR[AEN]=0 and MB[9] Code filed =0xC to leave abort mode and restart tranmit as the following setting.
The flexCan could transmit, but it can't enter Can_ESR1[TWRNINT] anymore.

CAN_0.MCR.B.AEN = 0;
while(0 == CAN_0.MCR.B.FRZACK) ;
CAN_0.MB[9].CS.B.CODE = 0xC; // MB9 trigger

 

I just want to abort Flexcan in ESR1 ISR handler and clear TXERRCNT
then restart FlexCan transmit the Can_ESR1[TWRNINT] will not occur interrupt anymore.

 

Could somebody help me?
Please help me with the suggestion.
Thank you very much.

Outcomes