CAN bus does not work on the Xavier NX dev kit with Jetpack 5.02

Hi

  1. I would like to make CAN bus work the Xavier NX dev kit. I use the Jetpack 5.02 default from NVIDIA and I have tried to follow instructions:
    Enabling CAN on Nvidia Jetson Xavier Developer Kit | by Ramin Nabati | Medium

  2. I saw the can0 interface is up:
    ====================================================
    ip -s -d link show can0
    9: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can promiscuity 0 minmtu 0 maxmtu 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
    bitrate 1000000 sample-point 0.735
    tq 29 prop-seg 12 phase-seg1 12 phase-seg2 9 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 34000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes packets errors dropped overrun mcast
    0 0 0 0 0 0
    TX: bytes packets errors dropped carrier collsns
    0 0 0 0 0 0
    ===================================================

  3. But when trying to test the can bus can0, it shows nothing:
    ===========================================================
    candump can0 &
    [1] 2784
    root@ubuntu:/home/lts# cansend can0 5A1#1122334455667788
    root@ubuntu:/home/lts# ip -s -d 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 1000000 sample-point 0.735
    tq 29 prop-seg 12 phase-seg1 12 phase-seg2 9 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 34000000
    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
    ===============================================

  4. I have tried to use CAN tester to send to Xavier NX CAN, but it does not receive.

  5. I have tested CAN loop back mode (internal loopback), and it works perfectly.

I wonder if the CAN bus could work on the XAVIER NX dev kit with Jetpack 5.02? if yes, why my Xavier NX CAN bus does not work?

Thanks a lot in advance.

Hi @son.le

I haven’t used the CAN bus on the Xavier NX with JetPack 5.0.2, but in the past when I have used it I had issues because there was a blacklisted module.

Maybe it can be worth a try to do the same to see if something similar is happening:
Remove the file /etc/modprobe.d/blacklist-mttcan.conf if it exists, or even comment it’s content.

Regards,
Roberto Gutierrez,
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/

Dear Roberto

I have tried to follow advice and in the /etc/modprobe.d/ it has only file:
denylist-mttcan.conf
and the file content: blacklist mttcan

I have removed the file (denylist-mttcan.conf)
but the result still the same: CAN0 can not TX?RX to/from CAN tester.

Is there any reason that Xavier NX Jetpack 5.02 default image could prevent CAN bus working?

Thanks

So is “lsmod” showing up mttcan or not?

Dear

I have checked lsmod, it shows mttcan:

lsmod | grep can
can_raw 28672 2
can 28672 1 can_raw
mttcan 65536 0
can_dev 32768 1 mttcan

I have tested internal loop back, it works perfectly, thus I think it does not have problem with CAN driver.
LOOP BACK MODE:
ip link set can0 type can bitrate 1000000 loopback on
ip link set up can0
[1]+ Exit 1 candump can0
root@ubuntu:/home/lts# candump can0 &
[1] 2517
root@ubuntu:/home/lts# ip -s -d link show can0
9: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 1000000 sample-point 0.735
tq 29 prop-seg 12 phase-seg1 12 phase-seg2 9 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 34000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
root@ubuntu:/home/lts# cansend can0 5A1#1122334455667788
can0 5A1 [8] 11 22 33 44 55 66 77 88
can0 5A1 [8] 11 22 33 44 55 66 77 88
root@ubuntu:/home/lts# lsmod | grep can
mttcan 65536 0
can_dev 32768 1 mttcan
can_raw 28672 1

=======================================================

Only that when using the CAN tester, it shows nothing.

Have you checked Controller Area Network (CAN) — Jetson Linux Developer Guide documentation (nvidia.com)?

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