Can loopback

https://docs.nvidia.com/jetson/archives/r35.3.1/DeveloperGuide/text/HR/ControllerAreaNetworkCan.html?#debug-methods

i have followed the same steps
jetpack 5.1.1
without shorting tx and rx I’m getting the same output

$ 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

Hi amb018753,

Are you using the devkit or custom board for Orin Nano?

It is expected because “loopback on” means internal loopback test and you don’t need to connect any cable externally.

[sudo] password for orin: 
orin@tegra-ubuntu:~$ sudo modprobe can-raw
orin@tegra-ubuntu:~$ sudo modprobe mttcan
orin@tegra-ubuntu:~$ sudo ip link set can0 down
orin@tegra-ubuntu:~$ sudo ip link set can0 up type can bitrate 500000 loopback on
orin@tegra-ubuntu:~$ sudo ip link set can0 up                                                                                                 
orin@tegra-ubuntu:~$ candump can0 &
[1] 3885
orin@tegra-ubuntu:~$ cansend can0 123#abcdabcd
orin@tegra-ubuntu:~$   can0  123   [4]  AB CD AB CD
  can0  123   [4]  AB CD AB CD

can this be validated for verifying CAN interface
" Short the Tx and Rx pins of the Jetson carrier board’s CAN0." this is not done externally

please let me know if its correct

You can not short CAN-TX/CAN-RX.
Please get a CAN transceiver to transform CAN-TX/CAN-RX to transform to CAN-H/CAN-L.

will can show loopback when we short TX and RX

Sorry that I’m not clear about what do you mean here?

CAN-TX and CAN-RX can not be shorted in any cases.

so
to verify can interface

  1. software loopback
    2.using transciever
    right ?

[ 1746.404074] can: controller area network core
[ 1746.404145] NET: Registered protocol family 29
[ 1746.405226] can: raw protocol
[ 1754.645325] CAN device driver interface
[ 1754.650356] Message RAM Configuration
| base addr |0x0c312000|
| sidfc_flssa |0x00000000|
| xidfc_flesa |0x00000040|
| rxf0c_f0sa |0x000000c0|
| rxf1c_f1sa |0x000009c0|
| rxbc_rbsa |0x000009c0|
| txefc_efsa |0x000009c0|
| txbc_tbsa |0x00000a40|
| tmc_tmsa |0x00000ec0|
| mram size |0x00001000|
[ 1754.651710] Release 3.2.3 from 09.06.2018
[ 1754.651991] net can0: mttcan device registered (regs=00000000f14d27ba, irq=11 3)
[ 1770.472403] mttcan c310000.mttcan can0: Bitrate set
[ 1770.472498] mttcan_controller_config: ctrlmode 0
[ 1770.472512] mttcan c310000.mttcan can0: Bitrate set
[ 1770.472600] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 1787.680893] mttcan c310000.mttcan can0: entered error warning state
[ 1787.687385] mttcan c310000.mttcan can0: entered error passive state
[ 1832.941150] mttcan c310000.mttcan can0: Bitrate set
[ 1832.941218] mttcan_controller_config: ctrlmode 1
[ 1832.941239] mttcan c310000.mttcan can0: Bitrate set
[ 1832.941295] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 1945.508455] mttcan c310000.mttcan can0: Bitrate set
[ 1945.508536] mttcan_controller_config: ctrlmode 1
[ 1945.508559] mttcan c310000.mttcan can0: Bitrate set
[ 1945.508823] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

why is it not showing loopback
image

For the loopback test from SW, you don’t need to connect any cable externally since it is internal loopback test.
You just need to specify “loopback on” when you are configuring CAN interface.

It seems your loopback test working before.
I don’t know why it would not work now.

i need to check loopback otherthan software loopback
what are the options i have
i have only can0 as node