2024-08-26 10:47 PM - last edited on 2024-08-30 02:08 AM by SofLit
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.
- In STM32Cube FW_H7 version 1.11.2.
The configuration (without RTOS) of my project is below.
How do I fix this? Should I use version 1.11.1 temporarily? Or will this issue be fixed in the future?
Solved! Go to Solution.
2024-09-02 04:44 AM - edited 2024-09-02 05:02 AM
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 .
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;
Regards
2024-08-28 04:37 AM
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
2024-08-28 06:31 PM
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 };
2024-08-29 02:36 AM
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
2024-08-29 05:50 PM
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.
2024-09-02 04:44 AM - edited 2024-09-02 05:02 AM
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 .
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;
Regards
2024-09-02 04:55 PM - edited 2024-09-02 06:38 PM
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.
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