网络初始化phy自动沟通过程中出错
时间:10-02
整理:3721RD
点击:
我的phy在自动沟通过程中出现远程终端故障 Remote Fault,请问有谁遇见过,是怎么解决的,或者有什么可能的问题?
- UINT8 ucRegAddr;
- UINT16 usPhyStatus;
- UINT32 i = 0;
- ucRegAddr = MII_STAT_REG;
- do { /* spin until it is done */
- API_TimeMSleep(pPhyDev->PHY_uiLinkDelay);
- i++;
- if (i >= pPhyDev->PHY_uiTryMax) {
- return (MII_ERROR);
- }
- if (MII_READ(pPhyDev->PHY_ucPhyAddr, ucRegAddr, &usPhyStatus) != MII_OK) {
- return (MII_ERROR);
- }
- } while ((usPhyStatus & MII_SR_LINK_STATUS) != MII_SR_LINK_STATUS);
- _DebugHandle(__LOGMESSAGE_LEVEL, "mii: link up.\r\n");
- /*
- * check for remote fault condition, read twice
- */
- if (MII_READ(pPhyDev->PHY_ucPhyAddr, ucRegAddr, &usPhyStatus) != MII_OK) {
- return (MII_ERROR);
- }
- if (MII_READ(pPhyDev->PHY_ucPhyAddr, ucRegAddr, &usPhyStatus) != MII_OK) {
- return (MII_ERROR);
- }
- if ((usPhyStatus & MII_SR_REMOTE_FAULT) == MII_SR_REMOTE_FAULT) {
- _DebugHandle(__LOGMESSAGE_LEVEL, "mii: remote fault.\r\n");\\一直在打印这句话
- return (MII_ERROR);
- }