CAN Errors
CAN Errors
AGENDA
All the Rx nodes must receive the same information which the Tx application is
intended. If some problem happens in this then we call as CAN error.
The problem may happen in Tx node, or CAN bus or Rx node. CAN protocol has
capability to detect any such problem and raise an error flag.
This Error flag is designed in a way that it destroys the data frame currently
present on the bus.
Depending on this error flag other nodes also may put its own error flags on
CAN bus.
All Error flags and delimiters together forms the error frame on the bus.
Depending on the node which raised the error flag, will increment its error
counter value to keep track and manage CAN error states.
CAN Errors
There are 5 types of CAN errors
Bit Error
Acknowledgement Error
CRC Error
Stuff Error
Form Error
Tx bit 0 1 1 0 0 0 1 0
Sequence
Bit Error
Bit Monitoring
CAN Bus 0 1 1 0 1 0 1 0
Bit Error Exceptions
Use cases:
1. Tx puts Dominant (0) bit but finds a Recessive(1) bit on the bus
2. Tx puts Recessive (1) bit but finds a Dominant (0) bit on the bus
Exceptions:
1) During Arbitration, Tx puts a Recessive bit but finds a Dominant Bit then this
means Lost in Arbitration and not Bit Error.
Note: During Arbitration if Tx node puts a Dominant bit but finds a Recessive bit on the bus,
then this is a Bit Error only.
3) After Ack slot, 11 consecutive Recessive bit is transmitted. In that fixed frame
if a dominant bit is monitored then it will be a form error and ot Bit error.
Acknowledgement Error
When the transmitter node monitors a Recessive bit value in Ack Slot, then it
means it did not get a Acknowledgement. This is Acknowledgement Error
CRC Error
When the Reciever Node has not given acknowledgement but still monitors a
dominant bt in ACK slot, then it’s a CRC Error.
CAN BUS
Case 1: No Error
A
C A
C EOF
D D
K
Tx Node 1 1 1 1 1 1 1 1 1 1
Rx Node 1 x 0 x x x x x x x x
Rx Node 2 x 0 x x x x x x x x
CAN Bus 1 0 1 1 1 1 1 1 1 1
Case 2: Acknowledgement Error
A
C A
C EOF
D D
K
Rx Node 1 x 1 x x x x x x x x
Rx Node 2 x 1 x x x x x x x x
Rx Node 1 x 0 x x x x x x x x
In CAN protocol, if frame has consecutive 5 bits of same polarity then a
complimentary bit is inserted after that called Stuff bit. This helps in better
synchronization between Rx and Tx nodes.
Bit Stuffing is applied from SOF to Checksum field. So the scope of stuff error
also is the same.
The moment the Stuff error is detected, the Rx node raises an error flag the
very next bit, hence destroying the current data frame on the CAN Bus.
Form Error
When the Fixed form of the CAN data frame (CD + AD + EOF) is altered then
Form error occurs.
Points to Remember
When a node Detects a error, it raises the error flag on the bus and destroys that data
frame which is erroneous.
If the error is detected by a Tx node then they are called Tx Errors. Bit and Ack errors
If the error is detected by a Rx node they are Rx Errors. CRC, Form and Stuff errors
For Ack, Bit, Form and Stuff error, The error flag is raised as on the very next bit when the
error was detected, For CRC error, error flag is raised after 1 bit gap(AD) when error is
detected.
Tx error results in increments of TEC and Rx errors result in REC within a node.
Error frame format for all CAN error are same. Depending on at which part of data frame
the error is raised, we can know which error is it.