Wednesday, May 11, 2022

STM32F7, LWIP, FreeRTOS Error stopping on configASSERT( pxQueue->uxItemSize == 0 );

There is an unclear bug spotted recently in STM32F7 with FreeRTOS v2 and LWIP (ver. 2.1) library.

After a moment of using ethernet socket data stream soft hangs at this line: 

configASSERT( pxQueue->uxItemSize == 0 );

It seems related to semaphore/mutex internal code issue. Could not find chance to dig too deep into it, but this post gave me a good hint:

https://forums.freertos.org/t/xsemaphoretake-function-looping-at-configassert-pxqueue-uxitemsize-0/8116 

I made the similar approach and made semaphore statically defined:

osSemaphoreId Netif_LinkSemaphore = NULL;

in the same lwip.c file.

So far it seemed to help with above problem.

Regarding other different issues with STM32 ethernet communication there is a nice compilation which might help us all:

https://community.st.com/s/question/0D50X0000BOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32