Skip to content

Support ethernet without MDIO & MDC lines #16215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

azerupi
Copy link
Contributor

@azerupi azerupi commented Apr 15, 2025

Summary

Closes #16213

We have a board with an STM32H7 connected to an IC switch through RMII. This IC switch is also connected to an embedded Linux soc and the MDIO and MDC lines are connected to that SOC for configuration.

However the code in NuttX expects the MDIO / MDC lines and configures them unconditionally. When we comment out the lines while having the CONFIG_STM32H7_NO_PHY set it works for us.

Impact

As far as I can tell, the MDIO and MDC lines should not be used when the option CONFIG_STM32H7_NO_PHY is set ? Not configuring the pins should therefore be the expected behavior.

The changes are limited to STM32H7 and H5 because they are the only targets that I found that define a NO_PHY option.

Testing

Tested by commenting out the two lines on a custom board with an STM32H7 running PX4 which is running on top of Nuttx. The STM32 is connected to an IC switch over RMII and the IC switch is configured from a second SOC running Linux. The Linux driver configures the IC switch.

Before the changes this setup didn't work, with the changes it works.

@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small labels Apr 15, 2025
@acassis
Copy link
Contributor

acassis commented Apr 15, 2025

Hi @azerupi that is interesting. Sometime ago some people asking in the list how to do something similar, but in that case they were willing to communicate two MCUs directly using Ethernet without PHY (it was ESP32). Could you please share more info about your switch part-number or a single diagram showing it?

@azerupi
Copy link
Contributor Author

azerupi commented Apr 15, 2025

We are using the RTL8364NBI-CG. I don't think I can share a screenshot of the schematic but here is a simplified diagram if that helps.

image

The pins where the MDIO and MDC would be usually connected on the STM32 (NuttX) are being used for something else unrelated to ethernet.

@xiaoxiang781216 xiaoxiang781216 merged commit 7281d91 into apache:master Apr 15, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Support ethernet without MDIO & MDC lines
3 participants