I have a problem in xQueueGenericReceive : I’m using FreeRTOS 5.0.2 with the lwip layer (1.3.0) for TCP/IP, and wanted to use the mem_malloc function of lwip because that function is able to reassemble freed memory blocs (I have some problems due to the absence of that functionality with the heap2.c management).
The problem is: depending on which type of heap memory allocation I use, on a particularly fast TCP/IP connection from a web browser (there are 15 files referenced in the first index.html), the vTaskPlaceOnEventList() function is called twice in the same loop (do while ( xReturn == queueERRONEOUS_UNBLOCK ), not everytime.
This leads to a hang situation in vListInsert, as noticed by a recent topic from Szymansk on the forum, since the function tries to insert the same item twice in the list and there is no test on that situation in vListInsert.
My question is : why does the queueReceive function loop twice in a particular situation ? the queue is empty, the timeout is not elapsed, and the xReturn status is set to queueERRONEOUS_UNBLOCK before the ending while.
when using heap2.c for heap management, this does not happen. There is only one call to vTaskPlaceOnEventList(). But it’s not easy to debug, since there are calls to taskYIELD() into the function.
maybe one or the other heap management system is more or less fast than the other ?
Please can somebody help …