Hello, I have a Jetson AGX Xavier and want to use the CAN ports to detect a CAN-supported motor, so I enabled the CAN ports by using
sudo /opt/nvidia/jetson-io/jetson-io.py
And using the GUI I enabled the CAN ports. I assume that this step replaces modifying the register values using busybox.
I connected the Xavier to a MCP2551 chip and added a 120ohm resistor across the CANL and CANH output of the chip. The CAN signals are then connected to the motor driver and connected the output of the driver (another CAN port) to another motor driver to act as a second node to form a CAN network. I setup the CAN interface with:
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
When I try:
ip -details -statistics link show can0
It shows this:
7: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10000
link/can promiscuity 0
can state ERROR-PASSIVE (berr-counter tx 136 rx 1) restart-ms 1000
bitrate 498701 sample-point 0.870
tq 26 prop-seg 33 phase-seg1 33 phase-seg2 10 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 38400000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
16 2 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
I tried cansend can0 220#50
and candump can0
but neither display any result.
When I run sudo dmesg | grep mttcan
:
[ 128.509237] mttcan c310000.mttcan can0: bitrate error 0.2%
[ 128.509372] mttcan c310000.mttcan can0: Bitrate set
[ 138.806412] mttcan_controller_config: ctrlmode 0
[ 138.806438] mttcan c310000.mttcan can0: Bitrate set
[ 181.949050] mttcan c310000.mttcan can0: entered error warning state
[ 181.950352] mttcan c310000.mttcan can0: entered error passive state
[15088.480739] mttcan c310000.mttcan can0: entered bus off state
[15089.489832] mttcan c310000.mttcan can0: wait for bus off seq
[15089.501920] mttcan c310000.mttcan can0: entered error warning state
[15089.502088] mttcan c310000.mttcan can0: entered error passive state
[15089.502253] mttcan c310000.mttcan can0: entered bus off state
[15090.513777] mttcan c310000.mttcan can0: wait for bus off seq
[15090.527844] mttcan c310000.mttcan can0: entered error warning state
[15090.528000] mttcan c310000.mttcan can0: entered error passive state
[15090.528129] mttcan c310000.mttcan can0: entered bus off state
[15091.537749] mttcan c310000.mttcan can0: wait for bus off seq
[15091.551800] mttcan c310000.mttcan can0: entered error warning state
[15091.551958] mttcan c310000.mttcan can0: entered error passive state
[15091.552082] mttcan c310000.mttcan can0: entered bus off state
[15092.561700] mttcan c310000.mttcan can0: wait for bus off seq
[15092.573875] mttcan c310000.mttcan can0: entered error warning state
[15092.574041] mttcan c310000.mttcan can0: entered error passive state
[15092.574163] mttcan c310000.mttcan can0: entered bus off state
[15093.585684] mttcan c310000.mttcan can0: wait for bus off seq
[15093.599723] mttcan c310000.mttcan can0: entered error warning state
[15093.599879] mttcan c310000.mttcan can0: entered error passive state
[15093.600008] mttcan c310000.mttcan can0: entered bus off state
[15094.609662] mttcan c310000.mttcan can0: wait for bus off seq
[15094.623688] mttcan c310000.mttcan can0: entered error warning state
[15094.623857] mttcan c310000.mttcan can0: entered error passive state
[15094.623985] mttcan c310000.mttcan can0: entered bus off state
[15095.633631] mttcan c310000.mttcan can0: wait for bus off seq
[15095.647695] mttcan c310000.mttcan can0: entered error warning state
[15095.647861] mttcan c310000.mttcan can0: entered error passive state
[15947.670386] mttcan c310000.mttcan can0: bitrate error 0.0%
[15947.670517] mttcan c310000.mttcan can0: Bitrate set
[21155.876748] mttcan c310000.mttcan can0: bitrate error 1.0%
[21155.876880] mttcan c310000.mttcan can0: Bitrate set
[21269.734992] mttcan c310000.mttcan can0: bitrate error 1.0%
[21269.735123] mttcan c310000.mttcan can0: Bitrate set
[21357.069255] mttcan c310000.mttcan can0: bitrate error 1.0%
[21357.069394] mttcan c310000.mttcan can0: Bitrate set
[22071.707183] mttcan c310000.mttcan can0: bitrate error 1.0%
[22071.707313] mttcan c310000.mttcan can0: Bitrate set
I ran a code that detects the number of CAN devices connected and it showed me that no CAN devices were connected.
Any help would be appreciated.
Thanks.