This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS PHY_LAN8720 driver timeouts

Hi there,

I have faced a problem with the NGX/NXP LPC1837 LPCXpresso board. The board is supplied with LPC1837 microcontroller connected to the LAN8720 PHY. I am using Keil uVision5 with the CMSIS drivers. I was following the example code from the CMSIS website:

www.keil.com/.../group__eth__interface__gr.html

so my Initialization code looks as follows:

static __inline void InitializeOnChipEthernetMAC(void) {
  MAC = &Driver_ETH_MAC0;
  PHY = &Driver_ETH_PHY0;

  capabilities = MAC->GetCapabilities();
  MAC->Initialize(ARM_ETH_MAC_SignalEvent);
  MAC->PowerControl(ARM_POWER_FULL);
  if (capabilities.mac_address == 0)  {
    MAC->SetMacAddress(&own_mac_address);
  }
  else {
    MAC->GetMacAddress(&own_mac_address);
  }

  if (PHY->Initialize (MAC->PHY_Read, MAC->PHY_Write) == ARM_DRIVER_OK) {
    PHY->PowerControl (ARM_POWER_FULL);
    PHY->SetInterface (capabilities.media_interface);
    PHY->SetMode (ARM_ETH_PHY_AUTO_NEGOTIATE);
  }

  while (true) {
    if (PHY->GetLinkState() == ARM_ETH_LINK_UP) {
      break;
    }
  }
}


Unfortunately, I am getting timeouts inside the PHY->PowerControl function. Mainly inside the PHY_LAN8720.c file (v6.2) at line 139 the function call

PHY.reg_rd(ETH_PHY_ADDR, REG_PHYIDR1, &val);


always returns ARM_DRIVER_ERROR_TIMEOUT. I have enabled the systick timer in the RTOS v1 which I am using. Has anyone had a similar issue and could tell me what I am missing?