TLDR: candump can0 gets stuck despite ifconfig showing can0 is connected. Same thing shows realtime can0 data if I use a laptop with same OS (Ubuntu 22.04) when using PCAN USB.
I followed the instructions for debugging and I am able to get the same exact results when I do a loopback. However, I am still not able to receive real-time data if not using loopback.
mona@ubuntu:~$ sudo ip link set can0 down
mona@ubuntu:~$ sudo ip link set can0 type can bitrate 500000
mona@ubuntu:~$ sudo ip link set can0 up
mona@ubuntu:~$ candump can0
^Cmona@ubuntu:~$
sys info:
mona@ubuntu:~$ cat /etc/nv_tegra_release
# R36 (release), REVISION: 3.0, GCID: 36923193, BOARD: generic, EABI: aarch64, DATE: Fri Jul 19 23:24:25 UTC 2024
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
mona@ubuntu:~$ uname -a
Linux ubuntu 5.15.136-tegra #1 SMP PREEMPT Mon May 6 09:56:39 PDT 2024 aarch64 aarch64 aarch64 GNU/Linux
mona@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
mona@ubuntu:~$ sudo ip link set can0 down
mona@ubuntu:~$ sudo ip link set can0 type can bitrate 500000 loopback on
mona@ubuntu:~$ sudo ip link set can0 up
mona@ubuntu:~$ candump can0 &
[1] 10426
mona@ubuntu:~$ cansend can0 123#abcdabcd
mona@ubuntu:~$ can0 123 [4] AB CD AB CD
can0 123 [4] AB CD AB CD
^C
As for stuck, when I use candump can0 on the laptop I see real-time data from our can simulator HW that is connected via PCAN-USB to laptop but for the NVIDIA Jetson AGX ORIN 64G devkit, same command doesn’t show anything and the cursor keeps blinking.
For the other questions, how can I provide that information for you?
For AGX Orin, can0 is the internal mttcan by default.
If you connect PCAN-USB adapter on AGX Orin devkit, it may be can1 so that please run candump can1 on AGX Orin devkit.
Please also share the full dmesg for further check.
mona@ubuntu:~$ sudo ip link set can1 down
mona@ubuntu:~$ sudo ip link set can1 type can bitrate 500000
mona@ubuntu:~$ sudo ip link set can1 up
mona@ubuntu:~$ candump can1
^^ entering the last command in Jetson AGX Orin gets stuck with a blinking cursor. If I use the dmesg after it being stuck, I see this:
mona@ubuntu:~$ sudo dmesg | grep -i can
[sudo] password for mona:
[ 11.047496] drm drm: [drm] Cannot find any crtc or sizes
[ 11.613840] CAN device driver interface
[ 11.643441] TT CAN feature is not supported
[ 11.665356] net can0: mttcan device registered (regs=00000000efbd2394, irq=212)
[ 11.678048] TT CAN feature is not supported
[ 11.712623] net can1: mttcan device registered (regs=00000000c3569254, irq=213)
[ 13.522492] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[ 516.357263] mttcan c310000.mttcan can0: Bitrate set
[ 522.932154] mttcan c320000.mttcan can1: bit-timing not yet defined
[ 522.932167] mttcan c320000.mttcan can1: failed to open can device
[ 551.219318] mttcan c320000.mttcan can1: Bitrate set
[ 559.148868] mttcan_controller_config: ctrlmode 0
[ 559.148892] mttcan c320000.mttcan can1: Bitrate set
[ 559.148984] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[ 563.775024] can: controller area network core
[ 563.775124] NET: Registered PF_CAN protocol family
[ 563.781966] can: raw protocol
[ 586.275336] mttcan c320000.mttcan can1: Bitrate set
[ 590.091980] mttcan_controller_config: ctrlmode 0
[ 590.092006] mttcan c320000.mttcan can1: Bitrate set
mona@ubuntu:~$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can
I don’t have your setup and the modules to verify them locally so that I can not give the exact steps to fix the issue.
There seem 2 internal mttcan available on AGX Orin (can0 and can1).
Please also try if can2 is used for your PCAN-USB.
And also share the full dmesg for us to check the exact CAN interface for your PCAN-USB.
As my understanding, you have to confirm the bitrate is the same for both TX/RX sides.
(TX: Simulator, RX: PCAN-USB adapter)
In your case, Jetson AGX Orin is just acting as USB host and your PCAN-USB adapter is a USB device.
Hi Kevin, you are correct that for this Jetson can2 was the one for pcan-usb
Our problem was not using the third command below. After using it, we were able to retrieve data from can2.
cd peak-linux-driver-8.18.0
make clean
make NET=NETDEV_SUPPORT
sudo make install
Could you please confirm that for ORIN NX 16G devkit, you only have one can? Since I am having the can0 from Jetson and can1 is showing live data from my emulator. Thanks for any guidance.
Is there any reason that ORIN NX 16g only has can0 and AGX ORIN 64G has can0 and can1? I am asking to educate myself.
Correct! AGX Orin has 2 internal CAN and Orin NX has 1 internal CAN.
You can also check the dmesg for the CAN number. It might also relate to the order of driver probing.
AGX Orin and Orin NX are both from Orin series(T234) with different capability.
Apparently, AGX Orin is more powerful than Orin NX so that it has more interfaces/ports by default.
It should be fine for both ERROR-ACTIVE and ERROR-WARNING state.