sudo ip link set can0 type can bitrate 500000
sudo ip link set can1 type can bitrate 500000
sudo ip link set up can0
sudo ip link set up can1
I did loopback testing for can0 and can1, and it worked, but this only allows us to see if the controller is working. I want to test canbus interface by communicating with another device. but I have some questions and problems about it.
I connected the can0_rx line to the can1_tx line and sent the data “cansend can1 123 # abcdabcd” from the can1 bus from the terminal. I saw data from the oscilloscope on the can0_rx line. but when I sent it again, I could not see data on the canbus line. I see it once again when I restart Xavier and do the same things again. but the second time I can’t see data again. I have to restart Xavier every time to see data. so I tried “sudo ip link set can1 type can restart-ms 100” command. but that didn’t work either. So, can I test can0 and can1 line without tranciever in between?
I want to communicate with xavier another device via canbus. For this I connected the lines can1_rx and can1_tx to a tranciever. I connected the can_high and can_low lines at the exit of tranciever to the test computer with Ixxat usb-to-can converter. I tried communicating to between the test computer and xavier with the minimon program. but I am getting a “tranciever pending” error from the program. I also do not see any data when I look from the oscillator. What do you think is the reason for this? Could there be a problem with acknowledge? How can I communicate to between test computer and xavier via canbus interface using tranciever?
Hi eeren,
You cannot connect CAN0 to CAN1 without transceiver. Only CAN0_TX to CAN0_RX is possible.
For communication with other device: can you see if bitrates set are same for both the CAN nodes on the bus. You can check Xavier bitrate from ip -d -s link show can0 if you made can0 up on network.
Also, provide dmesg error logs to us.
Hello @eeren_edm
I can understand your problem, For your first question
try replacing sudo ip link set can0 type can bitrate 500000 with sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on you should see the msg working properly.
I connected both the can0 and can1 lines to the tranciever and it worked. But when I connect it to the test computer, the result is still the same, it doesn’t work. Could there be a problem with acknowledge?
And when I do “sudo ip link set can1 type can bitrate 1000000”, I expect the bitrate to be 1000000. However, when I look at it with the command “ip -d -s link show can1”, I don’t see that it matches exactly. What is the reason of this?
Hi,
So can you see if parent clock is changed to pllaon?
cat /sys/kernel/debug/bpmp/debug/clk/can1/parent
Make CAN1 up on network and then check sysfs node.
Hi eeren,
Excuse me, have you solved the problem? I’ve been trying to use AGX Xavier for development testing recently, and I’ve had the same problem as you.
The inability to accurately set the bitrate of CAN communications directly results in the inability to communicate with external devices.
By the way, I can’t find the “tegra194-a02-bpmp-p2888-a04.dtb” file.
Hi SeanWu,
No, I still could not fix the problem.
I made the changes described in https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/clocks.html#wwpID0E06B0HA, but it didn’t work. The clock (under /sys/kernel/debug/bpmp/debug/clk/can1/parent) seems to be set to “pll-c”. I think we should see something different here. Frankly, I don’t know if I need to make any other changes. I haven’t been able to deal with this problem as I haven’t been to work for a while. If you found a solution, can you share it with me?
I don’t remember exactly what directory tegra194-a02-bpmp-p2888-a04.dtb is in. But I can look at it on Thursday and tell you where it is.
Hi eeren,
Thank you for your reply.
By the way, I’m talking about this problem with others. If I found The way to Solution the problem, I will share it with you as soon as possible.
If you get some ideas . Please share it with me.
Hi SeanWu,
Is the problem solved?
You can find tegra194-a02-bpmp-p2888-a04.dtb in Linux_for_Tegra/bootloader if you have downloaded our jetpack and unpacked it.
Hi shgarg,
I’m glad to hear from you.
Recently, I have been busy with other parts of my work, so I don’t have time to deal with this part of the problem for the time being. When I start to deal with this part of the problem, I will contact you as soon as possible!