OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 5285|回复: 5

stm32 ucos 创建socket端口数

[复制链接]

3

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
108
金钱
108
注册时间
2012-11-27
在线时间
23 小时
发表于 2016-1-15 15:51:18 | 显示全部楼层 |阅读模式
2金钱
大家好:
     我用的是原子哥的lwip+ucos扩展例程(stm32f407zgt6),现在发现创建socket的时候最多只能创建4个,创建第五个的时候失败了,拜托大神提供帮助


最佳答案

查看完整内容[请看2#楼]

问题解决 #define NUM_SOCKETS MEMP_NUM_NETCONN define MEMP_NUM_NETCONN //原来是4改成5就行了
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

3

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
108
金钱
108
注册时间
2012-11-27
在线时间
23 小时
 楼主| 发表于 2016-1-15 15:51:19 | 显示全部楼层
问题解决
#define NUM_SOCKETS MEMP_NUM_NETCONN
define MEMP_NUM_NETCONN                //原来是4改成5就行了
回复

使用道具 举报

7

主题

75

帖子

1

精华

中级会员

Rank: 3Rank: 3

积分
401
金钱
401
注册时间
2012-12-30
在线时间
41 小时
发表于 2016-1-15 20:33:26 | 显示全部楼层
修改一下"lwip/opt.h"文件里的宏定义试试
/**
* MEMP_NUM_RAW_PCB: Number of raw connection PCBs
* (requires the LWIP_RAW option)
*/
#ifndef MEMP_NUM_RAW_PCB
#define MEMP_NUM_RAW_PCB                x
#endif

/**
* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#ifndef MEMP_NUM_UDP_PCB
#define MEMP_NUM_UDP_PCB                x
#endif

/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_PCB
#define MEMP_NUM_TCP_PCB                x
#endif

/**
* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_PCB_LISTEN
#define MEMP_NUM_TCP_PCB_LISTEN         x
#endif
回复

使用道具 举报

3

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
108
金钱
108
注册时间
2012-11-27
在线时间
23 小时
 楼主| 发表于 2016-1-18 16:36:54 | 显示全部楼层
lwipopts.h
#define SYS_LIGHTWEIGHT_PROT    1
#define NO_SYS                  0                 
#define MEM_ALIGNMENT           4                 
#define MEM_SIZE                16000        
#define MEMP_NUM_PBUF           20                
#define MEMP_NUM_UDP_PCB        10               
#define MEMP_NUM_TCP_PCB_LISTEN 15               
#define MEMP_NUM_TCP_SEG        20               
#define MEMP_NUM_SYS_TIMEOUT    15               


opt.h
/**
* MEMP_NUM_RAW_PCB: Number of raw connection PCBs
* (requires the LWIP_RAW option)
*/
#ifndef MEMP_NUM_RAW_PCB
#define MEMP_NUM_RAW_PCB                10
#endif

/**
* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#ifndef MEMP_NUM_UDP_PCB
#define MEMP_NUM_UDP_PCB              7
#endif

/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_PCB
#define MEMP_NUM_TCP_PCB                7
#endif

/**
* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_PCB_LISTEN
#define MEMP_NUM_TCP_PCB_LISTEN         10
#endif

/**
* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_SEG
#define MEMP_NUM_TCP_SEG                16
#endif


改完还是不行
回复

使用道具 举报

1

主题

18

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
200
金钱
200
注册时间
2016-1-5
在线时间
50 小时
发表于 2016-3-18 14:30:45 | 显示全部楼层
楼主问题解决了吗?
回复

使用道具 举报

3

主题

8

帖子

0

精华

初级会员

Rank: 2

积分
108
金钱
108
注册时间
2012-11-27
在线时间
23 小时
 楼主| 发表于 2016-3-21 08:51:32 | 显示全部楼层
解决了啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-8 05:26

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表