2024-11-08 11:23 AM - last edited on 2024-11-08 11:24 AM by SofLit
I have a system in which the power source to the CAN transceiver interfaced to the on-chip CAN peripheral is common between multiple MCU's vis-a-vis a connector. I have experienced issues wherein if the connection is broken and then re-connected between the multiple nodes, upon reconnection I get an indefinite amount of CAN Error Interrupts firing due to Bit Dominant Errors. I perform the manual reset operation as proscribed in the reference manual (I have ABOM disabled):
"If ABOM is cleared, the software must initiate the recovering sequence, by requesting
bxCAN to enter and to leave initialization mode. Note: In initialization mode, bxCAN does not monitor the CANRX signal, therefore it cannot complete the recovery sequence. To recover, bxCAN must be in normal mode"
However, resetting the peripheral does not reset the REC/TEC counters. To do so, I have seen a possible solution is to enter the peripheral into LOOPBACK mode and just receive frames from "myself" until the counters get low enough the Bus-Off, Error Passive, and Error Active flags are all cleared.
Is it possible to just disable/re-enable the clock gate to the CAN peripheral to quickly clear these counters?