[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Problem with sending UDP packets in LwIP & FreeRTOS
From: |
bachehkaraji |
Subject: |
[lwip-users] Problem with sending UDP packets in LwIP & FreeRTOS |
Date: |
Wed, 18 Jan 2017 04:34:45 -0700 (MST) |
Hello
I work on a project which use FreeRTOS and Lwip v 1.4.1. I'm using a
LandTiger board which is made on an NXP LPC1768. My project is based on
LPCOpen 2.10 and derivated from the “lwip_tcpecho_freertos” example. I'm
only using the Socket API.
In TCP, everything is OK! but in UDP doesn't...
I modified the “lwip_tcpecho_freertos” example to send UDP packets to my PC.
I have the problem that lwip_sendto stops working after sending one packet.
/* Send some data on a RAW or UDP pcb contained in a netconn
* Called from netconn_send */
void
do_send(struct api_msg_msg *msg)
{
if (ERR_IS_FATAL(msg->conn->last_err)) {
msg->err = msg->conn->last_err;
} else {
...
}
TCPIP_APIMSG_ACK(msg);
}
lwip_sendto calls netconn_send, which calls tcpip_apimsg, which returns an
error.
...lwip_write -> lwip_send -> lwip_sendto -> netconn_send -> do_send ->
tcpip_apimsg...
err_t
tcpip_apimsg(struct api_msg *apimsg)
{
struct tcpip_msg msg;
#ifdef LWIP_DEBUG
/* catch functions that don't set err */
apimsg->msg.err = ERR_VAL;
#endif
if (sys_mbox_valid(&mbox)) {
msg.type = TCPIP_MSG_API;
msg.msg.apimsg = apimsg;
sys_mbox_post(&mbox, &msg);
sys_arch_sem_wait(&apimsg->msg.conn->op_completed, 0);
return apimsg->msg.err;
}
return ERR_VAL;
}
As the problem occurs, The Ping keeps working normaly.
If you have any idea, it'll be great as i'm really stuck on this problem
Bacheh Karaji
--
View this message in context:
http://lwip.100.n7.nabble.com/Problem-with-sending-UDP-packets-in-LwIP-FreeRTOS-tp28403.html
Sent from the lwip-users mailing list archive at Nabble.com.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] Problem with sending UDP packets in LwIP & FreeRTOS,
bachehkaraji <=