2024-11-17 10:04 AM
Hello Everyone,
I'm seeking guidance on how to connect an external Ethernet module using the RMII interface to an STM32 microcontroller. The challenge I’m facing is that CubeIDE does not allow me to customize the GPIO configuration when using the built-in LwIP stack. Specifically, when I try to reset or modify the configuration of one of the Ethernet GPIO pins, CubeMX disables the Ethernet interface altogether.
One suggestion from a colleague was to set the CubeMX target as a raw F7 MCU, but that didn’t resolve the issue. I believe the best approach might be to manually configure the LwIP stack from scratch as a third-party library, bypassing the built-in CubeMX LwIP integration. I would appreciate your thoughts on whether this is a feasible solution, and if so, any relevant tutorials or resources on how to implement this.
For testing, I have two Nucleo boards: the STM32L476RG and the STM32F767ZI. Prior to posting this, I successfully connected the built-in Ethernet module on the STM32F767ZI and an external W5500 Ethernet module using SPI and a dedicated library.
Thank you in advance for any help or advice you can provide!
2024-11-17 10:53 AM - edited 2024-11-17 10:56 AM
What sort of a module is it - a switch with special PHY-less port?
Basically in the CubeMX/IDE you specify a supported simple PHY and generate code. Then manually edit the source and replace all references to that PHY to the real one. You can also port a complete LwIP (or other network package) manually and even build it to a library. Of course either variant is feasible, many users did it many times, but for a beginner it can be hard.
Embedded switch (Microchip, Broadcom and so on) has quite a lot of configuration registers that are accessed over I2C or SPI, in addition to "compatible" interface over RMII. Then you'll need to connect it to I2C or SPI. Other kinds of modules may require something else.
All the resources are to your disposal on Google and friendly AI assistants. Human help is available too, here for one.
2024-11-18 12:53 AM
Hello @rolandsobczak ,
my understanding of your request is the following how to integrate LWIP with and external Ethernet module and not using the integrated PHY like the W5500 module?
this was done by many users as i can see in GitHub like this example on STM32F4
CubeMX code generation tool does not support the integration of an external ethernet module so this should be done manually as you figured out yourself.
also, I don't see why you want to interface with LWIP when there is an official driver, and you said that you got it working.
Regards