cancel
Showing results for 
Search instead for 
Did you mean: 

STM3240G-EVAL lwip FreeRTOS

whwong84
Associate II
Posted on November 21, 2014 at 09:01

Hi guys,

Currently I am working on the lwip application on STM3240G-Eval. I am planning to use the FreeRTOS with lwip. But I found out that lwip with FreeRTOS integration is not as stable as I thought. The ethernet link would be broken after a certain point of time. Sometime it happened immediately after the system reset, and sometime it happened after running for half and hour. I am pinging the target and running the STM32F2x7TASKS.html on browser. The project I have been using for this test is LwIP_HTTP_Server_Socket_RTOS.

This scenario is not happened LwIP_HTTP_Server_Raw.

Any idea??

#stm32 #lwip #freertos
2 REPLIES 2
whwong84
Associate II
Posted on November 24, 2014 at 02:22

Hi Guys,

I tried to dig deep and find the root cause. It turns up that there's a difference between lwip with RTOS and lwip without RTOS. The latter uses polling method, while the other uses interrupt approach. It seems that after awhile, the ethernet interrupt is not captured by the MCU. Would it be a bug in the library??

I have changed from interrupt approach to polling approach to test whether the system become more stable. Keep you guys updated.

Regards,

WH Wong

Oussema Hajjem_O
Associate III
Posted on December 19, 2014 at 16:20

Hello,

Thie issue of masked Ethernet interrupts is fixed and will be available in the next release, you can fix it by replacing the ethernetif_input() function in ethernetif.c file by the following:

void ethernetif_input( void const * argument )

{

  struct pbuf *p;

  struct netif *netif = (struct netif *) argument;

 

  for( ;; )

  {

    if (osSemaphoreWait( s_xSemaphore, TIME_WAITING_FOR_INPUT)==osOK)

    {

      do

      {

        p = low_level_input( netif );

        if (p != NULL)

        {

          if (netif->input( p, netif) != ERR_OK )

          {

            pbuf_free(p);

          }

        }

      }while(p!=NULL);

    }

  }

}

I hope it will solve your problem.

Regards,

LEO