I’m try to connect 2 new Jetson to to different microcontrollers to send and receive information.
I have 18 Jetson Orin AGX Development kit, only in the last 2 new Jetsons the can bus fails, I followed the official developer guide for all of them, and this is the configuration:
# Load kernel modules
modprobe can
modprobe can_raw
modprobe mttcan
# Setup pinmux configurations
busybox devmem 0x0c303000 32 0x0000C400
busybox devmem 0x0c303008 32 0x0000C458
busybox devmem 0x0c303010 32 0x0000C400
busybox devmem 0x0c303018 32 0x0000C458
# Setup CAN network
ip link set can0 up type can bitrate 1000000
ip link set can1 up type can bitrate 1000000
Send a package from same Jetson
# Send msg to can0
cansend can0 123#1122334455667788
dmesg output:
[ 907.462205] can: controller area network core
[ 907.462262] NET: Registered protocol family 29
[ 907.467003] can: raw protocol
[ 907.472214] CAN device driver interface
[ 907.478114] Message RAM Configuration
| base addr |0x0c312000|
| sidfc_flssa |0x00000000|
| xidfc_flesa |0x00000040|
| rxf0c_f0sa |0x000000c0|
| rxf1c_f1sa |0x000009c0|
| rxbc_rbsa |0x000009c0|
| txefc_efsa |0x000009c0|
| txbc_tbsa |0x00000a40|
| tmc_tmsa |0x00000ec0|
| mram size |0x00001000|
[ 907.479455] Release 3.2.3 from 09.06.2018
[ 907.481318] net can0: mttcan device registered (regs=000000008bc8e899, irq=115)
[ 907.484196] Message RAM Configuration
| base addr |0x0c322000|
| sidfc_flssa |0x00000000|
| xidfc_flesa |0x00000040|
| rxf0c_f0sa |0x000000c0|
| rxf1c_f1sa |0x000009c0|
| rxbc_rbsa |0x000009c0|
| txefc_efsa |0x000009c0|
| txbc_tbsa |0x00000a40|
| tmc_tmsa |0x00000ec0|
| mram size |0x00001000|
[ 907.485564] Release 3.2.3 from 09.06.2018
[ 907.485904] net can1: mttcan device registered (regs=00000000c624d511, irq=116)
[ 907.528721] mttcan c310000.mttcan can0: Bitrate set
[ 907.528815] mttcan_controller_config: ctrlmode 0
[ 907.528828] mttcan c310000.mttcan can0: Bitrate set
[ 907.528935] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 907.530747] mttcan c320000.mttcan can1: Bitrate set
[ 907.530806] mttcan_controller_config: ctrlmode 0
[ 907.530819] mttcan c320000.mttcan can1: Bitrate set
[ 908.549305] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
[ 911.631219] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 912.122263] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 917.660140] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 918.150348] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 925.491485] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 925.983564] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 927.369911] mttcan c310000.mttcan can0: entered error warning state
[ 927.376409] mttcan c310000.mttcan can0: entered error passive state
[ 927.382938] mttcan c310000.mttcan can0: entered bus off state
the other jetsons do not show this error in dmesg when i try to send a package to can0 (c310000) or can1 (c320000):
# When execute: cansend can0 123#1122334455667788
[ 927.369911] mttcan c310000.mttcan can0: entered error warning state
[ 927.376409] mttcan c310000.mttcan can0: entered error passive state
[ 927.382938] mttcan c310000.mttcan can0: entered bus off state
# When execute: cansend can1 123#1122334455667788
[ 927.369911] mttcan c320000.mttcan can1: entered error warning state
[ 927.376409] mttcan c320000.mttcan can1: entered error passive state
[ 927.382938] mttcan c320000.mttcan can1: entered bus off state
here the jetson is not connected to anything else and candump does not show the arrival of the package that it sends itself, apparently the network stops working
candump -x any
Also try to configure the CAN bus pins following this guide:
sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb can0 can1
# Configuration saved to /boot/kernel_tegra234-p3701-0000-p3737-0000-user-custom.dtb.
# Reboot system to reconfigure.
sudo reboot
but it fails anyway, although this script does not write the same configuration for the pinmux
busybox devmem 0x0c303000
# 0x0000C404
busybox devmem 0x0c303008
# 0x0000C454
busybox devmem 0x0c303010
# 0x0000C404
busybox devmem 0x0c303018
# 0x0000C454
the way to solve it has been to add the loopback, with this it is now possible to send the messages without the mttcan driver dying:
# Setup CAN network
ip link set can0 up type can bitrate 1000000 loopback on
ip link set can1 up type can bitrate 1000000 loopback on
Something else that I am not sure about is the bitrate, I have tried 1M the first time and 5M by mistake and in both cases it has worked and I receive the packets that I sent to the CAN bus through an external microcontroller.
All Jetson that have the can bus working have the same configuration:
- Kernel: Linux ubuntu 5.10.104-tegra
- Jetpack: 5.1.1-b56
The last two for which the CAN bus does not work also have the same configuration:
- Kernel: Linux ubuntu 5.10.104-tegra
- Jetpack: 5.1.1-b56