Skip to main content
Graduate II
March 11, 2024
Solved

Move LWIP from barebone to FreeRTOS

  • March 11, 2024
  • 1 reply
  • 1338 views

Hi,

I'm able to configure LWIP with my Nucleo-F439 board so that it responds to pings as expected. I however want to be able to transport some useful information to a socket (telnet or similar) and I want to use FreeeRTOS for that. I however am unable to get it working, in my Default Task, it always gets stuck in MX_LWIP_Init(), in particular here:

#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )

{

configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );

}

#endif

which appears to be an issue with the clock config. I duplicated my clock configuration from the working barebones appliaction 1:1 but it still doesn't appear to work.

The GPIO config looks to be correct too. What else might I be missing?

    This topic has been closed for replies.
    Best answer by STea

    Hello @debug 

    When using an RTOS, the RTOS is configured by default to use the SysTick timer for managing the timing of its threads. Since the default configuration for the HAL libraries is to also use the SysTick for its timing operations, we need to change the timebase for the system so that only FreeRTOS uses the SysTick. this can be done using cubeMX . you can also find a working example with LWIP FreeRTOS in this link which correctly configures the Clock sources for both HAL and FreeRTOS.

    BR

    1 reply

    STeaAnswer
    ST Employee
    March 13, 2024

    Hello @debug 

    When using an RTOS, the RTOS is configured by default to use the SysTick timer for managing the timing of its threads. Since the default configuration for the HAL libraries is to also use the SysTick for its timing operations, we need to change the timebase for the system so that only FreeRTOS uses the SysTick. this can be done using cubeMX . you can also find a working example with LWIP FreeRTOS in this link which correctly configures the Clock sources for both HAL and FreeRTOS.

    BR