modm-io / modm

modm: a C++23 library generator for AVR and ARM Cortex-M devices
https://modm.io
Mozilla Public License 2.0
748 stars 132 forks source link

Support for Ethernet on STM32H7 series #1207

Closed WasabiFan closed 1 month ago

WasabiFan commented 1 month ago

I see that Ethernet is not currently supported on the H7. I'm interested in evaluating Ethernet for a project and am considering doing the bring-up work to introduce support for it. However, I have no familiarity with the STM32 Ethernet IP so I'd like some input before I start digging.

I did a test build with the existing STM32 Ethernet driver enabled and there were a significant number of bad register references.

Can anyone comment on the lineage of the H7 Ethernet IP? Is it sufficiently similar to/derived from other STM32 Ethernet implementations (i.e., worth starting from the existing driver) or is it new? Any tips on the main changes in this revision of the IP or pointers to documentation which would help compare?

salkinium commented 1 month ago

I typically compare the register map of the peripheral, but in this case, they don't match exactly nor are they a subset of each other. The F7 vs H7 Ethernet does not seem to be compatible:

STM32F7 Ethernet register map:

vs

STM32H7 Ethernet register map:

Typically these IPs are not custom made by ST but licensed by some other vendor so perhaps you can have a look at some embedded friendly TCP/IP libraries (lwip?) and check whether they come with some platform independent driver. That's how we added USB support to modm via TinyUSB.