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...
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.