Search topics...
CANBus Load and Practical Designfoundational

What happens when a CAN node detects an error during reception or transmission?

0 upvotes
Practice with AISoon
Study the fundamentals first — CAN topic page

When any CAN node detects an error (via any of the five detection mechanisms), it immediately begins transmitting an error frame to notify all other nodes. The error frame consists of an error flag followed by an error delimiter.

If the detecting node is Error Active, it transmits an active error flag: 6 consecutive dominant bits. This deliberately violates the bit-stuffing rule (which limits consecutive same-polarity bits to 5) and overwrites whatever is currently on the bus. Every other node on the bus detects this as a stuff error and also begins transmitting its own error flag. The result is that the entire corrupted frame is destroyed within 6-12 bit times, and all nodes discard it.

If the detecting node is Error Passive, it transmits a passive error flag: 6 consecutive recessive bits. Because recessive bits do not override the bus, a passive error flag does not disturb ongoing traffic from other nodes. It is effectively a silent notification — only the detecting node acts on it.

After the error flag, all nodes transmit an error delimiter (8 recessive bits) and then wait for the inter-frame space (3 bit times) before the bus returns to idle.

The original transmitter then automatically retransmits the message, starting arbitration from scratch. If the same message keeps failing, the transmitter's TEC increments by 8 for each failure, progressing it toward Error Passive and eventually Bus Off. Meanwhile, receivers that detected the error increment their REC by 1 (or 8 if they were the first to detect it, depending on the error type).

This automatic detection-flagging-retransmission cycle is completely transparent to the application layer — the CAN controller handles it in hardware. The application only sees successfully received, CRC-verified frames. The worst-case retransmission delay for a single error is approximately 23 bit times (6 error flag + 8 delimiter + 3 IFS + 6 SOF/arbitration overlap).

Source: CAN Q&A