Skip to main content
Visitor II
August 30, 2022
Question

Ethernet communication - mx_lwip_process() how often

  • August 30, 2022
  • 2 replies
  • 2036 views

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!!

    This topic has been closed for replies.

    2 replies

    Explorer
    August 30, 2022

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

    Graduate II
    September 4, 2022

    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.