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.

TMS570LS1224: CAN error interrupt behavior

Part Number: TMS570LS1224

Hi,

we found a (maybe) strange behavior with CAN error interrupt.

When we send error frames at 10 ms period, the interrupt fires only 4 times in 30 seconds.

When we short circuit CAN-H and CAN-L or one of these and ground, the interrupt fires more than 150 times in the same time interval (from 153 to 175 times during different tests).

Can someone help us to understand the reason for this different behavior?

Thank you

  • Hello Marco,

    Each CAN frame generates only 1 CRC error, 1 ACK error, but it may generate more than 1 bit errors (bit 0 and bit 1) and stuff errors. When you short CAN_H and CAN_L, the CAN bus will be at the same level. A sequence of more than 5 consecutive bits of the same polarity between the SOF bit and (including) the CRC Field is considered an error condition, and generates a stuff error. Shorting CAN_H and CAN_L will keep generating stuff error.

    The error frame which consists of 6 bit error flag and 8 bit delimiter can be posted by any nodes who detects the error. The error frame is recognized as an error condition by all other nodes in the next CAN network. In turn they, too, will send an error frame to the CAN bus. 

  • Thanks for explaining, but we don't understand the tms570 behavior.

    When we send 1 error frame every 10 ms, in 30 s we have 3000 error frames, the bus status remains in "warning" state, but the can error handler is fired every 15 second, more or less.. 

    When in bus off, it is fired cyclically whit bus status normal, warning, bus off, a little wait (the auto bus-on delay?), then again normal, warning, bus off  ...

    Is this behavior expected? 

    Thanks and regards

    Marco

  • Hi Marco,

    What is the error: ACK error, Stuff error, ..CRC error? If the error is ACK error only, the CAN bus will not get to CAN BUS off. 

    Each CAN node has two error counters: the Transmit Error Counter and the Receive Error Counter. There are several rules governing how these counters are incremented and/or decremented. A transmitter detecting a fault increments its Transmit Error Counter faster than the listening nodes will increment their receive Error Counter. When any one of the two Error Counters raises above 127, the node will enter Error Passive state. When the Transmit Error Counter raises above 255, the node will enter the Bus Off state. When any one of the two Error Counters raises above 96, the node gets into error warning state.

    The DCAN provides an automatic Auto-Bus-On feature that is enabled by bit ABO in CAN Control Register. If set, the DCAN will automatically start the Bus-Off-Recovery sequence. The sequence can be delayed by a user-defined number of VCLK cycles that can be defined in Auto-Bus-On Time Register.

    Yes, the behavior is expected.