CAN Message from Jetson Orin Nano not detected

Hello,
I’m trying to implement connection to CAN Bus on Jetson Orin Nano Dev Kit. My Jet Pack version is 6.2. The CAN Transceiver I use for the Jetson is SN65HVD230, following instructions on this guide:

To initiate CAN controller, I used these following commands:

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo busybox devmem 0x0c303018 w 0xc458
sudo busybox devmem 0x0c303010 w 0xc400
sudo ip link set can0 type can bitrate 500000
sudo ip link set can0 up

Then to test the CAN message transmission I used:

cansend can0 123#aaaaaaaa

To connect the Jetson to Transceiver, i followed the guide:
CAN_RX pin on Jetson to RX pin on SN65
CAN_TX pin on Jetson to TX pin on SN65
3.3V and GND on Jetson to the Transceiver for power supply.

The connection for everything is in the below image.

I use CAN Explorer on MATLAB to retrieve CAN Messages from the bus. Both the CAN Explorer and Arduino is set to bit rate 500 kbps, similar to what i initiated for Jetson.
To test, I used 2 Arduino to generate messages with different IDs. All the messages generated by the Arduino boards can be detected on CAN Explorer. However the message with ID 123 that I generated on the Jetson is not detected.
I did make sure to connect everything and retrieve messages from Arduino before connecting the Jetson to the bus and initiate the CAN controller.

Is there anything that I did wrong here? Hopefully someone can help me with this. And please let me know if I should provide any further info about my system.
Thank you so much

Hi minh.ht2803,

Could you try adding sjw 4 in this command to check if it could help?

$ sudo ip link set can0 type can bitrate 500000 sjw 4

Hello, KevinFFF,
I have added sjw 4 to the command. Unfortunately, CAN Explorer still does not detect any CAN messages from the Jetson.
Is there any command to check if the Kernel drivers i loaded with the modprobe commands actually work? I can only think of errors from either the modprobe or busybox sections.

For some further informations, I ran these commands:

$ cat /proc/device-tree/mttcan\@c310000/status

returns: cat: /proc/device-tree/mttcan\@c310000/status: No such file or directory

Then i tried:

$ cat /proc/device-tree/bus@0/mttcan@c310000/status

this returns okay.

I also wrote

$ sudo dmesg -d | grep "can"

which results in:

[ 10.626695 < 0.010523>] driver not enabled, cannot register any devices
[ 10.634563 < 0.001763>] driver not enabled, cannot register any devices
[ 10.635795 < 0.001232>] driver not enabled, cannot register any devices
[ 10.642619 < 0.006824>] driver not enabled, cannot register any devices
[ 11.287380 < 0.000395>] net can0: mttcan device registered (regs=00000000ac390f98, irq=201)
[ 11.549843 < 0.000002>] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[ 963.837244 < 928.844556>] can: controller area network core
[ 969.184880 < 5.347523>] can: raw protocol
[ 1012.937101 < 43.752221>] mttcan c310000.mttcan can0: Bitrate set
[ 1019.581659 < 6.644558>] mttcan_controller_config: ctrlmode 0
[ 1019.581682 < 0.000023>] mttcan c310000.mttcan can0: Bitrate set
[ 1019.582078 < 0.000396>] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 1055.021138 < 35.439060>] mttcan c310000.mttcan can0: entered error warning state
[ 1055.021812 < 0.000674>] mttcan c310000.mttcan can0: entered error passive state
[ 1604.896853 < 549.875041>] mttcan c310000.mttcan can0: entered bus off state

Can you also try sjw 1 instead?

Please check if there’s any error when you run modprobe to load the driver.

It is expected since the node in JP6.x is different from JP5.x.

I would like to know the reason why it enters into bus off state.
I had tried to reproduce similar bus-off state through shorting CAN-H/CAN-L during CAN transaction.

Could you simplify your setup with just connecting CAN from Orin Nano with PCAN from host PC as following? (i.e. remove two MCP2515)

Hi KevinFFF,

When I ran the commands in the Original post, the terminal did not give any error messages.

Do you know what should I do to look into that? I am very new to working with Jetson so there are a lot of things i don’t know.

To test if I did load the drivers correctly I tried enabling CAN controller in loopback mode, replacing:

sudo ip link set can0 type can bitrate 500000

with

sudo ip link set can0 type can bitrate 500000 loopback on

After that, i used:

candump can0 &
cansend can0 123#abcdabcd

and terminal returned exactly the same as in the guide, so I believe the driver loading process is correct. Afterwards, I used

sudo dmesg -d | grep "can"

and this time, it doesn’t enter bus off state.
Here is the full message:

[ 9.698773 < 0.005037>] driver not enabled, cannot register any devices
[ 9.717720 < 0.006081>] driver not enabled, cannot register any devices
[ 9.727286 < 0.008651>] driver not enabled, cannot register any devices
[ 9.730330 < 0.003044>] driver not enabled, cannot register any devices
[ 10.334575 < 0.004051>] net can0: mttcan device registered (regs=00000000a0925445, irq=201)
[ 10.421463 < 0.000003>] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[ 75.630598 < 41.819649>] can: controller area network core
[ 75.651949 < 0.021256>] can: raw protocol
[ 75.719901 < 0.067952>] mttcan c310000.mttcan can0: Bitrate set
[ 75.736309 < 0.016408>] mttcan_controller_config: ctrlmode 1
[ 75.736340 < 0.000031>] mttcan c310000.mttcan can0: Bitrate set
[ 75.736566 < 0.000226>] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

I used 2 MCP2515 here to try and send messages from 2 Arduino board, and to use the terminating resistors on them, as I didn’t have any spare resistors. I will try simplifying my setup like you told and come back to you later.

When did you hit bus-off issue? when you transmit CAN data from MCP2515?

I think there may be the similar terminating resistors in SN65HVD230 CAN transceiver or in PCAN FD adapter.
Please help to clarify the cause of bus-off issue.(i.e. which operation and connection would cause this error)

Hello Kevin,

after following your advice to simplify my setup, I could finally receive and read CAN message on my PC using the PCAN FD Adapter. One possible fault in my original setup could be that all 3 modules (2 MCP2515 and 1 SN65HVD230) had a 120 Ohm resistor, this might have caused the Jetson to go into error states. After this I simplified my setup and double checked that only 2 terminating resistors were in my CAN Bus setup.
Thank you so much for helping and suggesting me this. I also have a question, in your 1st reply in this thread, you suggested adding sjw 4 in the command to setup can0:

sudo ip link set can0 type can bitrate 500000 sjw 4

I want to know what is the purpose of that?

Once again, thank you so much for helping me with this problem.

Thanks for sharing your status here, it could help with other having similar setup.

sjw is Synchronization Jump Width. It defines the maximum amount of time a CAN node can adjust its own internal clock during communication. This adjustment is crucial for staying in sync with other nodes on the network, especially when their clocks have small timing differences. A larger sjw value makes the network more robust and tolerant of errors, ensuring stable communication.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.