Hi all,
I read previous topic about CAN.
I use Jetpack 3.1 on TX2.
and I went through the following process.
-
Inserting module.
sudo modprobe can
sudo modprobe can-raw
sudo modprobe mttcan -
Setting CAN interface
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can0
sudo ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can1 -
Installing app can-utils
sudo apt-get install can-utils
when I inserted module I read kern.log like below.
nvidia@tegra-ubuntu:~$ tailf /var/log/kern.log
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <info> [1513733275.0914] manager: NetworkManager state is now CONNECTED_LOCAL
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <info> [1513733275.1058] manager: NetworkManager state is now CONNECTED_GLOBAL
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <info> [1513733275.1061] policy: set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <info> [1513733275.1074] DNS: starting dnsmasq...
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <warn> [1513733275.1191] dnsmasq[0x6f4280]: dnsmasq not found on the bus. The nameserver update will be sent when dnsmasq appears
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <info> [1513733275.1195] device (eth0): Activation: successful, device activated.
Dec 20 10:27:55 tegra-ubuntu NetworkManager[684]: <info> [1513733275.1706] dnsmasq[0x6f4280]: dnsmasq appeared as :1.59
Dec 20 10:27:57 tegra-ubuntu NetworkManager[684]: <info> [1513733277.6510] manager: startup complete
Dec 20 10:27:58 tegra-ubuntu NetworkManager[684]: <info> [1513733278.6507] WiFi hardware radio set enabled
Dec 20 10:27:58 tegra-ubuntu NetworkManager[684]: <info> [1513733278.6508] WWAN hardware radio set enabled
Dec 20 10:31:36 tegra-ubuntu kernel: [ 244.062889] can: controller area network core (rev 20120528 abi 9)
Dec 20 10:31:36 tegra-ubuntu kernel: [ 244.062969] NET: Registered protocol family 29
Dec 20 10:32:01 tegra-ubuntu kernel: [ 269.141130] can: raw protocol (rev 20120528)
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.504204] CAN device driver interface
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: <info> [1513733537.0235] manager: (can0): new Generic device (/org/freedesktop/NetworkManager/Devices/5)
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] Message RAM Configuration
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | base addr |0x0c312000|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | sidfc_flssa |0x00000000|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | xidfc_flesa |0x00000040|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | rxf0c_f0sa |0x000000c0|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | rxf1c_f1sa |0x00000300|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | rxbc_rbsa |0x00000540|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | txefc_efsa |0x00000780|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | txbc_tbsa |0x00000800|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518710] | tmc_tmsa |0x00000c80|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.518912] Release 3.2.0 from 19.12.2014
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.527176] net can0: mttcan device registered (regs=ffffff800e36a000, irq=427)
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] Message RAM Configuration
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | base addr |0x0c322000|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | sidfc_flssa |0x00000000|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | xidfc_flesa |0x00000040|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | rxf0c_f0sa |0x000000c0|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | rxf1c_f1sa |0x00000300|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | rxbc_rbsa |0x00000540|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | txefc_efsa |0x00000780|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | txbc_tbsa |0x00000800|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530248] | tmc_tmsa |0x00000c80|
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.530429] Release 3.2.0 from 19.12.2014
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: <info> [1513733537.0337] manager: (can1): new Generic device (/org/freedesktop/NetworkManager/Devices/6)
Dec 20 10:32:17 tegra-ubuntu kernel: [ 284.536712] net can1: mttcan device registered (regs=ffffff800e370000, irq=428)
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: <info> [1513733537.0442] devices added (path: /sys/devices/c310000.mttcan/net/can0, iface: can0)
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: <info> [1513733537.0442] device added (path: /sys/devices/c310000.mttcan/net/can0, iface: can0): no ifupdown configuration found.
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: <info> [1513733537.0586] devices added (path: /sys/devices/c320000.mttcan/net/can1, iface: can1)
Dec 20 10:32:17 tegra-ubuntu NetworkManager[684]: <info> [1513733537.0586] device added (path: /sys/devices/c320000.mttcan/net/can1, iface: can1): no ifupdown configuration found.
I broadcasted a can data packet like âcansend can0 123#abcdabcdâ or âcangen can0 -I i -L 2 -D i -v -vâ
(Command âcangenâ displayed like below.)
nvidia@tegra-ubuntu:~$ cangen can0 -I i -L 2 -D i -v -v
can0 000 [2] 00 00
can0 001 [2] 01 00
can0 002 [2] 02 00
can0 003 [2] 03 00
can0 004 [2] 04 00
can0 005 [2] 05 00
can0 006 [2] 06 00
can0 007 [2] 07 00
can0 008 [2] 08 00
can0 009 [2] 09 00
can0 00A [2] 0A 00
can0 00B [2] 0B 00
can0 00C [2] 0C 00
can0 00D [2] 0D 00
can0 00E [2] 0E 00
can0 00F [2] 0F 00
can0 010 [2] 10 00
can0 011 [2] 11 00
can0 012 [2] 12 00
can0 013 [2] 13 00
can0 014 [2] 14 00
can0 015 [2] 15 00
can0 016 [2] 16 00
and checked the interface statistics like âip -details -statistics link show can0â
nvidia@tegra-ubuntu:~$ ip -details -statistics link show can0
6: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 72 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can <BERR-REPORTING,FD> state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 25 prop-seg 34 phase-seg1 35 phase-seg2 10 sjw 1
mttcan: tseg1 2..255 tseg2 0..127 sjw 1..127 brp 1..511 brp-inc 1
dbitrate 2000000 dsample-point 0.750
dtq 25 dprop-seg 7 dphase-seg1 7 dphase-seg2 5 dsjw 1
mttcan: dtseg1 1..31 dtseg2 0..15 dsjw 1..15 dbrp 1..15 dbrp-inc 1
clock 40000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 2 0 1 1 0
RX: bytes packets errors dropped overrun mcast
40 5 2 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
In the course of a cangen, I scoped out CAN0 TX pin(7 of J26).
Please watch attached pictures. It had no signal.
Both CAN0 and CAN1 had same results.
Finally, I want to watch CAN communication among CAN nodes on TX2.
How can I solve the problem?
Please answer about my question.