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.