This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCAN4550-Q1: 在linux平台测试canfd(5Mbps带宽下)收发速率,只有0.17Mbps实际有效带宽

Part Number: TCAN4550

我在rk3588芯片上通过spi接口挂载了两路tcan4550芯片

这是相应的dts

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&spi0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0m3_cs0 &spi0m3_pins>;
num-cs = <1>;
max-freq = <18000000>;
tcan4x5x0: tcan4x5x@0{
compatible = "ti,tcan4x5x";
status = "okay";
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <18000000>;
pinctrl-0 = <&can0_int>;
interrupt-parent = <&gpio3>;
interrupts = <RK_PB6 IRQ_TYPE_LEVEL_LOW>;
bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
reset-gpios = <&gpio4 RK_PC3 GPIO_ACTIVE_HIGH>;
spi-msb-first;
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

这是收发测试脚本canfd-test.py
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import socket
import struct
import can
import time
import threading
import os
# CAN
CAN_TX_INTERFACE = 'can0' #
CAN_RX_INTERFACE = 'can1' #
CAN_BITRATE = 500000
CANFD_BITRATE = 5000000
DATA_LEN = 64
DATA_RLEN = DATA_LEN + 8
#
running = True
total_sent = 0
total_received = 0
# 线
def send_thread():
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

测试结果如下:
x 出现错误。请重试或与管理员联系。