lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Problem with do_writemore() + LWIP for AVR32


From: Simon Goldschmidt
Subject: Re: [lwip-users] Problem with do_writemore() + LWIP for AVR32
Date: Thu, 10 Dec 2009 10:41:25 +0100

Ehrm, sending this once is enough ;-)

> >From this lwIP init,
>  /*!
>  *  \brief start lwIP layer.
>  */
> static void prvlwIPInit( void )
> {
>   sys_sem_t sem;
> 
> 
>   sem = sys_sem_new(0); // Create a new semaphore.
>   tcpip_init(tcpip_init_done, &sem);
>   sys_sem_wait(sem);    // Block until the lwIP stack is initialized.
>   sys_sem_free(sem);    // Free the semaphore.
> 
>   /* Set hw and IP parameters, initialize MACB too */
>   prvEthernetConfigureInterface(NULL);

The above line leads to calling netif_add() from another thread than 
tcpip_thread! This is not supported! Instead, call 
'prvEthernetConfigureInterface()' from inside 'tcpip_init_done'.

The rest of the code looks OK. By setting tcpip_input as input function, RX 
packets get queued into the tcpip_thread before actually being processed. There 
is one more chance of an error here:

Your ethernet driver has to pass RX pbufs to netif->input() (which actually is 
a pointer to tcpip_input). Some lwIP ports/netif drivers do this wrong and call 
ethernet_input() directly. In this case, RX packets are processed in the wrong 
thread.

To verify this, could you send the part of your ethernet driver that passes 
received pbufs into the stack?

Simon
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01




reply via email to

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