2020-08-20 01:17 PM
I'm working on an application that requires Ethernet on an STM32F765 chip and there are two options to attach an Ethernet PHY to the MCU: RMII and MII. Deciding on which interface to use has led me to a post that mentioned RMII having issues on STM32 MCUs. Granted, the post is old and refers to the F4 (I'm using the F7), but I'd like to take a poll of what others have experienced with using either RMII or MII. Which one would you recommend and why? What issues have you experienced?
My preference would be to use RMII due to the lower pin count, but it requires a higher clock frequency.
Thanks in advance for your feedback!
2020-08-20 02:09 PM
RMII works fine.
The ethernet/lwip bugs in HAL are due to software issues, not hardware.
2020-08-20 04:09 PM
Thanks for the reply. I figured that the issue was not related to hardware, but unless one aspires to write their own Ethernet driver, you're stuck with the HAL. In that case, would it be advisable to use MII?
Or have the bugs been fixed? The post I referenced is 6 years old. Not sure if ST addressed these issues.
2020-08-20 11:06 PM
ST has a lot of errors in lwip. This is terrible.
On stm32f407vgt6 I even have "tcp echo server" not working in stm32cubemx 6.0.1+lib 1.25, although in stm32cubemx 4.27+gb 1.21 it worked.
2020-08-20 11:51 PM
All linked post says, that with RMII you should design hardware appropriately to the 50MHz signalling, starting with a decent clock.
JW
2020-08-21 02:02 PM
I have RMII working flawlessly on a two layer 1,6 mm board. If the board is designed properly, 50 MHz is not very high frequency.
For a clock typically you either put a separate crystal for PHY chip, feed HSE through MCO pin or feed HSE and PHY from other source. Take a note that, when using MCO pin, you cannot source it from PLL because that clock has a significant amount of jitter.
There is a minor errata issue for RMII, but that is easy to work around and is only present on revision A chips, which most likely by now are gone from warehouses anyway.
Regarding HAL/CubeMX bloatware - using MII will not change anything.
2020-08-21 04:17 PM
> 50 MHz is not very high frequency..
That does not mean it can't be spoiled on a 6- or 8-layer board, with a bit of effort....
https://community.st.com/s/question/0D50X00009XkaBWSAZ/ethernet-through-rmii-on-stm3240geval-anyone
:)
JW