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?
Solved! Go to Solution.
2024-11-09 03:06 AM
Hello,
@Elliott99 wrote:
However, resetting the peripheral does not reset the REC/TEC counters.
How did you perform the reset?
@Elliott99 wrote:
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.
It could be a possible solution based on error confinement mechanism:
@Elliott99 wrote:
Is it possible to just disable/re-enable the clock gate to the CAN peripheral to quickly clear these counters?
No I don't think disabling/enabling CAN clock will reset these counters as the registers keep their values when CAN Clock is disabled. You need to reset the peripheral for that.
2024-11-09 03:06 AM
Hello,
@Elliott99 wrote:
However, resetting the peripheral does not reset the REC/TEC counters.
How did you perform the reset?
@Elliott99 wrote:
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.
It could be a possible solution based on error confinement mechanism:
@Elliott99 wrote:
Is it possible to just disable/re-enable the clock gate to the CAN peripheral to quickly clear these counters?
No I don't think disabling/enabling CAN clock will reset these counters as the registers keep their values when CAN Clock is disabled. You need to reset the peripheral for that.