Part Number: TM4C129ENCPDT
Hi, I am new to CAN bus and trying to use it in our product.
I am able to use the sample code in Tivaware to set up two units and make them communicate using CAN bus, but I am not sure how to handle the error situation. There is no sample code for this.
For example, if unit A transmits a CAN message periodically to unit B, everything is find when B is online and waiting. If I remove unit B, unit A's CAN module immediately goes into a auto re-transmission state. Even if I stop the program in debug mode, the module still tries to re-transmit the message all the time.
Such scenario (a node on the CAN bus may not exist or go off-line ) should be common in our design, this leaves me a question - how to handle such scenario properly?
One thing I can think of is to turn off the auto-re transmission feature. But this will sacrifice the communication reliability.
The other way is to immediately abort the message transmission, and inhibit such message in the future. This requires the firmware to check the CAN peripheral to find out which message is currently stuck, but it seems there is no quick way of doing this.
Maybe I have missed something, and there is a common approach of handling such issue that I am not aware of?
Thanks,
Tianlei
