Jetson orin nx :can “candump can0” Messages cannot be received, but “cansend” can be sent

(1)My configuration:

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up

(2)“cansend can0 123#abcdabcd” Instructions can send information

(3)but “candump can0” Messages cannot be received.

Hi 1428943841,

Which carrier board are you using for Orin NX?
What’s your Jetpack version in use?

Have you configured the pinmux for can0 and check the pinmux register is correct for CAN usage?

(1)carrier board is jetson orin Nx CLB (一个国产载板)

(2)jetpack version is (5.10.104-tegra #1 SMP PREEMPT Sun Mar 19 07:55:28 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux)

(3)After I complete the configuration, the above command cansend information through “cansend can0”.



As shown in the following figure, “candump can0” cannot receive information

I don’t think pimux is involved here, and ,I tried typing the following command into Jetson-Xavier-NX. It can be used

sudo busybox devmem 0x0c303020 32 0x0000C458
sudo busybox devmem 0x0c303018 32 0x0000C400
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up

but jeston-orin-nx ,The system will freeze

I can send a message, I just can’t get it

Are you using J17 Optional CAN Bus Header?

That one is kernel version.
Please share the result of the following command.

$ cat /etc/nv_tegra_release

What do you mean about freeze? Is there any logs output?
Which command causes it freeze?

What’s your connections or you are just verifying with loopback test?

(1) yes,using j17 optional,(5V/can_rx/can_tx/GND)

Conversion module:TJA1050T

can to usb module:can analyzer( usb to PC )

(2)following command:

(3)I found that if I typed the following command, after a while, I couldn’t control orin nx, couldn’t type commands, either keyboard or mouse.

sudo busybox devmem 0x0c303020 32 0x0000C458
sudo busybox devmem 0x0c303018 32 0x0000C400
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up

(4)This is the latest

  1. If I enter the following command, then I can receive the CAN command from the PC, but I cannot send it.

    PC situation:

2.If I enter the following command, the PC can receive it, but the orin nx cannot receive the message.


PC situation:

so,What seems to be the configuration problem, or lack thereof.

It should be 3.3V for CAN rather than 5V.
Could you use 3.3V for CAN instead?

Do you have other CAN transceiver like SN65HVD230?

Could you just run candump in background?

$ candump can0 &

Does the freeze happen after sudo ip link set can0 up?
and the freeze means you could not use keyboard/mouse, but you still can run the command through serial console?

(1)5V:This module requires 5V, I tried the 3.3V connection module of the J17, but the module did not work.

(2)SN65HVD230:I have bought this module, it is in the mail, it will take a few days to get it.

(3)$ candump can0 &:I tried the following, but didn’t know what was right.

(4)With debugging, only the desktop died or freeze. dubeg (uart2) can be used and input instructions.

And it has nothing to do with the instruction “sudo ip link set can0 up”, after I input the following alone, wait for a period of time (about 20s), the desktop will freeze. The mouse can be moved, but no commands can be entered.

The following is the error reported after entering the above two lines in the debug port.

Looking forward to your answer

(1)I was wondering,,if I just typed in the wrong instructions, can you give me a set of instructions that can use “can” in the jetson orin nx, and I’ll try it.
(2)These seem to be the only instructions available online and in documents. The main ones are as follows.

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up

It seems you write to the wrong register for Orin NX.
Please refer to the following tablle


and run the following commands instead to configure the pinmux for can0

$ sudo busybox devmem 0x0c303018 w 0xc458
$ sudo busybox devmem 0x0c303010 w 0xc400

(1)As it turns out, it still doesn’t work

(2)Changing instructions still doesn’t work


You should run candump before cansend command as following:

$ candump can0 &
$ cansend can0 123#abcdabcd

(1)The situation is the same as before and has not changed。

However, the “loopback” module is different, as shown in the following figure.

What do you mean about “loopback module”?

It seems you could receive the data (AB CD AB CD) you sent in loopback test.

(1)I mean the structure is different because the instructions are different. The following two instructions

sudo ip link set can0 type can bitrate 500000 loopback on
or
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on

(2)" It seems you could receive the data (AB CD AB CD ) you sent in loopback test."。

However, I cannot receive external data. In the “loopback” mode, “candump can0” still cannot receive information, I can only receive my own message.

This is used to turn on the internal loopback, and you don’t need to connect any cable and it should work.

For this one, you would need 2 CAN transceivers in your setup to transmit/receive data.

Could you share the block diagram of your connection?

(1)Yes, the “loopback” is self-retractable

(2)So how should I configure, didn’t you say two instructions earlier

(3)Before sharing hardware photos is, for you to understand, I drew a picture, you take a look.

The following is the hardware connection block diagram

In your case, you seems using TJA1050T as CAN transceiver and USB-CAN analyzer connecting to your host.

Could you receive any data on your host (send from the board)?
Or receive any data on your board (send from the host)?

(1)yes,I’ve always had real experiments

(2)yes,The PC can receive data, but the PC sends data and orin cannot receive it
In the following cases.

(3),roin can receive the message, but can not send the message, or sent, the PC can not receive.
In the following cases.

(4)The module you mentioned before will arrive today, and I will try it then.