I have a problem: 83848 status reg reports link down despite LINK LED is on
My own designed board is Microchip PIC32MX695F512H with internal MAC + DP83848 PHY, Microchip TCPIP Stack v5.42.02.
My board can't get a IP address from DHCP. I debugged into call chain
StackTask() - DHCPTask() - MACIsLinked(), which returned "link down" status,
so DHCP discovery packets was not emitted, and whole communication couldn't get started.
After some investigation:)) I see that link status is set at
StackTask() - MACGetHeader() - EthPhyGetLinkStatus() - _PhyReadReg(PHY_REG_BMSTAT, _PhyAdd);
which reads PHY's BMSR status reg through MDIO/MDC to check PHY's internal LINK_STAT bit.
Status reg reading seems to be okay (eg. AN_ABLE reads1, AN_COMPLETE=1, all 4 BASE10/100 FD/HD bits are1's, etc.)
but LINK_STAT bit reads 0 (I have a single PHY in the system, its adress is 1, Phy detect and Init functions are successful)
The strange part is that that at the same time DP83848 PHY's LINK LED "lives":
lights up when RJ45 plugged in, and blacks out when plug removed (even if PIC32 prog not running).
If I unplug the other end of cable from 10/100 switch, LINK LED normally goes off, so link detect bursts go through --magnetics seems to be fine.
The 83848's BMSR register bit2 LINK_STAT reads 0 even when link LED is on.
Can Link LED and link status bit work separately? MDIO+MDC are surely well connected, but
there may be soldering errors at TXD0/1 RXD0/1 pins. Can they cause such a link problem despite the well-working link LED?
Is there any hint what is the problem?