lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] shared struct netconn


From: Martin Velek
Subject: [lwip-users] shared struct netconn
Date: Tue, 6 Oct 2009 13:08:06 +0200

Hello,

has anyone experience with using one netconn structure  for:
- waiting for data in one task and
- sending data in the second?

It sometimes works but sometimes the program ends in a critical
handler(Cortex-M3 chip). This error is very hard to trace a I cannot
find out why.

lwip 1.3.1, rtos FreeRTOS, Lm3s9b92.

Thank you,
Martin

// Simple example
static struct netconn * sharedNetconn;

void TASK1(void * param)
{
 struct netbuf * sendUDPNetBuf;
 while(1){
    // create and fill netbuf
    WAIT(500MS);
     netconn_sendto(sharedNetconn,sendUDPNetBuf,....);
 }
}

void TASK2(void * param)
{
struct netbuf * receiveUDPNetBuf;
 sharedNetconn = netconn_new();
 // other init stuff

 while(1)
 {
  receiveUDPNetBuf = netconn_recv(sharedNetconn );
  netbuf_delete(receiveUDPNetBuf);
 }
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]