2021-12-21 01:01 AM
Multiple feedbacks reported around Ethernet HAL driver and applications on STM32Cube FW have been acknowledged and analyzed. Many of them were related to RX packets management, to DMA management, or to overall performance. A summary list of tickets on GitHub and forum is provided below for reference.
We apologize for the time it took to provide an adapted solution. We are changing support model to provide more dynamic updates in the future (mainly leveraging GitHub mechanisms).
Today, based on the received feedbacks, the Ethernet HAL driver has been reworked to fix most known issues, enhance performance, and add some missing features.
The reworked Ethernet HAL driver (along with updated applications) is being deployed on STM32CubeH7, STM32CubeF4 and STM32CubeF7 FW packages.
Official publication dates are aligned with maintenance dates: 22Q1 for STM32H7 and STM32F4, and 22Q2 for STM32F7.
Before the official publication: the reworked Ethernet HAL driver and applications are shared on GitHub (https://github.com/STMicroelectronics/stm32h7xx_hal_driver/pull/16) in the form of a pull request, available for everyone for use and review. Feedbacks, comments, enhancements, and proposals are more than welcome.
After the official publication: more frequent updates are planned and will be anticipated on GitHub.
The reworked Ethernet HAL driver brings multiple changes and a compatibility break vs. legacy Ethernet HAL driver. Main changes are listed here:
The new Ethernet HAL driver is supported by STM32CubeMX release of 22Q1 on STM32H7 and STM32F4. Support on STM32F7 follow in 22Q2.
Since the new Ethernet HAL driver brings a compatibility break, existing projects using it shall be updated accordingly. A step-by-step guide for how to update existing projects is shared in this forum and soon in a dedicated Wiki page. A pull request on STM32H7 CubeFW LwIP projects is also provided here to show how modifications are done.
Also, users with existing projects, who don’t want or need to move to the new Ethernet HAL driver can keep their projects running by pointing to legacy driver that will be available in a dedicated folder in future STM32Cube FW packages.
We warmly thank community contributors, and especially @alister and @Piranha who did a great job synthesizing encountered issues and feedbacks. We keep looking for your feedbacks to continue enhancing and adapting for your needs.
General FAQ :
Detailed List of tickets:
Here below a list of main ticket that have been taken into consideration and fixed in the new Ethernet HAL driver and applications. Some of them come from community (very well summarized in a single post), some others are logged on GitHub, and others were logged on internal bug tracking system (the items without hyperlink):
81088 [ETH] RM0433 v6 faults and missing details on ETHERNET related sections
100608 [ETH]: Need to add new fields in the ETH_TxDescListTypeDef
79181 [STM32H7] ETH Ingress correction register
75481 Ticket 75481 - Ethernet PPS functionality clarification
62100 ARPEN support in Ethernet Driver
79615 Ethernet: Enable and handle the DMA
67970 Read Buffer Underflow interrupt
91624 SCB_InvalidateDCache_by_Addr alignment in ethernetif.c
97885 Question about CMSIS EMAC driver
100109 [HAL_ETH] By default MMC interrupt is not handled
83608 LWiP Interrupt and Through Put is Low
81685 [MW_LwIP] Can't ping device with mDNS feature
81312 Length value issue in HAL_ETH_GetReceivedFrame_IT
41452 MBED / Ethernet: inconsistent transmission issue
74243 Add LWIP examples for DISCO-H747I
48259 [ETH] Support of PTP feature in the driver
101731 [LwIP/ETH/MSP][ExamplesMX] Missing initialization to 0 for most local variables of
67276 Several bugs in ethernetif.c: giving back Rx descriptor to DMA before packet was processing by LWIP
91976 LWIP HAL project race condition
91624 SCB_InvalidateDCache_by_Addr alignment in ethernetif.c
108075 Ethernet not working with high AHB/APB2 divider
62100 ARPEN support in Ethernet Driver
67970 Ethernet: Enable and handle the DMA Read Buffer Underflow interrupt
104729 [GitHub] Wrong HSE_VALUE in NUCLEO-H743ZI LwIP_HTTP_Server_Netconn_RTOS application
101385 [ETH] Same issue as ticket 40298 but in STM32CubeH7 v1.8.0
101620 Support of MW_AzureRTOS and associated applications
63844 [LwIP License update] Update the Licenses (in readme and source files)
106013 [ETH] Ping max buffer size
108010 Ethernet HAL workaround against Ping Flood issue
108675 Ethernet erroneous data received in RMII configuration
108674 Ethernet erroneous data received in RMII configuration
108670 Ethernet erroneous data received in RMII configuration
Forum https://community.st.com/s/question/0D50X0000C6eNNSSQ2/bug-fixes-stm32h7-ethernetNetIPAnalysis.docx (including multiple forum tickets)
GitHub https://github.com/STMicroelectronics/cmsis_device_f7/pull/1
GitHub https://github.com/ARMmbed/mbed-os/issues/12459
GitHub https://github.com/STMicroelectronics/stm32h7xx_hal_driver/issues/8
GitHub https://github.com/STMicroelectronics/STM32CubeF4/issues/60
2022-01-11 05:55 AM
Hi @Pavel A. , Yes it is advised to use IT mode rather than polling mode for performance sake.
Some changes on the memory allocation have been done on projects in order to optimize footprint and grant bet possible performance. You can see these updates on GitHub projects.
Thanks a lot for your feedbacks.
Don't hesitate if you have more points or if my answers are not clear enough.
2022-01-11 05:57 AM
Hi @dradoicic , I removed from the document the information regarding NetXDuo because we are preparing a dedicated release soon with some modifications needed on the interface wrapper.
We'll try to provide the changes asap on GitHub, otherwise I will post the document containing NetXDuo changes guidelines.
2022-01-11 06:01 AM
Hi @Community member ,
STM32CubeH7 content is already available on GitHub (in what concerns ETH HAL updates) so you can get updates relative to HAL and to projects on these repos:
Otherwise, STM32CubeH7 will be available on st.com beginning of March 2022.
2022-01-11 11:47 AM
Thank you @MWB_CHa!
2022-01-24 11:56 PM
Hi,
it would be really nice if you could provide some more information about the memory stuff (Rx/TxDescriptor placement, lwip heap and the corresponding MPU configuration).It would be very helpful if there are some hints on necessary adjustments if you change something of the examples, e.g. the lwip heap size.
Also there are compiler errors in the memory setup part of ethernetif.c if you change the compiler to the new Keil v6 Compiler (lwip mem pool setup region). For now i could not solve those problems without breaking the functionality. I get lwip assertions and hard fault during allocation.
Also why the memory is placed in SRAM1, the reference manual states SRAM3 as the place to use.
All this stuff is pretty unclear and i can't find any documentation about setting this up correctly. It's really hard to get started with ethernet on the H7 (broken driver, no documentation, no comments on configuration parts, keil projects only for old compiler, ...).
I really can't believe im the only one struggling with porting the ethernet functionality to a custom board. This is a nightmare!
I'm thankful for any help!
2022-01-28 05:06 AM
Hello,
I have ported the ETH driver as described.
short overview of my project and what i am using:
With the legacy ethernet driver the H7 was running into a RBU-Interrupt.
The rework seems to work better. I followed the migration guidline.
The low_level_input() seems to work.
But the low_level_output() is not working.
With a GET (http) everything works fine but when i try to POST something i stuck in the low_level_output() -> osSemaphoreAcquire(TxPktSemaphore,....). So the HAL_ETH_IRQHandler is not triggered. When i use the HAL_ETH_Transmit function it works better. But after a while a FIN ACK is sended.
I would be very grateful for any suggestions for solutions or ideas.
Thanks Korbi
2022-01-28 05:39 PM
I wanted very much to help reviewing and testing the new driver - but unfortunately swamped in other chores :(
One thing that certainly bugs me - new callbacks for descriptors and buffers allocation. This means more nested calls between user code and the driver, increased stack usage and potential of stack corruption (not to mention performance) - a big concern for embedded software.
Callback pointers in the ETH "handle" structure are in writable RAM - same concern.
Separation of the driver and higher/app/middleware level code could be more elegant and robust.
@MWB_CHa @alister @Piranha @ALABB
2022-02-08 11:31 PM
When will this NetXDuo fix be available for the NUCLEO-H743ZI2 ?
2022-03-11 06:22 AM
Hi Chekib Hammami,
The STM32CubeMX 6.5.0 with Ethernet HAL Driver reworked by ST was just released, but the X-CUBE-AZRTOS-H7 V2.0.0 is not compatible with it. When the compatible AZRTOS-H7 will be released?
2022-03-11 06:50 AM
Hello @Community member
Actually, besides to STM32CubeMX 6.5.0, there is an important change done on H7 CubeFW which is the update of the ETH driver.
This update has impacts on both HAL and also the way STM32CubeMX generate the code relative to ETH.
This means of course that X-CUBE-AZRTOS-H7 NetXDuo loses compatibility with both on the release STM32CubeMX 6.5.0.
An update is planned in April for X-CUBE-AZRTOS-H7 to (among other things) align NetXDuo with
this major ETH update.
I'm updating this post soon with more details about how to update NetXDuo vs. new ETH HAL driver using GitHub code to provide clear explanation.
I hope this helps.