Skip to main content
Jun 5, 2023 10:52 AM UTC
Question

STM32H7 with Ethernet and LwIP stack working - What is the need for FreeRTOS?

Both example and KB article depends on FreeRTOS.

Is there any real need to use FreeRTOS? In past I used LwIP without FreeRTOS just calling MX_LWIP_Process(). What do I need to do to get rid of FreeRTOS, is it enough to just disable it in STM32CubeMX and disable Ethernet Global Interript? I am afraid I run into some kind of Ethernet driver hidden problem.

This topic has been closed for replies.

5 replies

Pavel A.
Jun 5, 2023 12:17 PM UTC

If I remember correctly, after the last "rework" the HAL ETH driver should be used only with the interrupt. Polling variant of RX/TX functions (without _IT) has some issues.

Jun 5, 2023 12:17 PM UTC

Just tried to turn off "FreeRTOS": (FreeRTOS -> Interface: Disable) in STM32CubeMX.

Generated code doesn't even compile.

Is it even meant to run STM32H7 LwIp without FreeRTOS?

Pavel A.
Jun 5, 2023 1:06 PM UTC

Yes, LwIP can be used without FreeRTOS and in Cube firmware packages there are ETH examples without FreeRTOS.

Jun 5, 2023 12:49 PM UTC

Pavel A. thank you.

I started with "just-worked" (ping worked ok) FreeRTOS + LwIP project

(CubeIDE 1.12.1, CubeMX Version: 6.8.1-RC4 Build: 20230419-1431)

  1. Re-enabled interrupt,
  2. Removed Tim allocated for FreeRTOS to SysTick use.
  3. Removed sync/lock code bodies (code depends on FreeRTOS sync primitives)

void sys_lock_tcpip_core(void){}

void sys_unlock_tcpip_core(void){}

void sys_check_core_locking(void){}

void sys_mark_tcpip_thread(void){}

3) Added MX_LWIP_Process() in main loop...

No ping in result. For now.

Compared both codebases, looked for "ETH_CODE"... nothing suspicious... seems need to double-check entire Piranha list (?)...

Year ago I just ignored "modern reworked drivers" for Stm32F4 using CubeMX 6.4.0 with STM32Cube_FW_F4_V1.26.2

it all worked ok.

In which version for H7 eth HAL driver breaked?

Pavel A.
Jun 5, 2023 2:08 PM UTC

Unfortunately all new STM32H7 examples at https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/ use FreeRTOS.

The first H7 library release after "rework" is 1.10.0.