Hello Everyone.
I have a problem with CAN communication between two Jetson AGX Xavier.
I want to perform CAN communication with two Jetson AGX Xavier. I connected SN65HVD230(CAN Transceiver) with each Jetson AGX Xavier. And I connected CANH pin and CANL pin of each SN65HVD230. I will add the picture of Jetson AGX Xavier & SN65HVD230 below.
Loopback test was ok at that time.
I tried to do directly same as NVIDIA manual of CAN.
Controller Area Network (CAN) — Jetson Linux Developer Guide documentation (nvidia.com)
I tried like this.
When I send the data from Jetson AGX Xavier1 by the command ‘cansend can0 123#abcdabcd’, Jetson AGX Xavier2 didn’t receive any data below the command ‘candump can0’. I googled it about this problem, but there’s no any clear solution about this.
I want to solve this problem. Is there anyone who can solve the problem?
I will add the screen of Jetson AGX Xavier1(publicai@publicai-desktop), Jetson AGX Xavier2(idls-idls@desktop)
Thanks for watching my topic.
(This is the way I connected Jetson Xavier and SN65HVD230)
(The picture below Jetson Xavier1 is Jetson Xavier2. I didn’t change it in this picture.)
(This is the screen of Jetson AGX Xavier1 & 2)
Hi 2020130022,
Are you using the devkit or custom board for AGX Xavier?
What’s your Jetpack version in use?
It seems alright with your connection.
Actually, you could also use just one AGX Xavier to transmit data from can0
to can1
.
It seems you want to transmit data from can0
of 1st Xavier to can1
of 2nd Xavier.
Why you use candump
for can0
rather than can1
on the 2nd Xavier?
Thanks for replying.
I’m using Jetson AGX Xavier Developer Kit.
Jetpack version will be the latest one both.
I tried to use can0 and can1 in one AGX Xavier, but I failed. So now I am trying to transmit data from one AGX Xavier to another AGX Xavier.
Then, can you tell me how to transmit data from can0 to can1 by using one AGX Xavier.
The reason I use candump for can0 rather than can1 is that I connected CAN transceiver(SN65HVD230) in can1. If that’s the reason that problem occurs, I will change the connection from can1 to can0.
Is it more efficient to change connection from can1 to can0?
I studied CAN communication, but I didn’t understand all about it. Tell me the way I can do in this situaton. Thanks a lot!
I changed pin connection of AGX Xavier and CAN Transceivers.
Please check the pin connection is right.
I tried CAN communication by this pin connection, but I failed.
Please tell me about how to do it…
Thanks all…
Have you used Jetson-IO to enable both can0
and can1
?
If you use candump for can0, then you need to use cansend for can1 for another AGX Xavier with your original connection…
I think that would be more simple with one AGX Xavier transmitting from can0
to can1
and also using 2 Can Transceivers(SH65HD230).
Please just connect them as the following diagram:
You would need two 3.3V and GND.
Thanks for replying.
I will try like that and let you know.
Let me share the block diagram of my connection and the steps to verify with one AGX Xavier.
Connections
Setup
Steps to verify
1. Configure pinmux for CAN bus through Jetson IO
1-1 Run Jetson-IO
$ sudo /opt/nvidia/jetson-io/jetson-io.py
1-2 Enable can0 and can1
Configure Jetson 40pin Header -> Configure header pins manually -> Enable can0/can1 as following -> Back -> Save pin changes -> Save and reboot to reconfigure pins -> Enter
[*] can0 (29,31)
[*] can1 (33,37)
1-3 Check pinmux register
$ sudo busybox devmem 0x0c303018 //can0_din - 0xC454
$ sudo busybox devmem 0x0c303010 //can0_dout - 0xC400
$ sudo busybox devmem 0x0c303008 //can1_din - 0xC454
$ sudo busybox devmem 0x0c303000 //can1_dout - 0xC400
2. Enable CAN
2-1 Load kernel modules
$ sudo modprobe can
can: controller area network core
$ sudo modprobe can_raw
can: raw protocol
$ sudo modprobe mttcan
net canX: mttcan device registered (regs=00000000b6e0395a, irq=51)
2-2 Setup interface
$ sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
$ sudo ip link set can1 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
2-3 Check can interface
$ ifconfig
can0: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 51
can1: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 52
3. Test
3-1 Run candump for all interface in background
$ candump -x any &
3-2 Run cansend from can0-TX, and you will see it receive the same data from can1-RX
$ cansend can0 123#abcdabcd
can1 RX - - 123 [4] AB CD AB CD
can0 TX - - 123 [4] AB CD AB CD
Thanks for such a good reply.
I will try like this and let you know later.
Thanks a lot again!
Hi KevinFFF,
I tried same as you tell me, but I failed.
I will add text files which shows command line when I tried CAN communication.
See the text file and tell me what’s wrong in CAN communication this time.
Thanks.
FirstTest_0713.txt (9.8 KB)
FirstTest_0713_details.txt (9.8 KB)
Do you follow every steps listed above and run w/o errors?
Could you share the full dmesg
for further check?
[ 450.185120] mttcan c310000.mttcan can0: Acknowledgement Error Detected
[ 450.185229] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x71b
I’ve found another user having the similar issue as yours.
Xavier cansend cannot update data - #6 by darmaji998
Are you using SH65HVD230 for both your CAN transceivers?
Could you use the following command instead to setup can0
and can1
sudo ip link set can0 up can0 bitrate 1000000
sudo ip link set can1 up can1 bitrate 1000000
Hi, KevinFFF.
Thanks for replying.
I will try again and share full demsg for further check.
sudo ip link set can0 up can0 bitrate 1000000
sudo ip link set can1 up can1 bitrate 1000000
I will do it again with those commands and let you know it works.
I send you dmesg command list and terminal screenshot.
dmesg command list_0720.txt (80.5 KB)
See the Text and Screenshot and tell me about the way to solve this problem.
Thanks all.
Are you using SH65HVD230 as my setup for both your CAN transceivers?
Could you share every commands you use and in serial console for your test and also the dmesg
as file here for further check?
Could you refer to above response to verify CAN bus?
and please also share the result of the following commands on your board.
$ sudo busybox devmem 0x0c303018 //can0_din
$ sudo busybox devmem 0x0c303010 //can0_dout
$ sudo busybox devmem 0x0c303008 //can1_din
$ sudo busybox devmem 0x0c303000 //can1_dout
Hi, KevinFFF.
I changed the connecting line and tried again by the way you explained to me at the first time.
When I try now, it goes well now. But I have some questions about this CAN test.
First, when I tried it by the way you had told me before, I checked that the data for RX and TX were printed well under the ‘candump -x any’ command when I sent the data with the command ‘cansend can0 123#12341234’. However, when I change ‘can0’ to ‘can1’ in the cansend command, the error phrase ‘callback suppressed, Acknowledgement Error Detected’ is printed, and the data is no longer printed below the ‘canump-x any’ command. I’m not sure this is normal working. Do you think this kind of movement is normal? I want to know your opinion about this.
Seond question follows the first question. When I change the command from ‘cansend can0’ to ‘can1’, no more data is printed under ‘candump -x any’, so I disabled can0 and can1 through the commands ‘ip link set down can0, ip link set down can1’, and then set up the can0 and tried command again from the CAN interface setting .When I did again, the same phrase that occurred before is printed. I’m wondering if this kind of behavior is normal, and if you know how to solve this problem.
Thrid, when I shutdown the Jetson Xavier and tried again from the beginnig, it didn’t go well. Do you know why this situation happens?
Thanks for your behavior considering my question and trying to solve the problem I’m suffering now. I will wait your responce.
Thank you again!
After the connection setup above, I’ve verified it would work no matter send data from can0
or can1
.
Could you help to try reload the kernel module with the following command?
sudo rmmod mttcan
sudo modprobe mttcan
Do you mean can will not work after reset the board with the exact same procedures? So, it would not work anymore?
Thanks for replying, KevinFFF.
I did the way you said to me,
sudo rmmod mttcan
sudo modprobe mttcan
But, It comes out same as before.
There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks
Could you share the dmesg after you re-load the kernel module?