Canbus freezes - how to ignore error frames?

829 Views Asked by At

I am trying to communicate with a vehicle control unit (VCU) over can. I have figured out the commands (index, data and frequency) and can verify the functionality through PCanView on Windows. Now I am using Nvidia Xavier system with python-can library to send the same commands, and I can verify the commands with candump. However when I power the vehicle engine on while sending these commands, the canbus freezes (this is when the VCU starts expecting the can commands I am sending, it goes into fault state if it doesn't receive the data it expects)

I have successfully used python-can in the past to talk to other can devices and I am confident about the correctness of the code itself. Hardware connection is fine too, because I can receive non-VCU messages from the vehicle. I can also receive VCU messages after I restart the canbus.

What could be causing the bus to freeze? And is there a way to prevent it? (By setting some config in the socket-can layer itself?)

Please note that restarting the bus will not fix the problem as the vehicle cannot recover once it goes into fault without a restart.

Any help will be appreciated!

2

There are 2 best solutions below

0
Gaurav Gupta On

Ok, it turns out it was a hardware problem. The length of CAN cables was a bit too much. The bus receives a lot of data transmission when the vehicle is turned on and the CAN cable was flooded with data. I still don't know the mechanics of the fault but decreasing the cable length made it all work.

0
niavlys On

The cable length could be the reason, but take care about the bus topology and especially where the CAN terminations are located.