CAN / CAN FD Bus Errors
Last updated
Last updated
Copyright © 2024 | All Rights Reserved
The CAN / CAN FD protocol automatically handles protocol errors in hardware - this is what makes CAN / CAN FD robust. If a CAN / CAN FD node receives a message with an error it can destroy the message and cause the transmitter to resend. The CAN / CAN FD node destroys the message by sending an error frame (see the picture below).
CAN / CAN FD bus nodes can detect errors in different ways. For example, a CRC checksum error occurs when the receiver calculates a checksum different than what it received. This means the receiver didn't receive what the transmitter sent. When the CRC error happens a receiver generates an error frame and this causes the transmitter to retransmit the message.
The error frame is six to twelve dominate bits (zeros) and directly violates the bit stuffing rules of CAN / CAN FD. After the dominant bits and passive eight bit delimiter is sent followed by and inter frame separation time (IFS).
The CAN / CAN FD node keeps track of how many times it received or transmitted error frames using error counters. When these error counters reach certain limits the CAN / CAN FD node is first partially disabled (error passive mode) and then totally disabled (bus off mode). This avoids the possibility that a broken node disabling the bus by constantly generating error frames. There are specific rules about how these error counters are incremented or decremented - please consult the CAN / CAN FD spec for details.