MSCan & Bus-off Recovery

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MSCan & Bus-off Recovery

3,666 次查看
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 
标签 (1)
0 项奖励
回复
4 回复数

1,158 次查看
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 项奖励
回复

1,158 次查看
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 项奖励
回复

1,158 次查看
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 项奖励
回复

1,158 次查看
nandu
Contributor III

Hi Kef,

 

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

0 项奖励
回复