Skip to main content
Visitor II
April 25, 2025
Solved

STM32H5 HAL_ETH_Transmit_IT() causes tcp retransmissions in ST example

  • April 25, 2025
  • 3 replies
  • 560 views

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.

2025-04-25_16-10-06.png

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?

    This topic has been closed for replies.
    Best answer by sssooo

    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

    3 replies

    ST Employee
    May 6, 2025

    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,

    sssoooAuthorAnswer
    Visitor II
    May 29, 2025

    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

    ST Employee
    May 29, 2025

    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.