I used jetpack5.1.2 to test the communication transmission of canfd. I used a self-made onboard, but when I tested it, I found that the rate could not reach 5Mbps. I measured the waveform with an oscilloscope and the maximum rate was 2.5MHz. Our hardware can support a rate of up to 5Mbps. Our software settings are as follows. I don’t know if there are other settings that are overlooked.
busybox devmem 0x0c303018 w 0xc458
busybox devmem 0x0c303010 w 0xc400
modprobe can
modprobe can_raw
modprobe mttcan
echo 0x600 > /sys/devices/platform/c310000.mttcan/net/can0/tdc_offset
Next, I use socket can to test the sending and receiving.
There is no CAN transceiver on the devkit, but our board is almost the same as the devkit.
My configuration process:
busybox devmem 0x0c303018 w 0xc458
busybox devmem 0x0c303010 w 0xc400
modprobe can
modprobe can_raw
modprobe mttcan
echo 0x600 > /sys/devices/platform/c310000.mttcan/net/can0/tdc_offset
ip link set can0 down
ip link set can0 up type can bitrate 500000 dbitrate 5000000 berr-reporting on fd on
sudo ifconfig can0 txqueuelen 1000
ip -s -d link show can0
Then I used socketcan to test the sending and receiving speed.
I think my dmesg is normal, I captured the dmesg log after setting up can.
[ 17.080367] Adding 993480k swap on /dev/zram5. Priority:5 extents:1 across:993480k SS
[ 17.081921] zram6: detected capacity change from 0 to 1017327616
[ 17.112339] Adding 993480k swap on /dev/zram6. Priority:5 extents:1 across:993480k SS
[ 17.113881] zram7: detected capacity change from 0 to 1017327616
[ 17.144543] Adding 993480k swap on /dev/zram7. Priority:5 extents:1 across:993480k SS
[ 19.231962] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 135.366866] Bridge firewalling registered
[ 135.882893] nvidia-modeset: Loading NVIDIA UNIX Open Kernel Mode Setting Driver for aarch64 35.4.1 Release Build (buildbrain@mobile-u64-6422-d7000) Tue Aug 1 12:45:42 PDT 2023
[ 136.136083] NVRM rpcRmApiControl_dce: NVRM_RPC_DCE: Failed RM ctrl call cmd:0x731341 result 0xffff:
[ 136.154864] cpufreq: cpu4,cur:2140000,set:1984000,set ndiv:155
[ 734.502407] usb 1-2.3: USB disconnect, device number 4
[ 734.502420] usb 1-2.3.1: USB disconnect, device number 5
[ 734.503438] usb 1-2.3.3: USB disconnect, device number 6
[ 3395.900354] can: controller area network core
[ 3395.900420] NET: Registered protocol family 29
[ 3395.909828] can: raw protocol
[ 3395.920275] CAN device driver interface
[ 3395.927727] 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|
[ 3395.929055] Release 3.2.3 from 09.06.2018
[ 3395.929485] net can0: mttcan device registered (regs=00000000fd2c00a9, irq=110)
[ 3395.936534] mttcan c310000.mttcan can0: Bitrate set
[ 3395.936667] mttcan_controller_config: ctrlmode 30
[ 3395.936688] mttcan c310000.mttcan can0: Bitrate set
[ 3395.936796] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready