Hey
I want to communicate with my jetson orin and mcp2518fd can module over spi.
can anyone give me a step by step guide from scratch
Thank you
you require a CAN transciever to connect to the orin first, something like the CJMCU-1051 CAN Transceiver would be suitable
You can also refer to Controller Area Network (CAN) — Jetson Linux Developer Guide documentation (nvidia.com)
thanks,but I would like to use SPI driver MCP2518FD, which doesn’t seem to be mentioned
hello,I want to enable mcp2518fd(spi can) on orin.
Hi,
We don’t have experience about using the device, so for enabling the driver, it would need other users to share experience.
If you connect the device to SPI1, you can try to enabled it through jetson-io.py. If you use other SPI interface, please refer to the dtb file generated through jetson-io.py, and modify device tree per your design.
ok,thank you reply,please keep this topic open for now, thank you
hi,I successfully loaded mcp2518fd after I modified the device tree,I can use this instruction to start can0, but it does not communicate with can1, can2, and I tried to loopback the test failed.
titan@titan:/proc/sys/net/ipv4/conf/can2$ sudo dmesg |grep mcp
[ 14.710400] mcp251xfd spi2.0 can0: MCP2518FD rev0.0 (-RX_INT -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:20.00MHz m:10.00MHz r:8.50MHz e:0.00MHz) successfully initialized.
titan@titan:~$ sudo ip link set can0 up type can bitrate 500000 restart-ms 5000
titan@titan:~$ ifconfig
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 68
can1: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 4 bytes 16 (16.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 16 (16.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 121
can2: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 1 bytes 4 (4.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 4 (4.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 122
root@titan:/home/titan# ip link set can0 type can bitrate 50000 loopback on
RTNETLINK answers: Operation not supported
I wonder if you can give me some help. Thank you.