Hello, I am running into a very unexpected issue on a custom board with a SAME70 microcontroller running FreeRTOS and FreeRTOS-Plus. The microcontroller is in constant communication with the PC sending and receiving real-time data. I am sending data at about a 1500 Hz rate and receiving data at about 500 Hz and the processing time for the data is very small as well, all very manageable.
After running for a few seconds up to 15 minutes, the transmit portion of the TCP/IP stack comes down because there aren’t any
xTXDescriptorSemaphore left. I found this out by looking at the global diagnostic variable
tx_release_count and noticed that
tx_release_count keeps incrementing after a while.
Looking around, the only information I found on
tx_release_count is here (I posted my question a couple of days ago but that thread is a few years old).
I was able to modify my ASF libraries to work with the FreeRTOS-Plus-TCP DriverSAM library which includes: gmac_SAM.c, gmac_SAM.h, and NetworkInterface.c. I mention this because that is where
tx_release_count++ is happening, nowhere else except here. I tried tracing the descriptor but it’s very difficult because everything will run as expected for some amount of time before buffer descriptors start getting lost(?) and eventually there’s none left.
Once it gets to this state, I am still able to receieve data, process it, and when I go to send it, this is where the data gets lost and never makes it to the GMAC driver.
Anyone has any ideas why these semaphores are getting lost somewhere? It’s like when the stack is overwhelmed or getting close to full capacity buffer descriptors don’t get released. I’m at a loss here. Any input is very much appreciated. Thanks.