usasos000 发表于 2020-3-12 16:26:17

AIO-3399PRO,CAN卡丢帧问题

按官方工程师的指导,修改了CAN的电阻,可以正常运行CAN卡
在ubuntu启动后,使用命令 ifconfig can0 up, 启动can卡

但经过测试 板卡上使用的MCP2515芯片会发生无序及丢包现象。

我使用windows+USBCAN盒发送测试数据,测试数据内容固定8字节,帧号每帧加一,
在接收端读取帧号来判断是否丢帧,除了接收后判断,
还可以使用命令ifconfig can0查看errors记录了丢帧数

测试现象,1.帧会出现无序的情况,比如 发送帧号是1,2,3,4,,接收到的顺序是1,3,2,4,或者1,4,2,3

2.会出现丢帧的情况,无论can盒以什么速度 什么间隔发数据,都会丢帧。以下是测试报告


      每次多少帧间隔ms测试时长测试时长发送数量接收帧/秒字节/秒丢包数丢包率丢包/秒
1010000:27:201640163719.99169.83173610.58%1.06
2010000:13:538331656119.97339.494102.46%0.49
5010000:13:308103815649.6843.23400.89%0.42
10010000:05:233233174998.181669.062160.68%0.67
50010000:06:54414180515450.17651.764153.47%15.50
100010000:06:4340333113482113957138194.17%34.29
150010000:10:546547213811101.6618728.22102771.42%15.71
501000:05:00300139371461.6287847.6763960.28%1.32
1001000:05:57357297560832.9714160.498890.30%2.49
1501000:06:544144755631145.9719481.4936860.77%8.90
2001000:05:423424798221402.5623843.527570.16%2.21
2501000:09:365769361331623.8427605.2814960.16%2.60
2601001:14:12445274066441663.5328280.0125860.03%0.58
2701000:04:422824821001704.8428982.288160.17%2.89
3001000:01:521122044801816.3230877.441830.09%1.63
10500:22:501370269739196.843346.28115104.27%8.40
20500:12:40760293754386.3886568.596162385.50%21.37
50500:09:42582496890853.26214505.45294825.93%50.66
100700:17:22104211374891090.8218543.94593855.22%56.99
100500:20:09120916958861090.8218543.94784274.62%64.87
100500:34:15205529423911431.6424337.8812630.04%0.61
150500:27:39165930017741808.5530745.35769832.56%46.40
200500:18:07108722733372091.2435551.08335531.48%30.87
250500:07:2544510295532308.4639243.82110671.07%24.87
250500:08:2050011564282312.4439311.48130681.13%26.14

260501:14:384478105662992359.5640112.521149721.09%25.67
300500:04:112516287002499.8642497.6290501.44%36.06



从测试报表中分析 在很慢的速度 1秒发10帧 都会出现丢帧
但在极快的速度每50ms发300帧,丢包率反而降低了,真的好奇怪
不知道这地方是芯片的问题还是驱动的问题呢

不知道各位大神有没有调过这个can卡,如何能解决这个丢帧的问题呢
页: [1]
查看完整版本: AIO-3399PRO,CAN卡丢帧问题