cancel
Showing results for 
Search instead for 
Did you mean: 

Degradation of UDP communication performance depending on STM32Cube FW H7 version (v1.11.1 to v1.11.2)

SungjunLee
Associate II

In STM32Cube FW_H7 version 1.11.1, UDP performance was normal, but in version 1.11.2, it fails to handle all transmitted and received packets. (STM32CubeMX Version 6.12.0)

Except for the STM32Cube H7 firmware version, all configurations and source code are identical.

 

- In STM32Cube FW_H7 version 1.11.1.

SungjunLee_2-1724736900985.png

SungjunLee_3-1724736961470.png

 

- In STM32Cube FW_H7 version 1.11.2.

SungjunLee_4-1724737111206.png

SungjunLee_5-1724737194472.png

 

The configuration (without RTOS) of my project is below.

SungjunLee_0-1724736409414.png

SungjunLee_1-1724736426738.png

SungjunLee_6-1724737408538.png

SungjunLee_7-1724737418088.png

 

How do I fix this? Should I use version 1.11.1 temporarily? Or will this issue be fixed in the future?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @SungjunLee ,

I tried with both version of cube Firmware with you test but I get the same result as the second screenshot you shared booth firmwares are around 135 as an average .

STea_0-1725277237157.png

Screenshot from 2024-09-02 12-34-26.png

I don't know exactly how this is calculated as i only have the executable but i would recommend you turning some known test version such as Iperf LWIP also make sure to check this fix related to the Ethernet driver and insure if it is applied on your firmware version.
update :
when changing the line 1212 of stm32h7xx_hal_eth.c as proposed by the github fixe i get better and stable performance :

    /* Set the tail pointer index */
    //tailidx = (descidx + 1U) % ETH_RX_DESC_CNT;
    tailidx = (ETH_RX_DESC_CNT + descidx - 1U) % ETH_RX_DESC_CNT;

STea_1-1725278446385.png

Regards

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
STea
ST Employee

Hello @SungjunLee ,

could you please share the location of the descriptors.
Are you sure you have the same configuration in relation to the linker file for example?
if you can share the linker file and the generated Ethernetif.c file of the two project it will help us more in the investigation of this issue.
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @STea .

Thank you for your reply.

 

I use one project and IDE I use is EWARM .

I just tested by changing H7 FW version from 1.11.1 to 1.11.2 and vice versa.

 

I share the linker file, the generated ethernetif.c file, and IOC file.

The generated linker files and ethernetif.c files are completely the same regardless of the FW version.

 

- stm32h743xx_flash.icf

/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__     = 0x08000000;
define symbol __ICFEDIT_region_ROM_end__       = 0x081FFFFF;
define symbol __ICFEDIT_region_RAM_start__     = 0x24000000;
define symbol __ICFEDIT_region_RAM_end__       = 0x2401FFFF;
define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ITCMRAM_end__   = 0x0000FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x3000;
define symbol __ICFEDIT_size_heap__   = 0x1000;
/**** End of ICF editor section. ###ICF###*/


define memory mem with size = 4G;
define region ROM_region      = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region      = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];
define region ITCMRAM_region  = mem:[from __ICFEDIT_region_ITCMRAM_start__ to __ICFEDIT_region_ITCMRAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in ROM_region   { readonly };
place in RAM_region   { readwrite,
                        block CSTACK, block HEAP };

 

- stm32h743xx_sram1.icf

/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x24000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__     = 0x24000000;
define symbol __ICFEDIT_region_ROM_end__       = 0x2403FFFF;
define symbol __ICFEDIT_region_RAM_start__     = 0x24040000;
define symbol __ICFEDIT_region_RAM_end__       = 0x2407FFFF;
define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000;
define symbol __ICFEDIT_region_ITCMRAM_end__   = 0x0000FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x3000;
define symbol __ICFEDIT_size_heap__   = 0x1000;
/**** End of ICF editor section. ###ICF###*/


define memory mem with size = 4G;
define region ROM_region      = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region      = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];
define region ITCMRAM_region  = mem:[from __ICFEDIT_region_ITCMRAM_start__ to __ICFEDIT_region_ITCMRAM_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in ROM_region   { readonly };
place in RAM_region   { readwrite,
                        block CSTACK, block HEAP };

 

STea
ST Employee

Hello @SungjunLee ,

can you share the project you used to test UDP performance as I'm running test with Iperf and I don't see a difference.
Regards 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @STea .

 

When you were testing, did you clean and rebuild the project?

In my case, I could see the same UDP performance when I simply built the code generated after changing the FW version from CubeMX. However, when I cleaned and rebuilt the project, I could see different performance.

 

I share the tested project and simulation program(PC side).

To use this simulation program, you have to change ip addresses by modifying DUAS_UdpTest.exe.config file of program and UDPComm.c file of the project.

 

I hope you can check this issue.

Hello @SungjunLee ,

I tried with both version of cube Firmware with you test but I get the same result as the second screenshot you shared booth firmwares are around 135 as an average .

STea_0-1725277237157.png

Screenshot from 2024-09-02 12-34-26.png

I don't know exactly how this is calculated as i only have the executable but i would recommend you turning some known test version such as Iperf LWIP also make sure to check this fix related to the Ethernet driver and insure if it is applied on your firmware version.
update :
when changing the line 1212 of stm32h7xx_hal_eth.c as proposed by the github fixe i get better and stable performance :

    /* Set the tail pointer index */
    //tailidx = (descidx + 1U) % ETH_RX_DESC_CNT;
    tailidx = (ETH_RX_DESC_CNT + descidx - 1U) % ETH_RX_DESC_CNT;

STea_1-1725278446385.png

Regards

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @STea .

Thank you for your answer.

 

I modified the part (line 1212 of stm32h7xx_hal_eth.c) as you suggested, tested and compared.

I got desired performance.

  • The result when the code is not modified
    SungjunLee_1-1725320724575.png

     

  • The result when the code is modified. 
    SungjunLee_2-1725320791236.png

     

 

Thank you again for your help.

However, It is really annoying to have to modify it every time I generate code with STM32CubeMX.

Of course, it is also possible to modify the driver itself in the repository, but I want to keep the original FW versions as is.

I hope they fix that in the next update.

Regards