cancel
Showing results for 
Search instead for 
Did you mean: 

Ethernet communication - mx_lwip_process() how often

ACohe.3
Associate II

Hi everyone,

I am using STM32f429, and I am using Ethernet communication.

Inside the while(1) has the mx_lwip_process() function and I am using the function every while, and I found this function takes a lot of time, so I would like to know how often I need to use this function?

for example:

int LoopDivisor=0;

while (TRUE){

// The rest of my code

if (LoopDivisor%100==0){

MX_LWIP_Process();

LoopDivisor=0;

}

LoopDivisor++;

}

In this situation I still have ping.

Thanks for the helpers!!

2 REPLIES 2
DPatr.2
Associate III

Look into using FreeRTOS with LWIP, you can have a thread dealing with all Ethernet communication while another thread is dealing with your application.

Piranha
Chief II

The low_level_input() function must be called and packets passed to lwIP whenever and as long as there are new packets received, which are still not processed. In addition without RTOS the sys_check_timeouts() function must be called every 50 ms. This particular time period is not mandatory, but this value is a perfect fit for all protocols and lwIP modules with default time intervals.