FreeRTOS+TCP STM32H7 UDP Ping Lockup RX Buffer Starvation

@htibosch

Looks like that trace is within the buffer allocator.

If you wanted to reproduce my findings, with no limits on the UDP socket, delay your receive task for a short period having bound the socket, allowing its queue to fill with packets from your python script.

Assuming you’re using buffer allocation scheme 1, the static pool. You’ll run out of rx buffers, triggering the bug.

Then receive all the packets from the queue, releasing the buffers back to the stack. I’d expect reception to continue.

You should see that pings don’t resume, nor does UDP reception.

I’ve essentially done the same in my little demo project, just using a button press to trigger the receive/release of buffers. Nucleo-H7_FreeRTOS_TCP/Src/main_freertos.c at f58d9957287f132cdfeff41b94ccfadad8895fe2 · pgreenland/Nucleo-H7_FreeRTOS_TCP · GitHub

@htibosch Wondering if you had a chance to investigate this further?. We’ve completed our project now and begin shipping units. My workaround is currently Retry RX buffer allocation on failure · pgreenland/FreeRTOS-Plus-TCP@d31d519 · GitHub as mentioned above. Was looking to mark this as the resolution for me. Would be good to contribute a more formal fix back to the project.

As an aside I also noticed a potential ARP issue in the STM32 ethernet driver. Will create a separate thread for that if I’m able to re-produce on the dev board project when I get a moment.

Thanks,

Phil