We know the importance of the CAN bus in the automotive industry. Due to its robust performance, it makes ideal for multiple error detecting mechanisms. Error in CAN bus occurs due to many reasons such as improper wiring, faulty cables, inaccurate transmission, improper CAN nodes, noise, etc.
CAN bus needs to detect the error, classify and fix it for continuous and better performance of the system. CAN controller consists of an On-chip error detection mechanism that is responsible for detecting the error during the transmission or reception of a message, if the node detects an error it will raise an error flag.
There can be five types of CAN bus error:
- Bit error: All the receiver nodes read the data bit by bit comparing it with the transmitted value. Bit error will occur at that stage when the transmitted bit does not match with the received bit.
- Bit stuff error: This method is used in the CAN network for Synchronization purposes. The transmitter node is going to transmit five consecutive bits of the same logic level, then the sixth bit must be a compliment, and the sixth bit which is added during transmission will be automatically removed at the receiver end. Bit stuffing also ensures that the bits are not misinterpreted as an error frame that marks the end of a message. Thus if the receiver node finds six sequences of bits with the same logic level, then the receiver will confirm this as a bit stuff error.
- Form error: ISO -11898 defined CAN standard frame format, in which certain fields must follow the logic level as defined. ACK, CRC and 8-bit EOF must be recessive. SOF should be dominant. Also, the delimiter bit should be maintained by placing it in a predefined place. If any of these logic levels are different then the receiver node will detect that as a Form Error.
- CRC(Cyclic redundancy check) field: The transmitting node calculates the 15-bit CRC value and sends it to the receiver node, all the receiver nodes will also calculate the CRC value and compare it with the transmitted CRC value to check if they are the same. If the CRC value differs, the receiver node will send an error flag over the CAN bus.
- ACK(Acknowledgement) error: Transmitter will send the recessive ACK bit present in the CAN message to the receiver node. All the receiver nodes irrespective of the message received should send the dominant bit to the transmitter node to check the reception of the message, if the receiver node fails to send the dominant bit in the ACK field then the transmitter confirms it as an ACK error.