Skip to main content
Arman Ilmak
Senior
Oct 23, 2023 9:31 AM UTC
Question

LWIP Free RTOS Problem

Hi.

I have a problem while using lwip and freertos.

The board is based on stm32h743vih.

The mpu configuration is done correctly i think.

My problem is after i start udp server and start to send data with udp, everything is ok, but after a while i will enter a loop in xQueueSemaphoreTake an in the configASSERT( pxQueue->uxItemSize == 0 ).

I searched a lot and i saw this:

https://community.st.com/t5/stm32cubemx-mcus/cubemx-lwip-ethernet-link-thread-bug/m-p/126556

I did what it said but this time when it happens im not in the loop but the other tasks get very slow and actually a task with osdelay(1) is executing every 1 second.

What should i do?

This topic has been closed for replies.

8 replies

KDJEM.1
ST Technical Moderator
Oct 25, 2023 8:59 AM UTC

Hello @Arman Ilmak ,

Could you please check the MPU and LWIP configurations, for that I recommend you to take a look to How to create project for STM32H7 with Ethernet an... - STMicroelectronics Community

Also, I advise you to start with an available example. I think this example can help you STM32H7-LwIP-Examples/STM32H743_Nucleo_ETH at main · stm32-hotspot/STM32H7-LwIP-Examples · GitHub.

I hope this help you to solve your issue.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
Arman Ilmak
Senior
Oct 30, 2023 12:18 PM UTC

Ive done exact the same configuration.

But i see odd behavior.

When i config only eth with rtos and lwip i see hardfault.

But with the same eth configuration and just enabling uart (no other action just hal will call uart init)

i dont see hardfault and everything work fine.

Im really confused.

Explorer
Dec 30, 2023 5:46 AM UTC

@KDJEM.1  

The same goes with Github example codes as they fail with Freertos tasks stuck

 

GreatEel21st_1-1703915157431.png

 

Associate
Oct 8, 2024 2:45 AM UTC

I'm also having this issue with my STM32H725ZGT6, but not my STM32H723 Nucleo board, does anyone have any updates on this issue?

 

KDJEM.1
ST Technical Moderator
Oct 8, 2024 3:00 PM UTC

Hello @jackmh and welcome to the Community,

 

Could you please share FreeRTOSConfig.h file?  

Are you use FreeRTOS with CMSIS_V1 or CMSIS_V2?

Could you please create a dedicated thread with a detailed description for your issue.

 

Thank you.

Kaouthar

 

 

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
Associate
Oct 28, 2024 1:38 AM UTC

Sorry for the delayed response, it turned out to simply be not giving the default task enough memory. 512+ Words seems to be needed.

 

KShim.1738
Associate III
Mar 16, 2025 10:14 AM UTC

I'm using STM32F746ZG-nucleo board and CubeMX 6.14.0.

Besides the stack size for Default Task, I needed to increase the stack size for ethernetif_input() task. The stack size for ethernetif_input is 350 and it overwrote the Tx semaphore which was created from heap memory.

In FreeRTOS, semaphore is implemented using queue with no payload. So it gives an error as the following.

configASSERT( pxQueue->uxItemSize == 0 ).

Associate II
Jul 3, 2025 9:37 AM UTC

@KDJEM.1, can above KShim's solution be added to next version of CubeMX package? Just spent 2 days trying to figure out what the issue is on STM32F4. What is worse there is no parameter INTERFACE_THREAD_STACK_SIZE exposed in CubeMX to be configured, and it is easily going unnoticed. I believe this is the problem for anyone trying to set up ETH on STM32 since even code that I ported from basic example was failing.