Skip to content

Commit c5b192e

Browse files
committed
STM32 EMAC : check PHY_BSR value before connect status
1 parent 6a2219e commit c5b192e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ void STM32_EMAC::phy_task()
677677
uint32_t status;
678678

679679
if (HAL_ETH_ReadPHYRegister(&EthHandle, PHY_BSR, &status) == HAL_OK) {
680-
if (emac_link_state_cb) {
680+
if ((emac_link_state_cb) && (status != 0xFFFF)) {
681681
if ((status & PHY_LINKED_STATUS) && !(phy_status & PHY_LINKED_STATUS)) {
682682
emac_link_state_cb(true);
683683
} else if (!(status & PHY_LINKED_STATUS) && (phy_status & PHY_LINKED_STATUS)) {

0 commit comments

Comments
 (0)