Hi there,
I'm trying to implement the lwIP on TWR-K64 alongside my project. When I tested lwIP example from KSDK2.0 it worked fine, but when I port it into my own project it gets stuck in the autonegotiation part.
It's like the there is no cable connected, but it is...
By emulating, I could see that the PHY_Init() function always reads variable "bssReg" as 0, as shown in the code below:
result = PHY_Write(base, phyAddr, PHY_BASICCONTROL_REG,
(PHY_BCTL_AUTONEG_MASK | PHY_BCTL_RESTART_AUTONEG_MASK));
if (result == kStatus_Success)
{
/* Check auto negotiation complete. */
while (counter --)
{
result = PHY_Read(base, phyAddr, PHY_BASICSTATUS_REG, &bssReg);
if ( result == kStatus_Success)
{
if ((bssReg & PHY_BSTATUS_AUTONEGCOMP_MASK) != 0)
{
break;
}
}
if (!counter)
{
return kStatus_PHY_AutoNegotiateFail;
}
}
}Here's my project: Dropbox - TWR-K64
I've looked everywhere for a solution, but I didn't find one. If anyone could help I'd be extremely thankful.
Best regards
Gustavo Costa