Hardware manual

RX600 Series CAN Application Programming Interface
R01AN0339EU0203 Rev. 2.03 Page 22 of 29
Mar 23, 2013
Figure 4. CAN Error States.
Error Active
When a node is in Error Active state it communicates with the bus normally. If the unit detects an error, it
transmits an active Error flag. Once it counts 127 errors, it switches to the Error Passive state.
Error Passive
When either error counter exceeds 128, the CAN status for that node changes to state Error passive, and
messages can still can be transmitted and received, but the node will not send Error frames. Error frames are
invisible to the user and are taken care of by the peripheral silicon.
Bus Off
If the transmit error counter exceeds 255, the CAN node enters the Bus Off state. This prevents a faulty node
from causing a bus failure. When serious problems cause a CAN node to enter the Bus Off state, no messages
can be transmitted or received by that node until it detects 11 consecutive ‘recessive’ bits 128 times, or until
the peripheral is reset. When the application detects a recovery from Bus Off, the user should reinitialize all
registers of the CAN module, and restart the application.
Using CAN Polling
Call the API regularly to check the CAN state for the application, so it does not try to communicate if the node is
Bus Off. In the following, it is assumed that HandleCanBusState is called once every loop of the main
application.
TEC > 255
11 consecutive
recessive bits
detected 128 times
TEC or REC > 127
TEC or REC < 128
Error Active
Normal
Error Passive
No Errors sent
Bus Off
No comm-
unication