MSCan & Bus-off Recovery

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MSCan & Bus-off Recovery

3,517 Views
RubenCG
Contributor III
Hi all,

I want to know what do you do in the error interrupt when the node is in Bus-off state.
I catch the interrupt but I really don't know what to do. I initialize the mscan as automatic recovery in bus-off, so I suppose the node waits for the 128 occurrences of 11 consecutive recessive bits on the CAN bus and then the node can transmit again... but do you initialize again the node? do you do anything after bus-off recovery?

Thanks in advance
Ruben 
Labels (1)
0 Kudos
Reply
4 Replies

1,009 Views
nandu
Contributor III

Hi Ruben and Everyone in the forum,

 

I too have the same exactly doubt regarding the CAN bus-off recovery ISR. I am using the MC9S12DG128.

 

And I did not set the BORM [Bus-Off Recovery Mode] bit of CAN0CTL1 register to 1 anywhere in my code, that means, I selected the bus-off recovery mode as Automatic recovery. So, now when I create Bus-off condition by shorting CAN_H & CAN_L pins, the interrupt occurs. And as  Mr.Ruben asked the question, do I need to initialize the CAN Controller again inside the Bus-off ISR..???Because, as I selected the Bus-off Recovery Mode as Automatic, according to msCAN protocol, the msCAN will become Error Active again after counting 128 occurrences of 11 consecutive recessive bits  on the CAN bus..so, it will not create any problem... 

 

When I discuss this issue with my friend, he told me that we need to Initialize the CAN controller in the CAN Busoff ISR to avoid the un-expected CAN Message transmission from the node or to clear or flush all the Tx  buffer registers of the msCAN .....

 

I want to confirm it ... 

 

Hi, Ruben and everyone if you guys have cleared with this issue, kindly guide me plz...

 

0 Kudos
Reply

1,009 Views
kef
Specialist I

Automatic busoff recovery works very well, reinitialization isn't necessary. But aborting scheduled Tx messages may make sense. In case some command was send and not delivered due busoff, it is not known how long busoff condition will take place. Probably it would be wrong to automatically send/resend undelivered command when busoff goes away, possibly after many minutes, hours etc... But it is application dependent.

 

 

0 Kudos
Reply

1,009 Views
RubenCG
Contributor III
Thanks Kef for your interest in our "problem", I'll introduce the code to abort the scheduled Tx datain my bus-off ISR. I hope it works!
Thanks again
Ruben
 
0 Kudos
Reply

1,009 Views
nandu
Contributor III

Hi Kef,

 

Thanks alof for the confirmation. I am cleared with this issue now :smileyhappy:.

0 Kudos
Reply