How to enable TX2-NX CAN controller?


How to enable TX2-NX CAN controller ?

sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan

dmesg :
[  220.577488] can: controller area network core (rev 20120528 abi 9)
[  220.578911] NET: Registered protocol family 29
[  220.599438] can: raw protocol (rev 20120528)
[  221.138441] CAN device driver interface
cat /sys/kernel/debug/tegra_pinctrl_reg
Bank: 1 Reg: 0x0c303000 Val: 0x00000050 -> can_gpio7_paa7
Bank: 1 Reg: 0x0c303008 Val: 0x00000415 -> can1_dout_pz0
Bank: 1 Reg: 0x0c303010 Val: 0x00000415 -> can1_din_pz1
Bank: 1 Reg: 0x0c303018 Val: 0x00000400 -> can0_dout_pz2
Bank: 1 Reg: 0x0c303020 Val: 0x00000458 -> can0_din_pz3
Bank: 1 Reg: 0x0c303028 Val: 0x00006414 -> can_gpio0_paa0
Bank: 1 Reg: 0x0c303030 Val: 0x00006414 -> can_gpio1_paa1
Bank: 1 Reg: 0x0c303038 Val: 0x00000415 -> can_gpio2_paa2
Bank: 1 Reg: 0x0c303040 Val: 0x00000414 -> can_gpio3_paa3
Bank: 1 Reg: 0x0c303048 Val: 0x00000414 -> can_gpio4_paa4
Bank: 1 Reg: 0x0c303050 Val: 0x00000414 -> can_gpio5_paa5
Bank: 1 Reg: 0x0c303058 Val: 0x00000000 -> can_gpio6_paa6

ifconfig -a (no CAN device )

Hello @Luna2020
These commands are worked in our device:

sudo modprobe can
sudo modprobe can-raw
sudo modprobe mttcan
sudo ip link set can0 up type can bitrate 500000

Can you additionally type this:
sudo ip link set can0 up type can bitrate 500000


1 Like

Hi mehmetdeniz,

Thanks for your information, but on my device there is no ‘can0’ device.
If I change to NX SOM on the same carrier board, ‘can0’ device works fine.

nvidia@tx2-nx:~$ sudo modprobe can
nvidia@tx2-nx:~$ sudo modprobe can-raw
nvidia@tx2-nx:~$ sudo modprobe can-dev
nvidia@tx2-nx:~$ sudo modprobe mttcan
nvidia@tx2-nx:~$ sudo ip link set can0 up type can bitrate 500000
Cannot find device "can0"


I find the default dtsi, ‘mttcan’ is disabled, just enable the mttcan.

        mttcan@c310000 {
                status = "okay";
1 Like