Jetson nx : can configuration

Hello,

Were are trying to configure a jetson nx with a can transceiver sn65hvd230. We have performed the following states:
sudo busybox devmem 0x0c303000 32 0x0000c400 sudo busybox devmem 0x0c303008 32 0x0000c458
sudo modprobe can sudo modprobe can-raw
sudo modprobe mttcan sudo ip link set can0 up type can bitrate 500000

can0 connexion is failed, sudo ip -details -statistics link show can0, returns

can0: <NOARP,ECHO> mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can <BERR-REPORTING,FD> state STOPPED (berr-counter tx 248 rx 127) restart-ms 0
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
dbitrate 2021052 dsample-point 0.736
dtq 26 dprop-seg 6 dphase-seg1 7 dphase-seg2 5 dsjw 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 2807 0 1 1 1 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
22480 2810 2807 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 9 0 0

and sudo dmesg | grep mttcan , returns something like :

[ 269.151848] net can0: mttcan device registered (regs=ffffff80262b6000, irq=63)
[ 288.532746] mttcan c310000.mttcan can0: bitrate error 0.2%
[ 288.532895] mttcan c310000.mttcan can0: Bitrate set
[ 288.532980] mttcan_controller_config: ctrlmode 0
[ 288.532997] mttcan c310000.mttcan can0: Bitrate set
[ 373.572364] mttcan c310000.mttcan can0: bitrate error 0.2%
[ 373.572510] mttcan c310000.mttcan can0: Bitrate set
[ 373.572579] mttcan_controller_config: ctrlmode 0
[ 373.572596] mttcan c310000.mttcan can0: Bitrate set
[ 438.054346] mttcan c310000.mttcan can0: Bitrate set
[ 438.054380] mttcan c310000.mttcan can0: bitrate error 1.0%
[ 438.054579] mttcan_controller_config: ctrlmode 30
[ 438.054603] mttcan c310000.mttcan can0: Bitrate set
[ 441.309916] mttcan c310000.mttcan can0: Stuff Error Detected
[ 441.310158] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x711
[ 443.490880] mttcan c310000.mttcan can0: Stuff Error Detected
[ 443.491132] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x711
[ 443.910085] mttcan c310000.mttcan can0: Stuff Error Detected
[ 443.910324] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x711
[ 444.976860] mttcan c310000.mttcan can0: Stuff Error Detected
[ 444.977085] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x711
[ 445.461675] mttcan c310000.mttcan can0: Stuff Error Detected
[ 445.461876] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x711
[ 447.648415] mttcan c310000.mttcan can0: Stuff Error Detected
[ 447.648641] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x711
[ 447.725279] mttcan c310000.mttcan can0: Stuff Error Detected
[ 447.725472] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x711
[ 1248.302364] mttcan c310000.mttcan can0: bitrate error 0.2%
[ 1248.302552] mttcan c310000.mttcan can0: Bitrate set
[ 1248.302625] mttcan_controller_config: ctrlmode 30
[ 1248.302647] mttcan c310000.mttcan can0: Bitrate set
[ 1249.882288] mttcan c310000.mttcan can0: Stuff Error Detected
[ 1249.882456] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x711
[ 1250.011799] mttcan c310000.mttcan can0: Stuff Error Detected
[ 1250.012009] mttcan c310000.mttcan can0: IR 0x8000000 PSR 0x711

Any ideas ?
Thanks in advance

Hi patrick,
May I know what is connected on other side from transceiver sn65hvd230. and at what bitrate it is set?
CAN0 on NX is set to bitrate 498701 so make sure other side bitrate is also same to communicate.

Hi,
The equipment connected on the other side is using a bitrate of 500000 (and we cannot change it ;) ) , so maybe we need to use pallon as clock source for nx ?

By the way, could you confirm the pin number associated to J17 port ? (sudo busybox devmem 0x0c303000 32 0x0000c400 sudo busybox devmem 0x0c303008 32 0x0000c458)

Hello,

Issue seems to be on the connected equipment and not on the jetson side, actually connection between the nx and another jetson Xavier (following the below tutorial) seems OK:


Thanks for answers