network: Network auto-negotiation duplex fix for LAN8742 #4171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On auto-negotiation using the external network phy LAN8742, the reference stm32f427 source code incorrectly uses the wrong PHY_SR (status register) addr of 0x10, leading to a false detection of the duplex mode, thus using half-duplex instead of duplex mode, resulting in retransmissions and overall lower throughput of data.
According to the LAN8742a datasheet, page 89, "4.2.22 PHY Special Control/Status Register" the addr is defined as 31 (0x1E), with duplex/half-duplex speed indicator given in bit 4..2.
This patch fixes the duplex mode for the ethernetif.c ... it might be necessary to patch the legacy HAL_ETH_Init as well within the lib/Drivers/STM32F4xx_HAL_Driver/Src/Legacy/stm32f4xx_hal_eth.c.
See further details here as well for reference.
Somewhat related to issue #3049 (not for wifi, but ethernet part)