This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952: LwIP example not working on Hercules dev kit Rev E

Part Number: RM48L952

Hello,

I downloaded lwip_v002 and lwip_v003 from the processors.wiki.ti.com in order to get acquaninted with lwip. So, the first thing I did was to import the project to Code Composer Studio, compile it and run it. I opened PUTTY on the COM port that the dev kit is in and I get the debug prints on the screen. I can see that it goes up to the point where it displays "GETTING PHY ID" and it never gets it, it ends with an error "DEBUG - Getting PHY Alive Status...!!! ERROR !!!..DONE" and finally signals an error initializing the hardware.


After some searching I noticed that it fails in hdkif.c->hdkif_hw_init. It fails in this loop

while ((phyID == 0) && (phyIdReadCount > 0)) {
	  phyID = Dp83640IDGet(hdkif->mdio_base, hdkif->phy_addr);
	  phyIdReadCount--;
	  sciDisplayText(sciREGx, txtProgress, sizeof(txtProgress));
  }

More especifically it fails in the function DP83640IDGet, in the function MDIOPhyRegRead, in this line

if(((HWREG(baseAddr + MDIO_USERACCESS0)) & MDIO_USERACCESS0_ACK) == MDIO_USERACCESS0_ACK)

It always returns false. There is an error when accessing the PHY, but I wouldn't know where to start checking for erros. I checked and there is something that you need to do when using the launchpad for RM57, but there is no documentation for RM48's Development kit.

  • Which development kit are you trying this example on?   (HDK, Control Card).

    For the PHY, you can open the register window in CCS as shown below.  Make sure you do this after the code has run enough so that

    the EMAC and MDIO intialization functions have been called.

    Then when you are past the initialization you can expand the USERACCESS0 register under MDIO

    and do the following

      1) Write the phy address and phy register address that you want to read.

      2) leave a '0' in the write bit (to read the register)

      3) write a 1 to the GO bit.  It will auto clear

      4) the read will be triggered and the result will be visible in the Data field.


    You can do this and quickly read the Phy ID register from all of the different Phy addresses and see if it is responding on any of them.
    Some of the boards have a problem with the strapping pullup/pulldown and the Phy may not come up at address 0x01 ..

  • Hi, thanks for your response. I am using the HDK. I've tried doing what you told me, but I always get all ones in the data filed no matter the PHY or register address. I've gone into the MDIOPhyRegRead function and I noticed that when it checks for the ACK it fails and always returns zero.

    if(((HWREG(baseAddr + MDIO_USERACCESS0)) & MDIO_USERACCESS0_ACK) == MDIO_USERACCESS0_ACK)
        {
    	/*SAFETYMCUSW 439 S MR:11.3 <APPROVED> "Output is a 16 bit Value to be stored - Advisory as per MISRA" */
            *dataPtr = (uint16)((HWREG(baseAddr + MDIO_USERACCESS0))
                                        & PHY_DATA_MASK);
            retVal = TRUE;
        }

  • So .. any ideas of what might be wrong? I tried doing what you told me but I can't get and ID and no MDIO accesses work,

  • Pablo, Did you ever resolve this? I am running into the same issue. It appears to enter an infinite loop due to the Dp83640IDGet() function always returning 0.
  • Sorry it took me such a long time to answer. It was just impossible for the hercules kit. I think that maybe a new version would be necessary, because it was absolutely impossible to make it work, even with Anthony's help. Were you able to make it work? It's been 2 months since you posted .. maybe you were luckier than me