21 Two-wire Automotive Interface (TWAI)
r0 fields must be Dominant.
Acknowledgement Error
An Acknowledgment Error occurs when a Transmitter does not detect a Dominant bit at the ACK Slot.
21.3.3.2 Error States
TWAI nodes implement fault confinement by each maintaining two error counters, where the counter values
determine the error state. The two error counters are known as the Transmit Error Counter (TEC) and Receive
Error Counter (REC). TWAI has the following error states.
Error Active
An Error Active node is able to participate in bus communication and transmit an Active Error Flag when it detects
an error.
Error Passive
An Error Passive node is able to participate in bus communication, but can only transmit an Passive Error Flag
when it detects an error. Error Passive nodes that have transmitted a Data or Remote Frame must also include
the Suspend Transmission field in the subsequent Interframe Space.
Bus Off
A Bus Off node is not permitted to influence the bus in any way (i.e., is not allowed to transmit anything).
21.3.3.3 Error Counters
The TEC and REC are incremented/decremented according to the following rules. Note that more than one
rule can apply for a given message transfer.
1. When a Receiver detects an error, the REC will be increased by 1, except when the detected error was a
Bit Error during the transmission of an Active Error Flag or an Overload Flag.
2. When a Receiver detects a Dominant bit as the first bit after sending an Error Flag, the REC will be increased
by 8.
3. When a Transmitter sends an Error Flag the TEC is increased by 8. However, the following scenarios are
exempt form this rule:
• If a Transmitter is Error Passive that detects an Acknowledgment Error due to not detecting a Dominant
bit in the ACK slot, it should send a Passive Error Flag. If no Dominant bit is detected in that Passive
Error Flag, the TEC should not be increased.
• A Transmitter transmits an Error Flag due to a Stuff Error during Arbitration. If the offending bit should
have been Recessive but was monitored as Dominant, then the TEC should not be increased.
4. If a Transmitter detects a Bit Error whilst sending an Active Error Flag or Overload Flag, the REC is increased
by 8.
5. If a Receiver detects a Bit Error while sending an Active Error Flag or Overload Flag, the REC is increased
by 8.
6. Any node tolerates up to 7 consecutive Dominant bits after sending an Active/Passive Error Flag, or Over-
load Flag. After detecting the 14th consecutive Dominant bit (when sending an Active Error Flag or Over-
load Flag), or the 8th consecutive Dominant bit following a Passive Error Flag, a Transmitter will increase
Espressif Systems
552
Submit Documentation Feedback
ESP32 TRM (Version 5.2)
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?