lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] ICMP sporadic answer after some time


From: Sergio R. Caprile
Subject: Re: [lwip-users] ICMP sporadic answer after some time
Date: Mon, 6 Feb 2017 15:31:40 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

http://lwip.wikia.com/wiki/Writing_a_device_driver

You have to peek in your driver when it calls netif->input
(function pointer passed on netif add)
Wether you call ethernet_input or ip_input depends on your driver: the flags it sets, it removes link layer info or not. Common behavior for ethernet in 1.4.1 is to not remove link-layer stuff and pass the frame to ethernet_input (ALWAYS by calling netif->input)

ethernet_task(), if it exists, is not lwIP code. Check your driver vendor.

Be advised not to play calling from main or interrupts, do yourself (and everyone here trying to help) a favor and call lwIP functions from a single context. It _might_ work now, but you _will_ be in trouble sooner or later.

I still think your driver is missing frames.
A common fault is to get only the first outstanding frame when handling a receive interrupt (which has to either signal de main loop or put the frame in a queue, but NOT call the stack unless there are no other callers on the main loop). As soon as there are more than one frame arriving within the service loop window, one of them gets lost, or if the chip has enough memory, delayed.




reply via email to

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