This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to cancel a CAN bus-off state?

Other Parts Discussed in Thread: TMS320F28335, TMS320F2808

Sometimes the CAN stops to transmit data after a lot of error frames. I suspect the CAN enters a bus-off state. How can I cancel the bus-off state by software? 

Maybe a solution would be to software reset the DSP through a watch dog timeout??

 

Im using an TMS320F28335 / TMS320F2808 (same problem).

 

  • The bus off state can be cleared if the ABO bit is set. With this bit the module goes back automatically into bus-on state after 128*11 recessive bits have been monitored. You can view this information on page 46 of SPRU074E:

     

    http://focus.ti.com/lit/ug/spru074e/spru074e.pdf

     

    Regards,

     

    Tim Love

     

     

  • Must I enable a receive mailbox for this? I don’t have another CAN-device on the bus that can generate any messages. So how should I generate these massages that should get my DSP to leave buss-off state?

     

  • You do not need a receive mailbox. Please see page 54 of the eCAN Reference Guide: 

    After reaching or exceeding the error passive limit (128), the receive error counter will not be increased anymore. When a message was received correctly, the counter is set again to a value between 119 and 127 (compare with CAN specification). After reaching the bus-off state, the transmit error counter is undefined while the receive error counter changes its function.

     

    After reaching the bus-off state, the receive error counter is cleared. It is then incremented after every 11 consecutive recessive bits on the bus. These 11 bits correspond to the gap between two frames on the bus. If the counter reaches 128, the module automatically changes back to the bus-on status if this feature is enabled (Auto Bus On bit (ABO) (MC.7) set). All internal flags are reset and the error counters are cleared. After leaving initialization mode, the error counters are cleared.

     

    You can download this document at the following link:

     

    http://focus.ti.com/lit/ug/spru074e/spru074e.pdf

     

    Regards,

     Tim Love

     

  • Hi, I want to leave bus-off state manually,that is when (Auto Bus On bit(ABO=0)(MC.7)). How can I do it. According to the guide, when set CCR=0(MC.12), the CAN moduel can leave bus-off state. But it does not work. 

  • I kind of have the same question, can anyone answer this?

    Specifically, if you enter a Bus-Off state, how can you manually enter Bus-On state? what software steps are required to do this? I do not want the micro to automatically recover. I want to detect this state in software, record the occurrence, and only then exit Bus-Off state.

    The manual was no help in this regard. I tried to just set CAN_MC.CCR=0, but this didn't work.
  • Please ensure EALLOW is active, since the CCR bit is EALLOW protected. When the node goes BO, the CCR bit would be set. You can come out of BO state by writing a 1 to this bit.