Hi, I am pretty new to embedded development. I have been working Nvidia Jetson Tx2 board recently and wanted to setup can communication between the can controller and another external board with can controller on it. I am using the SN65HVD230 external transceiver in between the controllers on the two boards.
Jetson CAN controller [J26 headers] → Transceiver → External Controller
To setup the network I needed to configure the CAN bus interface name & port name on the jetson board. I would really appreciate if someone could help me understand where to find it and/or configure it?
P.S: I was able to use socketCAN between CAN0 and CAN1 of the Jetson board to communicate some test messages.
The board on the receiving end is continuously listening for CAN bus messages.
Hi Shgarg,
I am using a ESCON Positioning Controller for my robot. and I wanted to communicate with it using the CAN bus. I need to understand the interface name and the port name my Jetson CAN controller will be enabled on, to work with the ESCON library for Linux on their website.
If you are looking for the setup instructions, below steps can be followed to enable and have CAN working on TX2.
Similar setup instructions can be followed for interfacing both internal as well as external can controllers.
Enable kernel support for mttcan(Other required modules are already supported)
CONFIG_MTTCAN = m (mttcan is compiled as a module)
Insert CAN BUS subsystem support module. modprobe can
Insert Raw CAN protocol module (CAN-ID filtering) modprobe can_raw
Real CAN interface support (for our case, it is: mttcan) modprobe mttcan (dependent module is can_dev: can driver with netlink support)
CAN interface settings for both the controllers ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
ip link set up can0
ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
ip link set up can1
CAN interfaces are up now. Use ifconfig to list all the interfaces which are up.
Installation of user app to check CAN communication sudo apt-get install can-utils
Commands to run to check CAN packet send/receive
broadcasting a can data packet: cansend <can_interface> <can_frame>
e.g. cansend can0 123#abcdabcd
Receiving a can data packet: candump can_interface
e.g. candump can1
Different tools (i.e. cangen, cangw etc) can be used for various filtering options.
To check the interface statistics ip -details -statistics link show can0
ip -details -statistics link show can1
Please specify, if you are looking into anything else.
Sparta, I have already setup and tested the can controllers using the same steps as you provided.
Shgarg, the reply gave me some insight in the controller details.
But, I should have been more clear with my question:
If can0 is my interface name. what port name will it be working with? Or can it somehow be configured or virtually created?
E.G. If I use USB as my interface name, /dev/ttyUSB0 is my port name. Or If I use a serial interface, COM1 is my port name