CAN bus errors: how the bus finds and contains them
CAN was built to keep working in noisy places. It detects faults five ways, signals them with error flags and quietly removes a node that has truly failed. Here is how that works.
CAN detects errors in five ways, and every node that spots one raises an error flag so the faulty frame is discarded and resent. To stop a broken node from jamming the bus forever, each node keeps two error counters. As they climb it steps back, from full participation, to a quieter passive mode and finally off the bus altogether. This mechanism, called fault confinement, is what lets CAN stay reliable in electrically hostile places.
| State | When | What the node does |
|---|---|---|
| Error Active | Both counters below 128. Normal operation. | takes part fully, raises active error flags |
| Error Passive | A counter reaches 128. | still communicates, raises silent passive flags |
| Bus Off | The transmit counter reaches 256. | disconnects, no communication, needs a reset |
How a CAN node spots an error
No bus is perfect, so CAN assumes errors will happen and checks for them constantly. There are five checks running in parallel, three performed by receivers and two by the transmitter. If any one fails, the node treats the frame as bad. Between them they catch everything from a single flipped bit to a frame whose structure is wrong.
One of these deserves a note on its own. To keep enough signal transitions on the bus for nodes to stay synchronised, the transmitter applies bit stuffing: after five bits of the same level it inserts one of the opposite level, which receivers automatically remove. That same rule doubles as an error check. Tap each type below to see what it catches.
Error flags: how a node raises the alarm
When a node detects an error it does not stay quiet. It transmits an error flag, a deliberate burst of six identical bits that breaks the normal frame rules so other nodes notice. There are two kinds, and the difference matters a great deal.
An active error flag is six dominant bits. Because dominant bits win on the bus, it overrides whatever is being sent, destroying the current frame and forcing every node to react. That is how a healthy node makes sure a bad frame is thrown away and resent. A passive error flag is six recessive bits. Recessive bits yield to any dominant traffic, so a passive flag is effectively silent: the node registers its complaint but cannot disturb anyone else. After either flag comes an error delimiter of eight recessive bits, giving the bus time to settle before traffic resumes.
The counters that decide a node's fate
If a node could raise active error flags forever, one faulty unit would take down the whole bus. CAN prevents this with two counters in every node: a Transmit Error Counter and a Receive Error Counter. The trick is that they move asymmetrically. A transmit error adds 8, a receive error adds 1, but a successfully handled frame subtracts only 1.
That imbalance is deliberate. A node suffering the odd glitch from noise recovers easily, because good frames keep pulling its counters down. A node that is genuinely broken sees its counters climb far faster than they fall, which is the signal that it, not the bus, is at fault. The transmitter is penalised more heavily because, statistically, the node that keeps failing to transmit is the likely culprit. Drive it yourself below.
Active, passive, bus off
The two counters drive a node between three states, and the rules are simple. A node powers up Error Active: both counters are below 128, it takes full part in traffic and raises active error flags when it sees a problem. If either counter reaches 128 it becomes Error Passive: it still communicates, but now its error flags are the silent, recessive kind, and it must wait a little longer before sending again so it cannot dominate the bus. If the transmit counter climbs all the way to 256 the node goes Bus Off and disconnects entirely.
Recovery runs the other way. An Error Passive node returns to Error Active once both counters fall back to 127 or below. A Bus Off node is more serious: it takes host intervention, after a mandatory spell of watching the bus sit idle, before it is allowed back as Error Active.
What this means when you are debugging
A node in Bus Off has switched itself off the network: it sends and receives nothing. On the bus that looks like a unit that has gone completely silent, which lines up with the no communication symptom you would chase in a troubleshooting session. Getting it back usually needs host intervention, with the controller watching a long run of idle bus time before the node is allowed to rejoin.
For anyone capturing data, the useful part is seeing the errors at all. A bus that is merely marginal, with counters climbing but never reaching Bus Off, can otherwise hide as the occasional missing message. The data loggers from Influx Technology record CAN errors in a standard ASAM format alongside the traffic, so a noisy or failing bus shows up in the log as evidence rather than as a gap you have to explain after the fact.
A CAN error is the system working, not breaking. The bus detects the fault, discards the frame, resends it and only removes a node once it has truly given up.
CAN errors FAQ
What are the five types of CAN error?
Bit, stuff, form, CRC and ACK errors. Receivers check for stuff, form and CRC errors. Transmitters check for bit and ACK errors. Any single fault may trip more than one at once.
What is the difference between an active and a passive error flag?
An active error flag is six dominant bits, so it overrides bus traffic, destroys the bad frame and forces a resend. A passive error flag is six recessive bits, so it stays silent and cannot disturb others. Error active nodes send active flags, error passive nodes send passive ones.
What are TEC and REC in CAN?
They are the Transmit Error Counter and the Receive Error Counter, kept by every node. A transmit error adds 8, a receive error adds 1 and a correctly handled frame subtracts 1, so errors raise the counters faster than success lowers them.
When does a CAN node go bus off?
When its Transmit Error Counter reaches 256. The node disconnects from the bus and stops all communication. It normally needs host intervention to recover, after a mandatory period of watching the bus stay idle.
When does a node become error passive?
When either error counter reaches 128. The node keeps communicating but sends silent passive error flags and waits a little longer between frames. It returns to error active once both counters fall to 127 or below.
What is bit stuffing?
After five consecutive bits of the same level, the transmitter inserts one bit of the opposite level to keep enough transitions on the bus for synchronisation, and receivers remove it. Six identical bits where a stuff bit was due is a stuff error.
Written by the engineering team at Influx Technology. Error handling follows the CAN standard, ISO 11898-1. Confirm details against the specification for your controller.
Log CAN errors alongside your data
The data loggers from Influx Technology, including the REXGEN and REBEL ranges, capture CAN errors in a standard format together with the bus traffic, so a marginal or failing network is visible in the log. REXDESK and DIALOG help you review what was recorded.