I am new to CAN analyzer and TX2 board. I want to know how to configure CAN bus for CAN analyzer. Or which is the best method to transmit data from TX2 on CAN bus.
When I am typing
ifconfig -a
only Ethernet details are shown. If video tutorial is available for enabling CAN Bus for TX2 then it will be great help.
I am using current Jetpack version 3.2
These are the steps can be followed to enable and check CAN on TX2.
Enable kernel support for mttcan(Other required modules are already supported)
CONFIG_MTTCAN = m (Here 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