on
2025-06-24
8:30 AM
- edited on
2025-08-01
2:03 AM
by
Laurids_PETERSE
In STM32-based Ethernet designs, connecting the internal media access controller (MAC) to an external physical layer transceiver (PHY) requires a hardware interface. The two most common interfaces used for this are:
Both serve the same purpose, facilitating data transmission between the MAC and PHY, but they differ significantly in pin count, speed, clocking, and ease of use.
This article breaks down their differences and guides you on when and why to choose one over the other in STM32-based applications.
Feature |
MII |
RMII |
---|---|---|
Full name | Media-independent interface | Reduced media-independent interface |
Supported speeds | 10 Mbps & 100 Mbps | 10 Mbps & 100 Mbps |
Data bus width | 4-bit Tx and 4-bit Rx | 2-bit Tx and 2-bit Rx |
Clock frequency | 25 MHz (for 100 Mbps) | 50 MHz |
Clock direction | Separate Tx & Rx clocks | Shared 50 MHz clock |
Number of required signals | ~16 | ~8 |
PCB complexity | Higher | Lower |
Power consumption | Higher | Lower |
Used in | FPGAs, high-end MCUs, legacy PHYs | STM32 MCUs, IoT boards |
MII and RMII are IEEE 802.3 standards that define how an Ethernet MAC communicates with a PHY chip over a digital interface, before signals are converted to analog Ethernet voltages for transmission on the cable.
Interface |
Clocking method |
STM32 implication |
---|---|---|
MII | Separate Tx and Rx clocks | Requires more clock inputs, complex routing |
RMII | Single 50 MHz reference clock | Shared by MCU and PHY; simpler layout |
Use case |
Recommended interface |
---|---|
STM32 IoT board or dev kit | RMII |
Custom board with minimal GPIOs | RMII |
Application requires 10 Mbps fallback | MII |
High-frequency EMI-sensitive design | RMII (with layout care) |
Interfacing with older or legacy PHYs | MII |
Problem |
Probable cause of problem |
Solution |
---|---|---|
No Ethernet link detected | Missing or unstable 50 MHz REF_CLK on STM32 | Verify clock source and stability |
MAC not receiving packets | Rx pins misconfigured | Check pinout and CubeMX configuration |
Random PHY resets | PHY reset pin floating or undervolted | Ensure proper pull-up and power supply |