简体   繁体   中英

Canbus freezes - how to ignore error frames?

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!

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM