CAN communication Issue

Thank you for this information. But I am trying to work with a Jetson Orin, on a Linux OS using the terminal. Are there any information and tutorials for that similar to the replies how @KevinFFF has been providing?

You may have got an hardware issue. In order to solve this you need hardware knowledge. If you can’t see what your hardware is actually doing on the bus everything else is guesswork. Typing commands on a console is not enough.

If the termination or the impedence on the bus is not correct or the distance between the nodes is too short or too long your hardware won’t be able to communicate at all. If GND is not connected the transceivers may not work correctly, and no software can correct this.

fchk

Could you help me for the CAN0 to CAN1 communication in the Jetson itself? without the transceiver? Now that itself isnt working. I dont know where the steps are going wrong.

these are my steps

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan

assigning address to the pins

sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
sudo ip link set can1 type can bitrate 500000
sudo ip link set up can1

sudo ip -d -s link show can0
sudo ip -d -s link show can1

(above messages show a proper connection established)

Pin connection - CAN0_TX - CAN1_TX AND CAN0_RX - CAN1_RX ( I tried the other way as well)

candump can1
cansend can0 123#abcdabcd

I dont see any response for candump

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 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 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@Orin1:/home/r2d2# ip -d -s link show can1
10: can1: <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 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 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

Operation without transceivers is outside of the standard. Just connecting TX and RX like with serial ports won’t work anyway. You see, a CAN controller always reads back what it is sending and stops when it dowes not receive what it sends.

What may work: (not covered by any official standard)

  • connect GND of all devices together.
  • connect all RX lines to a bus line together.
  • pull up the bus line with 3.3 kohm to +3v3.
  • connect each TX to its RX via a diode (cathode to TX, anode to RX)

This way each TX can pull the bus line low (but not high), and each RX receives what has been sent.

See https://os.mbed.com/media/uploads/hudakz/can_without_transceivers.png

You’d better take the CAN tutorial…

fchk

1 Like

To explain my issue easily for you @KevinFFF I am having the same issues as Jetson AGX Xavier Developer Kit CAN commmunication error

I have been following the instructions provided by you on that link now since this message. I will update the results here.

and instead of a xavier I have a Jetson AGX Orin

It seems there’s wrong CAN setup causing packet sent failed and make it entering into BUS-OFF state.

Yes, please refer to those steps in the thread.
You would need CAN transceivers for CAN communication.

It would be fine if you are using Orin series.
Are you using AGX Orin or Orin NX?

Yes, and you won’t see this until you use measurement equipment (Oscilloscope and/or logic analyzer) to watch the bus signals. Right now you are running blindly through a forest hitting trees on your way. This is not a good way of problem solving.

fchk

I used the same setup as per your setup in the thread. The first txt file contains the error issues that occurred after using

these commands. so I used these commands

the second txt files contains all the issues I had after making the changes. The testing setup, the pins, everything are the same as what you have in your setup. (picture below)

I am using an AGX Orin

I will update with the errors while using the motors.

test1 (6.3 KB)
test2 (5.5 KB)

I figured out the solution.

running the Jetson-IO I turned on the CAN-bus and I figured that was enough. and then, on Controller Area Network (CAN) — Jetson Linux<br/>Developer Guide 34.1 documentation

CAN page provided by NVIDIA - it mentions to use 0xC458. I changed that to 454 based on your

but I forgot to check the register for 0x0c303010 which were set to 0xC404 when CAN-bus was turned on Jetson-IO. After changing the register to 0xC400, it got connected.

I guess the registers are 0xC454 and 0xC400.

1 Like

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