I am having trouble getting CAN to work on TX2 - jetpack 3.1. I get the same error whether a transceiver is connected or not. Have tried it on two different TX2’s. Feels like a stupid/simple mistake… but I just can’t see it…
Here is the code I am running and the errors I am getting:
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on
sudo ip link set up can0
//CHECK INTERFACE BEFORE SENDING. ALL GOOD.
ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP <b>RUNNING</b> NOARP MTU:72 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:171
//SEND FRAME (Nothing is received in candump).
cansend can0 123#R
//CHECK INTERFACE AGAIN - IT STOPPED RUNNING
ifconfig
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP NOARP MTU:72 Metric:1
RX packets:5 errors:2 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:40 (40.0 B) TX bytes:0 (0.0 B)
Interrupt:171
dmesg
[ 809.714212] can: controller area network core (rev 20120528 abi 9)
[ 809.720519] NET: Registered protocol family 29
[ 812.756051] can: raw protocol (rev 20120528)
[ 817.946244] CAN device driver interface
[ 817.966537] Message RAM Configuration
| base addr |0x0c312000|
| sidfc_flssa |0x00000000|
| xidfc_flesa |0x00000040|
| rxf0c_f0sa |0x000000c0|
| rxf1c_f1sa |0x00000300|
| rxbc_rbsa |0x00000540|
| txefc_efsa |0x00000780|
| txbc_tbsa |0x00000800|
| tmc_tmsa |0x00000c80|
[ 818.004910] Release 3.2.0 from 19.12.2014
[ 818.009401] net can0: mttcan device registered (regs=ffffff8000016000, irq=427)
[ 818.019587] Message RAM Configuration
| base addr |0x0c322000|
| sidfc_flssa |0x00000000|
| xidfc_flesa |0x00000040|
| rxf0c_f0sa |0x000000c0|
| rxf1c_f1sa |0x00000300|
| rxbc_rbsa |0x00000540|
| txefc_efsa |0x00000780|
| txbc_tbsa |0x00000800|
| tmc_tmsa |0x00000c80|
[ 818.057961] Release 3.2.0 from 19.12.2014
[ 818.062292] net can1: mttcan device registered (regs=ffffff800001e000, irq=428)
[ 834.783387] mttcan c310000.mttcan can0: Bitrate set
[ 846.624545] mttcan_controller_config: ctrlmode 30
[ 846.629319] mttcan c310000.mttcan can0: Bitrate set
[ 875.326392] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 875.331985] mttcan c310000.mttcan can0: IR 0x8010000 PSR 0x71d
[ 875.337861] mttcan c310000.mttcan can0: entered error warning state
[ 875.344144] mttcan c310000.mttcan can0: entered error passive state
[ 875.350430] mttcan c310000.mttcan can0: entered bus off state
[ 875.356188] mttcan c310000.mttcan can0: Bit0 Error Detected
[ 875.361768] mttcan c310000.mttcan can0: IR 0xb800000 PSR 0x7e5
lsmod
Module Size Used by
mttcan 60222 0
can_dev 13063 1 mttcan
can_raw 9004 2
can 46836 1 can_raw
fuse 89008 2
bcmdhd 7625819 0
pci_tegra 74691 0
bluedroid_pm 13564 0
