gpt4 book ai didi

beagleboneblack - 写: no buffer space available socket-can/linux-can

转载 作者:行者123 更新时间:2023-12-04 02:40:11 32 4
gpt4 key购买 nike

我正在运行一个带有两个 CAN channel 的程序(使用 TowerTech CAN Cape TT3201)。

两个 channel 是 can0 (500k) 和 can1 (125k)。 can0 channel 运行良好,但 can1 运行 write:No buffer space available 错误。

我正在使用 ValueCAN3/VehicleSpy 来检查消息。

这是在我运行程序之前。 can0 和 can1 似乎都在发送,但只有 can0 出现在 VehicleSpy 中。

root@cantool:~# cansend can0 100#00 
root@cantool:~# cansend can1 100#20

enter image description here

这是在我尝试运行程序之后
root@cantool:~# cansend can1 100#20 
write: No buffer space available
root@cantool:~# cansend can0 111#10

enter image description here

当我的程序正在运行时:我收到所有要在 can1 上发送的消息的错误
2016-11-02 15:36:03,052 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000    12f83018    010    1    00 
2016-11-02 15:36:03,131 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 0af81118 010 6 00 00 00 00 00 00
2016-11-02 15:36:03,148 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f81018 010 6 00 00 00 00 00 00
2016-11-02 15:36:03,174 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 0af87018 010 3 00 00 00
2016-11-02 15:36:03,220 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f89018 010 4 00 00 00 00
2016-11-02 15:36:03,352 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f83018 010 1 00

然而,有时整个程序可以完美运行(如果模块重新启动或一些随机实例)。

我该如何解决?
root@cantool:~# uname -r 
4.1.15-ti-rt-r43

在做了一些挖掘之后,我发现了这个
 root@cantool:-#ip -details link show can0
4:can0: <NOARP,UP,LOWER_UP, ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 100
bitrate 500000 sample-point 0.875
tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
clock 24000000
root@cantool:-#ip -details link show can1
5: can1: <NOARP,UP,LOWER_UP, ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state STOPPED restart-ms 100
bitrate 125000 sample-point 0.875
tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
c_can: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000

原来 can1 由于某种原因停止了

但是当我尝试时:
ip link set can1 type can restart 
RNETLINK answers: Invalid argument

最佳答案

启用 can0 后与 sudo ifconfig can0 up 的接口(interface), 跑:

sudo ifconfig can0 txqueuelen 1000

这将增加队列规则中每个内核传输队列允许的帧数。更多信息 here

... sometimes the whole program works perfectly (if the module is rebooted or some random instances).



当你重新启动 SocketCAN 接口(interface)时它工作的原因是你可能会清理足够的缓冲区空间以使其工作。

关于beagleboneblack - 写: no buffer space available socket-can/linux-can,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40424433/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com