-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
h7: eth: add checks for PHYID in stm32_phyinit #15757
Conversation
[Experimental Bot, please feedback here] The provided PR description does not fully meet the NuttX requirements. Here's a breakdown and how it could be improved: Missing/Insufficient Information:
Example of an Improved PR Description: SummaryThis PR fixes a bug in the STM32 Ethernet driver where network initialization would succeed even if no PHY was connected. This was caused by the driver not verifying the PHY ID registers (PHYID1 and PHYID2) during initialization. The absence of this check meant that the driver could erroneously report a successful initialization, leading to application errors and difficult debugging. This change adds the missing PHY ID checks to Impact
TestingI confirm that changes are verified on local setup and works as intended:
Testing logs before change (without PHY connected):
Testing logs after change (without PHY connected):
Testing logs after change (with PHY connected):
By providing comprehensive information, you significantly increase the chances of your PR being reviewed and merged quickly. Reviewers will appreciate the clarity and completeness, making their job much easier. Remember to replace the bracketed placeholders with the actual information. |
The AI review is pretty cool 😎 |
7c746e5
to
fbdcafc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this commit will need a proper description? fbdcafc
As discussed in NuttX Mailing List today. Thanks :-) https://lists.apache.org/thread/mn4l1tmr6fj46o2y9vvrmfcrgyo48s5d
Please move the include change to a separate PR. If we intend to maintain LTS releases we MUST split the PR on separate areas |
Fixes bug where stm32_phyinit will succeed even when no PHY is connected. This is because there is no check that a PHY is actually communicating and returning data. Update include/nuttx/net/mii.h Co-authored-by: Xiang Xiao <[email protected]>
fbdcafc
to
9d2323a
Compare
Create a separate PR for changing mii.h? The changes in stm32_ethernet.c use this definition, the PR wouldn't build. |
squashed! |
Summary
Check PHYID1 and PHYID2 for the configured PHY during init. Drivers on some of the other targets do this.
Impact
Fixes bug where stm32_phyinit will succeed even when no PHY is connected. This is because there is no check that a PHY is actually communicating and returning data.
Testing
Tested on an ARKV6X running PX4 main. This uses an STM32H743IIK processor.
Here is a snippet from the driver with debugging enabled
Before this PR it would succeed