Canfd

板卡信息:R32 (release),REVISION: 7.1; ubuntu18.04LTS

在终端运行:
sudo ip link set can1 type can bitrate 1000000 sample-point 0.8 dbitrate 5000000 dsample-point 0.8 fd on restart-ms 100

显示:
nvidia@nvidia-desktop:~$ ip -s -d link show can1
10: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0
can <BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 125) restart-ms 100
bitrate 1000000 sample-point 0.794
tq 29 prop-seg 13 phase-seg1 13 phase-seg2 7 sjw 1
mttcan: tseg1 2…255 tseg2 0…127 sjw 1…127 brp 1…511 brp-inc 1
dbitrate 4857142 dsample-point 0.714
dtq 29 dprop-seg 2 dphase-seg1 2 dphase-seg2 2 dsjw 1
mttcan: dtseg1 1…31 dtseg2 0…15 dsjw 1…15 dbrp 1…15 dbrp-inc 1
clock 34000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 4127 0 1 799 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
101408 6479 4127 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0

我有个can设备支持canfd协议,其仲裁域波特率为1M,数据域波特率为5M,将该设备接入板卡,设置板卡的参数如上命令,看到的结果是仲裁域波特率设置1M成功,而设置的数据域5M用show命令看时显示的是4857142 ;然后上电接收数据,能接收到can数据,但是错误包很多,不知道是什么原因造成的。

我猜测的可能的原因如下,
1.时钟错误,因为系统中看到的/can2/parent是pll_c,有些资料说是 pllaon才对;
2.使用的tcan332芯片最高波特率仅支持1M,而设置的数据域波特率是5M,所以接收数据才出错
3.其他原因

请大佬指点,谢谢!

Hi there @zjk800471 ,

could you please give some explanation what it is you would like to ask? From the log output above alone it is really hard to decipher what your issue might be.

Thanks!

This topic was automatically closed after 13 hours. New replies are no longer allowed.