Canbus interface is not working

Hi,
I want to test Xavier’s canbus interface. However, there is a problem. I perform the steps below.

sudo busybox devmem 0x0c303000 32 0x0000C400
sudo busybox devmem 0x0c303008 32 0x0000C458
sudo busybox devmem 0x0c303010 32 0x0000C400
sudo busybox devmem 0x0c303018 32 0x0000C458

sudo modprobe can
sudo modprobe can-raw
sudo modprobe can-dev
sudo modprobe mttcan

sudo ip link set can0 type can bitrate 1000000
sudo ip link set can1 type can bitrate 1000000

sudo ip link set up can0
sudo ip link set up can1

After these processes, when I go the testing phase, I open two terminals and short circuit can0_rx and can0_tx.

First terminal - candump can0
Second terminal - cansend can0 123 # abcdabcd

However, I can’t see anything in first terminal. Where am I doing wrong?
Also, I do the same between can0 and can1 (short circuit can0_rx-can1_tx and can0_tx and can1_rx) but the result is the same. Can you help me?
How else can I test the Canbus interface without loopback?

Hello eeren_edm
you have to enable the loop back option so you can test the loop back by the following commend :
sudo ip link set can0 type can bitrate 1000000 loopback on
sudo ip link set can1 type can bitrate 1000000 loopback on

Hi essamamr,

Thank you for your suggestion. I know this command and I can test with this command. But I want to test canbus without using the loopback command. Because I don’t think this is adequate test. When I do “cansend can0” and “candump can1” without loopback, I can’t see anything from the oscillator.
Actually, I want to communicate with another device over canbus. What can be done about it? Do you have a suggestion?

Also, loopback command only works for can0 (rx/tx) or can1 (rx/tx). Connecting can0_rx-can1_tx and can0_tx-can1_rx does not work.
I want to test when I connect both can0 and can1 (can0_rx-can1_tx and can0_tx-can1_rx), and I want to test can0 or can1 with another device.

Hi eeren,
You need to connect external transceiver to CAN0 or CAN1.
Also see this doc for connection details:
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_can.html#wwpID0ELHA

Thanks,
Shubhi