STM32H5 HAL_ETH_Transmit_IT() causes tcp retransmissions in ST example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-25 6:25 AM
Hi all,
during testing a custom project with NETXDUO on NUCLEO-H563ZI I've noticed that sometimes web server response is rather slow.
Wireshark shows rather frequent TCP retransmissions and other problems.
To be sure, I've tried an example from ST (Nx_Iperf) with the same result.
It seems that problem is in ETH_Prepare_Tx_Descriptors(), in check of Tx Descriptor:
/* Current Tx Descriptor Owned by DMA: cannot be used by the application */
if ((READ_BIT(dmatxdesc->DESC3, ETH_DMATXNDESCWBF_OWN) == ETH_DMATXNDESCWBF_OWN)
|| (dmatxdesclist->PacketAddress[descidx] != NULL))
{
return HAL_ETH_ERROR_BUSY;
}
I removed this check and TCP retransmissions became much less frequent.
Is there a better solution?
Solved! Go to Solution.
- Labels:
-
Ethernet
-
STM32H5 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-29 2:12 AM
For everyone who curious following settings have fixed TCP transmissions for me:
ETH_TX_DESC_CNT=8
NX_WEB_HTTP_SERVER_SESSION_MAX=4
NX_WEB_HTTP_SERVER_MAX_PENDING=8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-06 9:38 AM
Hello @sssooo,
Thank you for your reply,
The Owned Tx Descriptor check indicates that a packet is already associated with the descriptor, making it unavailable for reuse by the application. This check ensures that the application does not modify or use a descriptor currently being processed by the DMA or linked to an unprocessed packet.
Although removing this check might improve performance, it may not be a sustainable solution and risks data corruption.
We are analyzing the root cause of these retransmissions internally and will keep you updated.
With Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-29 2:12 AM
For everyone who curious following settings have fixed TCP transmissions for me:
ETH_TX_DESC_CNT=8
NX_WEB_HTTP_SERVER_SESSION_MAX=4
NX_WEB_HTTP_SERVER_MAX_PENDING=8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-29 3:36 AM
Hello @sssooo
just to add few points based on our internal conversation, so other users can see it.
The ETH_TX_DESC_CNT will reduce the re-transmission due to no TX DMA descriptors being available to send packets.
The HTTP settings affect how much TCP connections can be opened at the same time. Web browsers will typically open several TCP connections with the server. When additional TCP connection can't be established the client will try to retransmit the request to open the TCP connection.
At the end it is tradeoff between performance and memory allocated to TCP / HTTP stack.
