#359 PHY powerdown issues not fixed


This relates to issue 3570335 which was apparently badly closed: in theory one could use STM32_ETH1_CHANGE_PHY_STATE to prevent the problem, however, there is still a PHY powerdown MII write in mac_lld_init which is not disabled by this #define.

The fix is trivial: just surround the mii_write at the end of mac_lld_init in os/hal/platform/STM32/mac_lld.c with #if #endif as follows:

/* PHY in power down mode until the driver will be started.*/
mii_write(&ETHD1, MII_BMCR, mii_read(&ETHD1, MII_BMCR) | BMCR_PDOWN);

On a side note, I find the STM32_ETH1_* naming a bit confusing since STM32_MAC_* is used elsewhere for anything related to the STM32 MAC driver.


  • Thanks for finding.

    It will be fixed in 2.4.3stable and 2.5.2unstable.

    • milestone: 953057 --> 2.4.0
    • priority: 5 --> 3
    • assigned_to: nobody --> gdisirio
    • status: open --> open-fixed
  • Will be fixed in 2.5.2unstable.

  • Fixed in 2.6.0.

    • status: open-fixed --> closed-fixed