CAN通信经常收到错误帧

固件类型:官方提供的固件
固件文件名称:AIO-3568J-UBUNTU18.04-GPT-20211201-1505
固件下载地址:百度网盘
Log日志:candump-2022-07-11_090825.rar

本帖最后由 翁金平 于 2022-7-11 17:13 编辑

与电机控制器通信经常出现错误帧,打印如下:
[ERROR] [1654498195.150578337]: Received error frame: 20000088#0000020000000052
[ERROR] [1654498195.151746160]: Received error frame: 20000088#000002000000005b
[ERROR] [1654498195.152665568]: Received error frame: 20000088#0000020000000064
[ERROR] [1654498195.153192021]: Received error frame: 20000088#000002000000006d
[ERROR] [1654498195.153864890]: Received error frame: 20000088#0000020000000076

CAN详细信息如下:
3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/can promiscuity 0
can state ERROR-WARNING (berr-counter tx 0 rx 0) restart-ms 0
bitrate 500000 sample-point 0.850
tq 100 prop-seg 8 phase-seg1 8 phase-seg2 3 sjw 1
rockchip_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..128 brp-inc 2
clock 100000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

收到错误帧后can state 由ERROR-ACTIVE变为ERROR-WARNIN,通信波特率500k。
用研华工控机CAN设备控制都是正常的没有错误帧。

tchip_askquestions
log.txt (2.85 KB)
candump-2022-07-11_090825.rar (3.67 KB)

去年的固件can时钟频率不足,换今年的固件试一下

Liuth 发表于 2022-6-6 15:50
去年的固件can时钟频率不足,换今年的固件试一下

请问今天的固件时钟频率是多少

Liuth 发表于 2022-6-6 15:50
去年的固件can时钟频率不足,换今年的固件试一下

换了新固件,时钟显示200m
3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/can promiscuity 0
can state ERROR-WARNING (berr-counter tx 0 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 250 prop-seg 3 phase-seg1 3 phase-seg2 1 sjw 1
rockchip_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..128 brp-inc 2
clock 200000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
但还是不断打印这个错误
[ERROR] [1654509526.782943988]: Received error frame: 20000088#000000000000002d
[ERROR] [1654509526.783218161]: Received error frame: 20000088#0000000000000036
[ERROR] [1654509526.783452958]: Received error frame: 20000088#000000000000003f
[ERROR] [1654509526.783655088]: Received error frame: 20000088#0000000000000040
[ERROR] [1654509526.783852259]: Received error frame: 20000088#0000000000000051
[ERROR] [1654509526.784058764]: Received error frame: 20000088#0000000000000052

请问出现错误帧的接收频率是多少?

dengkx 发表于 2022-6-7 09:56
请问出现错误帧的接收频率是多少?

错误帧20000088对应的应该是
#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) /
#define CAN_ERR_PROT 0x00000008U /
protocol violations / data[2..3] */
重启CAN后会正常几秒,后面频率越来越高 最后全部都是错误帧,收不到其他数据。

翁金平 发表于 2022-6-7 09:59
错误帧20000088对应的应该是
#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */

你接收到错误帧时,can的发送频率是多少?1K?还是2K?

dengkx 发表于 2022-6-7 10:35
你接收到错误帧时,can的发送频率是多少?1K?还是2K?

没明白什么意思,总线上大概每秒20条报文,总线占用率很低

本帖最后由 dengkx 于 2022-6-8 17:21 编辑

用这

等等,传错了

出现这些错误的数据只特定的吗?还是随机数据?我好复现一下

dengkx 发表于 2022-6-7 16:05
等等,传错了

{:5_254:}

dengkx 发表于 2022-6-7 16:05
等等,传错了

{:5_254:}

dengkx 发表于 2022-6-7 16:12
出现这些错误的数据只特定的吗?还是随机数据?我好复现一下

看起来是随机的 方不方便微信沟通 项目比较急

dengkx 发表于 2022-6-7 16:12
出现这些错误的数据只特定的吗?还是随机数据?我好复现一下

暂时测不了了,刚刚板子上电完全起不来了{:5_241:}

500K用can输入时钟改成150M,用ip -details link show can0看一下有没有500K,如果没有:
— a/arch/arm64/boot/dts/rockchip/rk3568.dtsi
++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
@ -869,7 +869,7 @
<250000000>, <125000000>,
<100000000>, <62500000>,
<50000000>, <25000000>,

  • <1188000000>,
    <1200000000>,
    <150000000>, <100000000>,
    <500000000>, <400000000>,
    <150000000>, <100000000>,
    把这个改一下再看。

时钟200M,波特率500K,使用分析仪测试,没发现问题,或者你发一下回放文件给我们

dengkx 发表于 2022-6-8 11:04
时钟200M,波特率500K,使用分析仪测试,没发现问题,或者你发一下回放文件给我们

你好 寄修返回了 我把candump日志上传了 麻烦分析下

翁金平 发表于 2022-7-11 17:14
你好 寄修返回了 我把candump日志上传了 麻烦分析下

目前波特率改为了250k 时钟200M
3: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/can promiscuity 0
can state ERROR-WARNING (berr-counter tx 0 rx 0) restart-ms 0
bitrate 250000 sample-point 0.875
tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
rockchip_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..128 brp-inc 2
clock 200000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

dengkx 发表于 2022-6-8 11:04
时钟200M,波特率500K,使用分析仪测试,没发现问题,或者你发一下回放文件给我们

请问还在吗,问题能不能复现