Skip to content

Conversation

@wdx04
Copy link

@wdx04 wdx04 commented May 20, 2025

Summary of changes

Fix #454 .
Support a range of models in a single Ethernet PHY driver.
Renamed LAN8742 driver LAN87XX to support both LAN8742 and LAN8720 in a single driver.
Added DP83848 PHY driver.
Added missing GPIO_InitStructure declarations in the EthInitPinmappings function for some STM32 boards.

Impact of changes

Migration actions required

If an application explicitly specified the EMAC PHY model with "nsapi.emac-phy-model": "LAN8742" in mbed_app.json5, it needs to be renamed LAN87XX.

Documentation

To use the LAN8720 or LAN8742 PHY, override the nsapi.emac-phy-model setting in mbed_app.json5, or just remove the nsapi.emac-phy-model and nsapi.emac-phy-mdio-address entries to use the default value:

"MY_TARGET": {
    "nsapi.emac-phy-model": "LAN87XX",
    "nsapi.emac-phy-mdio-address": 0
}

To use the DP83848 PHY, override the nsapi.emac-phy-model setting in mbed_app.json5:

"MY_TARGET": {
    "nsapi.emac-phy-model": "DP8384X",
    "nsapi.emac-phy-mdio-address": 1
}

Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Tested with a simple TCP Ehco application on three boards:

STM32F746G-DISCOVERY with LAN8742
Custom STM32F407 board with LAN8720
Custom STM32F407 board with DP83848

The application running on the board acts as a TCP client. It connects to the server running on the PC, and sends some text to the server. The server sends back the same text after receiving it, and the client verifies whether it is the same as the sent text.


wdx04 added 3 commits May 20, 2025 14:07
…42 and LAN8720

added DP83848 PHY model
added missing GPIO_InitStructure declarations in the EthInitPinmappings function for some STM32 boards
support a range of models in a single Ethernet PHY driver
Copy link
Collaborator

@multiplemonomials multiplemonomials left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for the fix!

@multiplemonomials multiplemonomials merged commit 7d9fbaf into mbed-ce:master May 23, 2025
52 checks passed
@wdx04 wdx04 deleted the eth-phy-model-range branch June 22, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Needs to support more Ethernet PHY chips

2 participants