CAN with Flexible Data-Rate Specification
https://web.archive.org/web/20151211125301/http://www.bosch-semiconductors.de/media/ubk_semiconductors/pdf_1/canliteratur/can_fd_spec.pdf
4 MESSAGE VALIDATION
The point of time at which a message is taken to be valid, is different for the Transmitter and the Receivers of the message.
Transmitter:
The message is valid for the Transmitter, if there is no error until the end of END OF FRAME. If a message is corrupted, retransmission will follow automatically and accord- ing to prioritization. In order to be able to compete for bus access with other messages,
retransmission has to start as soon as the bus is idle. The number of retransmission attempts may be limited (by configuration) to a specific value. By default, the number of retransmissions is not limited
Receivers:
The message is valid for the Receivers, if there is no error until the last but one bit of END OF FRAME. The value of the last bit of END OF FRAME is treated as ’don’t care’, a dominant value does not lead to a FORM-ERROR see section 6.1: Error Detection). A Receiver that detects a dominant bit at the last bit of END OF FRAME responds with an OVERLOAD
FRAME.
4.1 MESSAGE FILTERING
Message filtering is based upon the whole Identifier, it decides whether a received message is discarded or is stored inside the node. Optional mask registers that allow any IDENTIFIER bit to be set ’don’t care’ for message filtering may be used to select groups of IDENTIFIERS to be mapped into the attached receive buffers.
If mask registers are implemented every bit of the mask registers must be programmable, i.e. they can be enabled or disabled for message filtering. The length of the mask register can comprise the whole IDENTIFIER or only part of it.
5 CODING
BIT STREAM CODING
The bit stream in a message is coded according to the Non-Return-to-Zero (NRZ) method. This means that during the total bit time the generated bit level is either dominant or recessive.
In order to limit the maximum distance between edges available for synchronization, the frame segments START OF FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD and CRC SEQUENCE are coded by the method of bit stuffing. Whenever a Transmitter detects five consecutive bits of identical value in the bit stream to be transmitted, it automatically inserts a complementary bit (called STUFF-BIT) into the actual transmitted bit stream.The Receiver shall recognize a sequence of five consecutive bits of identical value and discard the following STUFF-BIT.
The remaining bit fields of the DATA FRAME or REMOTE FRAME (CRC DELIMITER, ACK FIELD, and END OF FRAME) are of fixed form and not stuffed. The ERROR FRAME and the OVERLOAD FRAME are of fixed form as well and not coded by the method of bit stuffing.
In CAN FD format frames, the CAN bit stuffing method is changed for the CRC SEQUENCE. Here, the STUFF-BITS shall be inserted at fixed positions. There shall be a fixed STUFF-BIT before the first bit of the CRC SEQUENCE, even if the last bits of the preceding field do not fulfill the CAN stuff condition. A further STUFF-BIT shall be inserted after each fourth bit of the CRC SEQUENCE. The value of such a fixed STUFF-BIT shall be the inverse value of the bit preceding the fixed STUFF-BIT. A Receiver shall discard the fixed STUFF-BITS from the bit stream for the CRC check, it shall detect a STUFF-ERROR if the fixed STUFF-BIT has the same value as its preceding bit. The number of fixed STUFFBITS in the CAN FD format CRC SEQUENCE is equal to the maximum number of stuff bits that would result from applying the CAN Format stuffing method. The fixed STUFF-BITS in the CRC SEQUENCE shall be discarded by the Receivers.
6 ERROR HANDLING
6.1 ERROR DETECTION
There are 5 different error types (which are not mutually exclusive):
BIT-ERROR
A unit that is sending a bit on the bus also monitors the bus. A BIT-ERROR has to be
detected at that bit time, when the bit value that is monitored is different from the bit
value that is sent. An exception is the sending of a recessive bit during the stuffed bit
stream of the ARBITRATION FIELD or during the ACK SLOT. Then no BIT-ERROR occurs
when a dominant bit is monitored. A Transmitter sending a PASSIVE ERROR FLAG and
detecting a dominant bit does not interpret this as a BIT-ERROR.
STUFF-ERROR
A STUFF-ERROR shall be detected at the bit time of the 6th consecutive equal bit level in a message field that should be coded by the method of bit stuffing.
CRC-ERROR
The CRC SEQUENCE consists of the result of the CRC calculation by the Transmitter. The Receivers calculate the CRC in the same way as the Transmitter. A CRC-ERROR shall be detected if the calculated result is not the same as that received in the CRC SEQUENCE.
FORM-ERROR
A FORM-ERROR shall be detected when a fixed-form bit field contains one or more ille- gal bits. (Exception is the detection of a dominant bit during the last bit of END OF FRAME by a RECEIVER, or the detection of a dominant bit during the last bit of ERROR DELIMITER or OVERLOAD DELIMITER by any node). When the value of a fixed STUFF-BIT in the CAN FD format CRC SEQUENCE is equal to its preceding bit, this shall also be detected as a FORM-ERROR.
ACKNOWLEDGMENT-ERROR
An ACKNOWLEDGMENT-ERROR has to be detected by a Transmitter whenever it does not monitor a dominant bit during the ACK SLOT.
6.2 ERROR SIGNALLING
A station detecting an error condition signals this by transmitting an ERROR FLAG. For an error active node it is an ACTIVE ERROR FLAG, for an error passive node it is a PASSIVE ERROR FLAG. Whenever a BIT-ERROR, a STUFF-ERROR, a FORM-ERROR or an ACKNOWLEDGMENT-ERROR is detected by any station, transmission of an ERROR FLAG is started at the respective station at the next bit. Whenever a CRC-ERROR is detected, transmission of an ERROR FLAG starts at the bit following the ACK DELIMITER, unless an ERROR FLAG for another condition has already been started. A CAN FD node operating in the DATA-PHASE shall switch back to the ARBITRATION- PHASE when starting an ERROR FLAG
7 FAULT CONFINEMENT
With respect to fault confinement a unit may be in one of three states:
• error active
• error passive
• bus_off
An error active unit can normally take part in bus communication and sends an ACTIVE ERROR FLAG when an error has been detected.
An error passive unit must not send an ACTIVE ERROR FLAG. It takes part in bus communication, but when an error has been detected only a PASSIVE ERROR FLAG is sent. Also after a transmission, an error passive unit will wait before initiating a further transmission. (See SUSPEND TRANSMISSION)
A bus_off unit is not allowed to have any influence on the bus. (E.g. output drivers switched off.)
For fault confinement two counts are implemented in every bus unit:
- TRANSMIT ERROR COUNT
- RECEIVE ERROR COUNT
These counts are modified according to the following rules:(note that more than one rule may apply during a given message transfer)
- When a RECEIVER detects an error, the RECEIVE ERROR COUNT will be increased by 1, except when the detected error was a BIT-ERROR during the sending of an ACTIVE ERROR FLAG or an OVERLOAD FLAG.
- When a RECEIVER detects a dominant bit as the first bit after sending an ERROR FLAG the RECEIVE ERROR COUNT will be increased by 8.
- When a Transmitter sends an ERROR FLAG the TRANSMIT ERROR COUNT is increased by 8.
Exception 1:
If the Transmitter is error passive and detects an ACKNOWLEDGMENT-ERROR because of not detecting a dominant ACK and does not detect a dominant bit while sending its PASSIVE ERROR FLAG.
Exception 2:
If the Transmitter sends an ERROR FLAG because a STUFF-ERROR occurred during ARBITRATION, and should have been recessive, and has been sent as recessive but monitored as dominant.
In exceptions 1 and 2 the TRANSMIT ERROR COUNT is not changed. - If an Transmitter detects a BIT-ERROR while sending an ACTIVE ERROR FLAG or an OVERLOAD FLAG the TRANSMIT ERROR COUNT is increased by 8.
- If an RECEIVER detects a BIT-ERROR while sending an ACTIVE ERROR FLAG or an OVERLOAD FLAG the RECEIVE ERROR COUNT is increased by 8.
- 6.Any node tolerates up to 7 consecutive dominant bits after sending an ACTIVE ERROR FLAG, PASSIVE ERROR FLAG or OVERLOAD FLAG. After detecting the 14th consecutive dominant bit (in case of an ACTIVE ERROR FLAG or an OVERLOAD FLAG) or after detecting the 8th consecutive dominant bit following a PASSIVE ERROR FLAG, and after each sequence of additional eight consecutive dominant bits every Transmitter increases its TRANSMIT ERROR COUNT by 8 and every RECEIVER increases its RECEIVE ERROR COUNT by 8.
- After the successful transmission of a message (getting ACK and no error until END
OF FRAME is finished) the TRANSMIT ERROR COUNT is decreased by 1 unless it was
already 0. - After the successful reception of a message (reception without error up to the ACK
SLOT and the successful sending of the ACK bit), the RECEIVE ERROR COUNT is
decreased by 1, if it was between 1 and 127. If the RECEIVE ERROR COUNT was 0, it
stays 0, and if it was greater than 127, then it will be set to a value between 119 and - A node is error passive when the TRANSMIT ERROR COUNT equals or exceeds 128, or when the RECEIVE ERROR COUNT equals or exceeds 128. An error condition letting a node become error passive causes the node to send an ACTIVE ERROR FLAG.
10.A node is bus_off when the TRANSMIT ERROR COUNT is greater than or equal to 256.
11.An error passive node becomes error active again when both the TRANSMIT ERROR COUNT and the RECEIVE ERROR COUNT are less than or equal to 127.
12.An node which is bus_off is permitted to become error active (no longer bus_off) with its error counters both set to 0 after 128 occurrence of 11 consecutive recessive bits have been monitored on the bus.
Note: An error count value greater than about 96 indicates a heavily disturbed bus. It may be of advantage to provide means to test for this condition.
Note: Start-up / Wake-up: If during start-up only 1 node is online, and if this node transmits some message, it will get no ACKNOWLEDGE, detect an error and repeat the message. It can become error passive but not bus_off due to this reason.
Related Article on Qiita
CAN FD and CAN XL on arXiv
https://qiita.com/kaizen_nagoya/items/d8efb0da53cd3456f735
CAN FD & CAN XL on arXiv references
https://qiita.com/kaizen_nagoya/items/7df86c66084372a96f1d
CAN FD & CAN XL on arXiv references name order
https://qiita.com/kaizen_nagoya/items/ec5e4e4491228db534c0
CAN FD & CAN XL on arXiv references name order and related link
https://qiita.com/kaizen_nagoya/items/e6c75c799db62d078bd0
Comparison of Classical CAN, CAN FD, and CAN XL and CAN XL
https://qiita.com/kaizen_nagoya/items/773835b2bf3cddd17dd8
Comparison of CAN XL & 10BASE-T1S Functionality on Layer 1 and Layer 2
https://qiita.com/kaizen_nagoya/items/13235743ba8d7193a53b