It looks, that not defined UDP
bufs.
In your lwipopts.h commented
out:
//#define
LWIP_UDP
1
#define
LWIP_UDP
1
//#define
MEMP_NUM_UDP_PCB
4
#define
MEMP_NUM_UDP_PCB
5
Need uncomment ---------- ARP options
----------
You not using tcp, so comment
#define
LWIP_TCP
0
#define
MEMP_NUM_TCP_PCB
0// default is 5
Read opt.h for more information...
----- Original Message -----
Sent: Friday, September 20, 2013 8:07
PM
Subject: Re: [lwip-users] lwip bind
fail
Thanks,
It's my misunderstanding. Telnet doesn't let me
check if UDP Server's IP port is alive. Anyhow, I can't still
figure the main problem out. Why is lwip_socket() not
working? socket_fd = lwip_socket(AF_INET, SOCK_DGRAM, 0) always return
-1. I put a debugging codes to see get a connection in
lwip_socket() in sockets.c if (!conn) {
DisplayString(115, 180 - 10, "
ENOBUFS (could not create netconn) ");
LWIP_DEBUGF(SOCKETS_DEBUG, ("-1 / ENOBUFS (could not create
netconn)\n")); set_errno(ENOBUFS);
return -1; } and display " ENOBUFS...." on
LCD.
lwip_socket_init() is called in different task, which is
lwip_task, and listener task sets up socket and receives
packets.
lwip_task init lwip and calls
lwip_socket_init()
// Initialize
lwIP. //
//get client
IP and use it to set up socket later on
lwIPInit(pucMAC, 0, 0, 0,
IPADDR_USE_DHCP);
// // Setup the remaining services inside the TCP/IP
thread's context. // tcpip_callback(SetupServices, 0);//
lwip_socket_init() is called in
SetupServices().
I was suspicious
about lwipopts.h, so kept changing definition and tested to see if I missed
one of definition in the header file. However, it still doesn't
work.
I attached my
lwipopts.h.
Thanks, Jin
_______________________________________________ lwip-users mailing
list address@hidden https://lists.nongnu.org/mailman/listinfo/lwip-users
|