cancel
Showing results for 
Search instead for 
Did you mean: 

(Urgent)Inquiries about improving the response speed of device Ethernet communication

joseph05
Associate III

I am developing a device using the nucleo-f429zit6 evaluation board as a reference. This device has an Ethernet communication function, and the Ethernet communication function was tested by directly connecting this device to the server using a cross-Ethernet cable. Currently, after a command is delivered to the device from the server, the response from the device arrives at the server late. As an example, I checked the server's response to a ping command, and the initial response took about 2 seconds. I'd like to know how to improve this response so that it comes out quickly, within 1 second.

 

The current device's slow Ethernet communication response speed

image4.png

 

Below is the clock speed of the hardware used by the device, the firmware version currently being used, and the version of LwIP.

image3.pngimage1.pngimage2.png

13 REPLIES 13

Dear Piranha,

Thanks for your response

The development device uses stm32f429zit6 and the Ethernet function does not have a DMA function. What is unusual is that when I check the ping response from the CubeMX automatically generated code with the Ethernet function activated without user code, there is a about 1ms response.
However, after adding user code and operating the development device, the ping response time increases. The ping initial response time increases from about 0.4 seconds and remains at 1.0 seconds. The guess is that the development device may respond in 0.4 seconds, but it appears that some delay factor is accumulating. I am curious as to what causes this behavior.

 

Use only CubeMX automatically generated code

image1.png


Use CubeMX automatically generated code + User code

image2.png

 

Bob S
Principal

What in blazes is your code doing?????????

OK - more rational thoughts.  Check your interrupt priorities.  How much code do you have running in interrupt handlers?  Note that the HAL "callback" functions are called from the interrupt handlers.  Do you have other, blocking, HAL calls in these callbacks?  What about HAL_Delay() calls?

Are you using an RTOS?  If so, what tasks do you have that are higher priority than the Ethernet task?  I don't recall what RTOS priority the ethernet task runs at.

If no RTOS, then something in your main polling loop is starving the LwIP processing calls.

Start disabling portions of your "user" code until you find the culprit.

Thank you Dear Bob S and Piranha.

Specially, Thanks to Bob S for your advice . I would like to buy you a cup of coffee.

The software I am currently using on your device does not use an RTOS. It is configured to perform serial communication and Ethernet communication functions in a single loop. After removing HAL_Delay(1000), which was used to receive data in the serial communication receiver, the ping command response became 1ms during normal operation of the device, and the overall operation of the device became faster after modification(yellow box log in the attached picture). When the server responded after the required command, the ping response momentarily increased to 78~232ms and then returned to 1ms(red box log in the attached picture).

I am curious as to whether the instantaneous increase in ping response when a server command is something that needs to be improved.

 

Below is the result of the device's ping response after modifying the code.

 

image01.png

stm32h755zit6 dual core, M7 frequency 680Mhz and M4 frequency 240Mhz