Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread一般讨论
LWIP+enc28j60发送问题
发布于 2011-02-25 11:01:01 浏览:5401
订阅该版
我的程序功能是这样的,板子向上位机每次发送8K字节左右的数据,上位机收到数据后会回复一包45字节的数据。现在板子的程序是这样设计的:发送和接收数据分别是在两个线程里面处理,都加了互斥锁的,但是发送数据发了一会儿就会卡死,卡在发送函数里面,有时候发的时间会长点,和发送速度快慢也有关系。抓包发现貌似是重发引起的,如下图(上位机IP:10.10.10.11 板子IP:10.10.10.63): ![未命名.jpg](/uploads/1549_a97a045c07b0c2cadee7fc1913af98ad.jpg) 感觉这个重发有点问题呢,重发的数据是还没有发送过的数据。请大侠们帮我看看,感激不尽! 又重新试了几次,卡死也不单单是重发引起,有时抓包都正常
查看更多
5
个回答
默认排序
按发布时间排序
wunihaoo
2011-02-26
这家伙很懒,什么也没写!
现在把程序修改了下,接收线程是用select判断是否有接收的数据。 打开LWIP的TCP_OUTPUT_DEBUG调试发现每次卡死的时候,是这种情况,是说发送队列太长了: tcp_write(pcb=200071fc, data=20008aac, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=20008aac, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1061250:1062274 (0x0) tcp_enqueue: queueing 1062274:1063298 (0x0) tcp_output_segment: 1061250:1062274 tcp_output_segment: 1062274:1063298 tcp_write(pcb=200071fc, data=200092ac, len=44, apiflags=0) tcp_enqueue(pcb=200071fc, arg=200092ac, len=44, flags=0, apiflags=0) tcp_enqueue: queueing 1063298:1063342 (0x0) tcp_output_segment: 1063298:1063342 tcp_output: nothing to send (00000000) tcp_output: sending ACK for 426865333 tcp_write(pcb=200071fc, data=200092e4, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=200092e4, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1063342:1064366 (0x0) tcp_enqueue: queueing 1064366:1065390 (0x0) tcp_output_segment: 1063342:1064366 tcp_output_segment: 1064366:1065390 tcp_write(pcb=200071fc, data=20009ae4, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=20009ae4, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1065390:1066414 (0x0) tcp_enqueue: queueing 1066414:1067438 (0x0) tcp_output_segment: 1065390:1066414 tcp_output_segment: 1066414:1067438 tcp_write(pcb=200071fc, data=2000a2e4, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000a2e4, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1067438:1068462 (0x0) tcp_enqueue: queueing 1068462:1069486 (0x0) tcp_output_segment: 1067438:1068462 tcp_output_segment: 1068462:1069486 tcp_write(pcb=200071fc, data=2000aae4, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000aae4, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1069486:1070510 (0x0) tcp_enqueue: queueing 1070510:1071534 (0x0) tcp_output_segment: 1069486:1070510 tcp_output_segment: 1070510:1071534 tcp_write(pcb=200071fc, data=2000b2e4, len=44, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000b2e4, len=44, flags=0, apiflags=0) tcp_enqueue: queueing 1071534:1071578 (0x0) tcp_output_segment: 1071534:1071578 tcp_output: nothing to send (00000000) tcp_write(pcb=200071fc, data=2000b31c, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000b31c, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1071578:1072602 (0x0) tcp_enqueue: queueing 1072602:1073626 (0x0) tcp_output_segment: 1071578:1072602 tcp_output_segment: 1072602:1073626 tcp_write(pcb=200071fc, data=2000bb1c, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000bb1c, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1073626:1074650 (0x0) tcp_enqueue: queueing 1074650:1075674 (0x0) tcp_output_segment: 1073626:1074650 tcp_output_segment: 1074650:1075674 tcp_write(pcb=200071fc, data=2000c31c, len=1024, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000c31c, len=1024, flags=0, apiflags=0) tcp_enqueue: queueing 1075674:1076698 (0x0) tcp_output_segment: 1075674:1076698 tcp_output: nothing to send (00000000) tcp_output_segment: 1074650:1075674 tcp_write(pcb=200071fc, data=2000c71c, len=0, apiflags=0) tcp_write(pcb=200071fc, data=2000c71c, len=2048, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000c71c, len=2048, flags=0, apiflags=0) tcp_enqueue: queueing 1076698:1077722 (0x0) tcp_enqueue: queueing 1077722:1078746 (0x0) tcp_output_segment: 1076698:1077722 tcp_output_segment: 1077722:1078746 tcp_write(pcb=200071fc, data=2000cf1c, len=1068, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000cf1c, len=1068, flags=0, apiflags=0) tcp_enqueue: queueing 1078746:1079770 (0x0) tcp_enqueue: queueing 1079770:1079814 (0x0) tcp_output_segment: 1078746:1079770 tcp_output_segment: 1079770:1079814 TCP thread miss segnumb: 130 31. Time: 201210 tcp_write(pcb=200071fc, data=2000b31c, len=980, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000b31c, len=980, flags=0, apiflags=0) tcp_enqueue: too long queue 4 (max 4) tcp_output: nothing to send (00000000) tcp_write(pcb=200071fc, data=2000b31c, len=2004, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000b31c, len=2004, flags=0, apiflags=0) tcp_enqueue: queueing 1079814:1080838 (0x0) tcp_enqueue: queue too long 6 (4) tcp_output: nothing to send (00000000) tcp_output_segment: 1079770:1079814 tcp_write(pcb=200071fc, data=2000b31c, len=2004, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000b31c, len=2004, flags=0, apiflags=0) tcp_enqueue: queueing 1079814:1080838 (0x0) tcp_enqueue: queue too long 6 (4) tcp_output: nothing to send (00000000) tcp_output: nothing to send (00000000) tcp_write(pcb=200071fc, data=2000b31c, len=2004, apiflags=0) tcp_enqueue(pcb=200071fc, arg=2000b31c, len=2004, flags=0, apiflags=0) tcp_enqueue: queueing 1079814:1080838 (0x0) tcp_enqueue: queue too long 6 (4)
bernard
2011-02-27
这家伙很懒,什么也没写!
最后出了问题,设备还能ping通吗?如果不能ping通,那么基本上就是驱动的问题了。
wunihaoo
2011-03-02
这家伙很懒,什么也没写!
>最后出了问题,设备还能ping通吗?如果不能ping通,那么基本上就是驱动的问题了。 --- ping不通了,基本每次死掉都是出现这个错误,而且lwip_close(sock)之后重新连接也连不上。我也觉得是驱动问题,因为用DM9000a就不会出现这样的问题。那是驱动什么地方问题呢?
bernard
2011-03-02
这家伙很懒,什么也没写!
[s:186] 最有可能是中断的问题,因为enc28j60是很久以前写的驱动了,手头也没现成的板子,所以难免有些问题。
撰写答案
登录
注册新账号
关注者
0
被浏览
5.4k
关于作者
wunihaoo
这家伙很懒,什么也没写!
提问
6
回答
5
被采纳
0
关注TA
发私信
相关问题
1
有关动态模块加载的一篇论文
2
最近的调程序总结
3
晕掉了,这么久都不见layer2的踪影啊
4
继续K9ii的历程
5
[GUI相关] FreeType 2
6
[GUI相关]嵌入式系统中文输入法的设计
7
20081101 RT-Thread开发者聚会总结
8
嵌入式系统基础
9
linux2.4.19在at91rm9200 上的寄存器设置
10
[转]基于嵌入式Linux的通用触摸屏校准程序
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
机器人操作系统 (ROS2) 和 RT-Thread 通信
4
五分钟玩转RT-Thread新社区
5
国产MCU移植系列教程汇总,欢迎查看!
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
musb移植问题记录【设备注册3次挂起】
2
关于使用CherryUSB时候使用外挂的usb phy 芯片配置的一点注意事项
3
【Vision Board 创客营】Vision Board上的ADC实践
4
FRDM-MCXN947 & RT-Thread的CAN实践——控制GM6020云台电机
5
[Vision Board创客营]WDT实践之配置、issue、PR一条龙
热门标签
RT-Thread Studio
串口
LWIP
Env
SPI
Bootloader
AT
ART-Pi
CAN总线
Hardfault
FinSH
USB
文件系统
RT-Thread
DMA
SCons
线程
RT-Thread Nano
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
ota在线升级
WIZnet_W5500
I2C_IIC
UART
flash
cubemx
packages_软件包
freemodbus
潘多拉开发板_Pandora
PWM
定时器
ADC
BSP
中断
keil_MDK
编译报错
socket
MicroPython
GD32
msh
Debug
ulog
SDIO总线
SFUD
rt_mq_消息队列_msg_queue
C++_cpp
本月问答贡献
xiaorui
7
个答案
3
次被采纳
sakumisu
4
个答案
3
次被采纳
三世执戟
31
个答案
1
次被采纳
梦笑真美
18
个答案
1
次被采纳
踩姑娘的小蘑菇
14
个答案
1
次被采纳
本月文章贡献
Z_Y
2
篇文章
5
次点赞
Alipay
2
篇文章
3
次点赞
2345vor
2
篇文章
1
次点赞
比特饼干
1
篇文章
6
次点赞
Lu_盼盼
1
篇文章
3
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部