Skip to main content
Visitor II
March 12, 2021
Question

Stm32h7 Lwip - Slow Communication Problem

  • March 12, 2021
  • 5 replies
  • 2143 views

Hello, I'm using ST32H743ZI2 nucleo board as TCP client. When I setup the ethernet configuration/initialization, I considered the https://community.st.com/s/article/How-to-create-project-for-STM32H7-with-Ethernet-and-LwIP-stack-working article.

Additionally, I'm using Lwip Raw Api, I do not use Rtos.

My program is working, I can connect the server, I can communicate with the server, there is no problem. But communication speed is very slow. When I transmit data, which lengths about 30 bytes, from server to client, which is my nucleo board, in 1 ms period, it can not catch the data at time. When the period about 50ms there is no problem. And also I'm in trouble in transmitting packet from my board. It is also slow. By the way, pinging to board, replied <1ms.

I checked some questions in the forum, I tried something but I could not handle the solution.

Thanks a lot.

    This topic has been closed for replies.

    5 replies

    Explorer
    March 12, 2021

    Have you tried a clean network, with only the host and the nucleo board connected ?

    Otherwise, your firmware needs to sort through all sorts of packages milling around in an office network.

    Ey.1Author
    Visitor II
    March 12, 2021

    Yes, I'm not connected the office network etc. Connection is only between the nucleo and my computer.

    Ey.1Author
    Visitor II
    March 12, 2021

    Additional info: I'm not sending queued way. I'm just transmitting data what i want to transmit:

    		err_ret = tcp_write(m_tcpPcbClient, p_data, len, TCP_WRITE_FLAG_COPY); // Queues up data to be sent.
    		if(err_ret == ERR_OK)
    		{
    			if(tcp_output(m_tcpPcbClient) != ERR_OK)			// Force to sent.
    				return 1;
    			else
    				return ERR_OK;
     }

    Length of data is constant, it is 30 bytes. But it can not force the sent in a true way, sometimes sends 500 bytes, sometimes 50 bytes. Sometimes err_ret returns as out of memory error. Like I said, my period 1ms. But If I do it 50 ms, it is transmitting perfectly.

    In receiving part I'm taking the data with callback function, but like i said, it can not take data what I send from host. As an example, when I transmit 50 packet from host with 1ms perdiod, it takes only 2 or 3 packet.

    Explorer
    March 12, 2021

    I am not familiar with the H7 nucleo and the respective LwIP port.

    I suppose profiling would help.

    Ey.1Author
    Visitor II
    March 15, 2021

    When nagle is disabled, most of problem is solved. But still sometimes sends 2-3 packet at once. This means that the host misses packets while parsing.