Hi leetop,
Connect a transceiver something like this: https://www.amazon.in/xcluma-Sn65Hvd230-Transceiver-Communication-Module/dp/B072TCPSB1/ref=sr_1_1?crid=1UF4TU4O2J0M1&dchild=1&keywords=can+transceiver&qid=1590119310&sprefix=CAN+tra%2Caps%2C379&sr=8-1
- Connect RX of transceiver to CAN_RX of J17
- Same with other 3 pins
- Update pinmux registers mentioned above
- load kernel modules:
modprobe can
modprobe can-raw
modprobe mttcan - Make can interface up on network with bitrate 500kbps:
ip link set can0 up type can bitrate 500000
Your can0 node is ready to transfer packets, you can connect other CAN nodes on bus via CANH and CANL pins of transceiver. - send message from can0
cansend can0 123#abcdabcd - receive message in can0
candump can0
For all these steps, you will need to connect one more CAN node on bus.
If you do not have other CAN device or transceiver:
you can do loopback test:
- Connect CAN_RX of J17 to CAN_TX of J17
- Update pinmux registers mentioned above
- load kernel modules:
modprobe can
modprobe can-raw
modprobe mttcan - Make can interface up on network with bitrate 500kbps:
ip link set can0 up type can bitrate 500000 loopback on - candump can0 &
- cansend can0 123#abcdabcd
Thanks,
Shubhi