STMicroelectronics / stm32h7xx-hal-driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32H7 series.
BSD 3-Clause "New" or "Revised" License
97 stars 41 forks source link

Full rework of Ethernet HAL driver #16

Closed ALABSTM closed 2 years ago

ALABSTM commented 2 years ago

The reworked Ethernet HAL driver brings multiple changes and a compatibility break vs. previous Ethernet HAL driver. Main changes are listed here:

Arni1115 commented 2 years ago

Could you provide example of ethernetif_input (using LwIP and FreeRTOS) function with for reworked ETH HAL driver?

Jovan-ux commented 2 years ago

Where the applications are located? Cannot find'em. Thx, KR Jo

BTW: Is there a reason to hold the drivers on v1.10.0 release? I'm wondering why your modifications are put on top of v1.10.0..

Jovan-ux commented 2 years ago

Actually you would not provide any applications for ethernet in the main repo https://github.com/STMicroelectronics/STM32CubeH7 if ethernet driver was not published officially, would you? No changes regarding demo applications/projects found in H7 firmware package released so far...

Would appreciate if you can give me a hint... Thx,KR jo

ALABSTM commented 2 years ago

Hi @Arni1115 and @Jovan-ux,

Please excuse this delayed reply. Indeed, The applications using this new ETH HAL driver have not been published yet. They shall be in the STM32CubeH7 repo. Their publication is planned in a couple of weeks.

In the meanwhile, the idea is to provide the new driver before that date, via this pull-request, to allow our users to test it with their own applications.

As for the updated applications, I can check with our development teams whether it is possible to provide them the same way (via a pull-request) before the official publication date. I will get back to you as soon as I have their feedback. As this period corresponds to the end-of-year leaves, this might take some time. Thank you in advance for your patience and comprehension.

Regarding why this pull-request is not rebased on top of the new tagged commit v1.10.1, as said earlier, the main purpose is to make the driver available before the official publication date, rather than to maintain the pull-request and to rebase it each time a new commit is added (after going through resolving any eventual conflicts). After all, this reworked driver will be officially published soon.

I hope this answers your questions. Do not hesitate otherwise.

With regards,

ALABSTM commented 2 years ago

Hi all,

Updated applications using the new ETH HAL driver have just been published via pull-request STM32CubeH7#195 (including the new ETH HAL driver too). LwIP applications are provided for the following boards and can be tailored for the others:

Please feel free to give your feedback and report any point you would find worth to mention. Happy end-of-year 2021 and a happier 2022.

With regards,

ra1u commented 2 years ago

Issues remains with error handling.

No all errors are handled in stm32h7xx_hal_eth.c#L1894-L1895 Particularly not _ETH_DMACSRERI and _ETH_DMACSRTBU. This results lot of interrupts as they are not handled.

In general errors are not handled at all, but are just suppressed.

For example. There is deadlock in tx, partially due to missing return value/error checking on _HAL_ETH_TransmitIT ethernetif.c#L313-L317

This becomes noticable when link goes down ethernetif.c#L636 Result is that since interrupts and transfer is suddenly disabled, we get into deadlock.

There is also no synchronization over this handle and its members for example EthHandle.gState.