I’m using FreeRTOS+UDP stack and I have encountered two problems (maybe connected).
As the subject says one of them is freeing already free buffer. I’m using BufferAllocation_1 and zero copy principle. Buffer is taken in the defferedRxTask by the function pxNetworkBufferGet() swapped with the buffer from the rx descriptor and propagated to the IP stack trough xNetworkEventQueue. On the other side, I’m using FreeRTOS_select() and FreeRTOS_recvfrom() to get data from the socket. The only place where I’m freeing buffers (execpt the frees caused by IP stack) is after getting data from a socket. And every now and then configASSERT( xListItemAlreadyInFreeList == pdFALSE ); in the vNetworkBufferRelease() called after receiving data from a socket fails. Looks like problem occurs only in high ethernet traffic conditions.
Trying to debug that I have encountered another problem and that is configASSERT( ( listCURRENT_LIST_LENGTH( &( pxSocket->xWaitingPacketsList ) ) > 0U ) ); in the FreeRTOS_recvfrom(); waitingPacketSemaphore has been successfully obtained but the socket list was actually empty…
I don’t know if two problems are connected but I’m having really hard time dealing with them.
Has anyone had similar experience or idea how to deal with it?
I’m using STM32F207 uC.