Orin CAN Bus can`t work

Hi,All.
we use NVIDIA AGX Orin,and add mttcan module, we test CAN by the following steps:

  1. connect CAN transceiver

  2. set CAN bitrate
    sudo ip link set can0 type can bitrate 500000
    sudo ip link set can1 type can bitrate 500000
    sudo ifconfig can0 up
    sudo ifconfig can1 up

  3. Test receive & transmit

  4. Receive.
    candump can0, CAN0 can receive data from CAN OE.
    candump can1. CAN1 can receive data from CAN OE.

  5. Transmit.
    cangen can0 -v -g 200. CAN-OE can`t receive data from Orin.

    cangen can1 -v -g 200. CAN -OE can`t receive data from Orin.

Then we try to print kernel information.
dmesg | grep can1.
[result]
mttcan c320000.mttcan can1: entered error warning state
mttcan c320000.mttcan can1: entered error passive state
mttcan c320000.mttcan can1: entered bus off state
ip -details -statistics link show can1
[result]
9: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
bitrate 500000 sample-point 0.870
tq 20 prop-seg 43 phase-seg1 43 phase-seg2 13 sjw 1
mttcan: tseg1 2…255 tseg2 0…127 sjw 1…127 brp 1…511 brp-inc 1
mttcan: dtseg1 1…31 dtseg2 0…15 dsjw 1…15 dbrp 1…15 dbrp-inc 1
clock 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 1 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
24 3 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0

what`s wrong with the Orin CAN? Any help would be appreciated

@zhiyuan.song

Following are steps to modify CAN pinmux:
1. Download <Jetson AGX Orin Series Pinmux> from Jetson Download Center.
2. Modify then downloaded spreadsheet and generate {Orin-jetson_agx_orin-gpio-defalut.dtsi, Orin-jetson_agx_orin_padvoltage-default.dtsi, Orin-jetson_agx_orin-pinmux.dtsi}. Please refer to  "can-spreadsheet.png".
3. Merge related changes to {bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi, bootloader/tegra234-mb1-bct-gpio-p3701-0000-a04.dtsi}. Please refer to {pinmux-change.png, gpio-change.png}.
4. Re-flash MB1_BCT to apply changes.

Hi alanz. CAN Bus is still not working!
The steps are as follows:

  1. Modify Orin_Jetson_Series_Pinmux_Config_Template.xlsm and generate .dtsi file.
  2. Modify file <bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi> about CAN Infomation. The main fields to be modified are ”nvidia,function = can x“。
  3. use sdkmanager to flash。

I think the appeal steps are consistent with the following operations。
sudo busybox devmem 0x0c303010 32 0x0000C400
sudo busybox devmem 0x0c303018 32 0x0000C458

The final result is the same as before!

Have you checked below L4T doc? It should work for Orin.

Controller Area Network (CAN) — Jetson Linux
Developer Guide 34.1 documentation (nvidia.com)

hello, kayccc. I think my actions are consistent with the L4T doc.
[Kernel DTB]
$ cat /proc/device-tree/mttcan@c310000/status
output: okay
$ cat /proc/device-tree/mttcan@c320000/status
output: okay

[Pinmux]
sudo busybox devmem 0x0c303000 w 0x400
sudo busybox devmem 0x0c303008 w 0x458
sudo busybox devmem 0x0c303010 w 0x400
sudo busybox devmem 0x0c303018 w 0x458

[Kernel Drivers]
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan

[Managing the Network]
sudo ifconfig can0 down
sudo ip link set can0 type can bitrate 500000
sudo ifconfig can0 up

sudo ifconfig can1 down
sudo ip link set can1 type can bitrate 500000
sudo ifconfig can1 up

[Test]
input: candump can0. CAN0 can receive data from CAN OE.
Input: cansend can0 123#abcd. CAN-OE can`t receive data from Orin.
input: ip -statistics -details link show can0
9: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
bitrate 500000 sample-point 0.870
tq 20 prop-seg 43 phase-seg1 43 phase-seg2 13 sjw 1
mttcan: tseg1 2…255 tseg2 0…127 sjw 1…127 brp 1…511 brp-inc 1
mttcan: dtseg1 1…31 dtseg2 0…15 dsjw 1…15 dbrp 1…15 dbrp-inc 1
clock 50000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 1 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
172097 23110 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0

CAN OE Rx Error.
describe:ECC: 100000101xxxxx,Stuff Error, Bit Position = 6

Dear Kay,

Could you help to analysis the updated info from zhiyuan.song , and give some suggestion for us?

In version 5.0.2GA . I tried it out by following the documentation. But the effect is the same

@zhiyuan.song

Could you have a test with the loop mode? Let’s see if that works or not.

loop mode is ok

$ ip link set can0 type can bitrate 500000 loopback on
$ ip link set can0 up
$ candump can0 &
$ cansend can0 123#abcdabcd

can0 123 [4] AB CD AB CD
can0 123 [4] AB CD AB CD

I would suggest to test with the another adapter to compare the difference. Or you can monitor the signals to see if there are something weird.

We have two orin developer kits. and three SN65HVD230 CAN transceivers。Multiple tests were done with each of them,the final result is the same as before.
If your test is OK,can you tell me your specific process and transceiver model number?
thanks!

CAN module can send data!!!The transceiver is broken!When I use [WaveShare SN65HVD230 CAN board] transceiver, it works fine!

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