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.

TMS570LC4357: We have designed the schematic for the TI HDK development board, implementing the RMII mode connection between the EMAC and PHY chips. However, during the code debugging process, we are unable to obtain the PHY ID. Could engineers please take

Part Number: TMS570LC4357

This is a screenshot from my code debugging. When running the function to obtain the PHY ID, the DATA in the USERACCESS0 register always remains 0. I have been unable to identify the reason for this.

This is my hardware schematic. The TMS570LC4357 chip is connected to the PHY chip through a connector. Please help me check whether there are any errors in the hardware。

I am using the official example project v00.04..00 for my code. I added the code EMACHWInit(emacAddress); in the main function, but it cannot initialize successfully, and I cannot obtain the PHYID.

In the above-mentioned project, the modifications made using HCG are as follows:

Translate to English, and I observed that the frequency of the X1 pin of the PHY chip is 50MHz, and the frequency of the MDIO pin is 1MHz using an oscilloscope."

  • Hi Hu Jiangbo,

    I started working on your issue and will provide you an update ASAP.

    --
    Thanks & regards,
    Jagadish.

  • void EMACInstConfig(hdkif_t *hdkif)
    {
    hdkif->emac_base = EMAC_0_BASE;
    hdkif->emac_ctrl_base = EMAC_CTRL_0_BASE;
    hdkif->emac_ctrl_ram = EMAC_CTRL_RAM_0_BASE;
    hdkif->mdio_base = MDIO_BASE;
    hdkif->phy_addr = 1U;
    /* (MISRA-C:2004 10.1/R) MISRA error reported with Code Composer Studio MISRA checker. */
    hdkif->phy_autoneg = &PhyAutoNegotiate;
    hdkif->phy_partnerability = &PhyPartnerAbilityGet;
    }

    Is the assignment of hdkif->phy_addr to 1 correct in the above code?

  • Hi Jagadish,

    The question of PHY_ADDR has been resolved.

    Thanks!

  • The question of PHY_ADDR has been resolved.

    Good to hear that you solved the issue.

    Can you please tell me how you rectify the issue, that would be helpful for future similar threads.

  • This problem has not been solved. The phyID obtained through the function MDIOPhyRegRead is still 0. I hope you can help troubleshoot the hardware and software problems. Thank you.

  • This problem has not been solved. The phyID obtained through the function MDIOPhyRegRead is still 0. I hope you can help troubleshoot the hardware and software problems

    Sure, i will do.

  • Hi Hu Jiangbo,

    I compared your schematic with working HDK schematic and i noticed following things.

    1. RX_DV (pin 39) of the PHY is given to the 10K pullup resistor on your schematic right?, but in our testing's we always given this pin to the 2.2K pullup resistor and tested.

    2. I noticed a 1.5K pullup resistor for MDC (pin 31) as well, but it is not required. I mean only MDIO requires the 1.5K pullup resistor.

    3. On your schematic RX_ER (pin 41) not connected between PHY and controller and also a pullup resistor of 2.2K is also not connected to this pin.

    4. It would also better to connect a 2.2K pullup resistor to CRS_DV (pin 40) of the PHY.

    Please compare from your side as well and here is the schematic of HDK board:
    TMDX570LC43HDK Development kit | TI.com

    --

    Thanks & regards,
    Jagadish.

  • Thank you very much!

    Our hardware board design cannot be changed anymore.

    Will the design errors of these pins cause phy to be unable to read and write? Or is it just a little unexpected impact.

    Because we are investigating whether it is a hardware or software issue.

  • We have successfully used MII mode to read and write phy on the development board, but I found a prerequisite, which is that the ECLK pin must be configured with ECLK function and the clock must be configured with 25MHz.

    If the ECLK pin is configured to GIO function, it will not be possible to read and write phy.

    From the data manual, it appears that the ECLK pin are not related to the MII network port function.

    Why is this situation occurring?

  • We use mii mode on the HDK board,and have successfully.

    We use rmii mode on ourselves board,so we need to investigate whether it is a hardware or software issue result in cannot read/write phy.

  • 1. RX_DV (pin 39) of the PHY is given to the 10K pullup resistor on your schematic right?, but in our testing's we always given this pin to the 2.2K pullup resistor and tested.

    This one is important to bring PHY into the RMII mode, so can you please try to implement it and test it.

  • ok, I will try now.

    By the way, Is the ECLK pin related to the function of PHY? I find I must configured the ECLK pin to ECLK function, not to GIO function that I can read/write phy, the frequency of ECLK has no effect.

  • Another question:

    I referenced MDIOPhyRegRead()  and MDIOEnable/Disable() function in the EMACHWInit() function, it can run successfully and obtain the desired result.

    But when referenced in the main() function, it will enter a DataEntry exception interrupt.

    Why is the reason?

    Thanks!

  • 1. RX_DV (pin 39) of the PHY is given to the 10K pullup resistor on your schematic right?, but in our testing's we always given this pin to the 2.2K pullup resistor and tested.

    This one is important to bring PHY into the RMII mode, so can you please try to implement it and test it.

    I followed your instructions for testing and can read PHY now.

    However, the bit2 of the BMSR register in DP8640 cannot be read to 1, always reading 0, as the picture below:

    This will cause the following code to fail to execute,cannot entry into the “if((linkStatus & PHY_LINK_STATUS) != 0U)”

    Can you help me analyze the reason?Thanks!

  • I followed your instructions for testing and can read PHY now.

    However, the bit2 of the BMSR register in DP8640 cannot be read to 1, always reading 0, as the picture below:

    This will cause the following code to fail to execute,cannot entry into the “if((linkStatus & PHY_LINK_STATUS) != 0U)”

    Can you help me analyze the reason?Thanks!

    The reason for this should be that there is no connection to the network cable.
  • Another question:

    I referenced MDIOPhyRegRead()  and MDIOEnable/Disable() function in the EMACHWInit() function, it can run successfully and obtain the desired result.

    But when referenced in the main() function, it will enter a DataEntry exception interrupt.

    Why is the reason?

    Thanks!

    Can you help me analyze the reason for this,please?

  • ok, I will try now.

    By the way, Is the ECLK pin related to the function of PHY? I find I must configured the ECLK pin to ECLK function, not to GIO function that I can read/write phy, the frequency of ECLK has no effect.

    Can you help me analyze the reason for ECLK pin must be configured to ECLK function,please?

    By the way, I could read phy in the RMII mode after change the 10K pullup resistor to 2.2K, Thank you very much!

  • By the way, Is the ECLK pin related to the function of PHY? I find I must configured the ECLK pin to ECLK function, not to GIO function that I can read/write phy, the frequency of ECLK has no effect.

    The reason of this has found, the development board is the Lanuch not HDK, the ECLK is connected to the X1 pin of PHY.

  • Hi Hu jiangbo,

    By the way, I could read phy in the RMII mode after change the 10K pullup resistor to 2.2K, Thank you very much!

    Good to hear that.

    The reason of this has found, the development board is the Lanuch not HDK, the ECLK is connected to the X1 pin of PHY.

    You are correct about this.

    The reason for this should be that there is no connection to the network cable.

    You are correct about this as well.

    --
    Thanks & regards,
    Jagadish.

  • Another question:

    I referenced MDIOPhyRegRead()  and MDIOEnable/Disable() function in the EMACHWInit() function, it can run successfully and obtain the desired result.

    But when referenced MDIOPhyRegRead()  and MDIOEnable/Disable() function in the main() function, it will enter into the DataEntry exception interrupt.

    Why is the reason?Can you help me analyze the reason for this,please?

    Thanks!

  • Hi Hujiangbo,

    Yes, there is a chance of getting DataEntry exception if you call "MDIOPhyRegRead" API directly in main function. Because actually "hdkif_data" should be initialized to the "netif->state" before calling "MDIOPhyRegRead" function because this hdkif data structure only consist of the mdio_base address etc.

    If you verify this initialization is happening in the "hdkif_init" API and before calling the "hdkif_hw_init".

    If this initialization is not happening, then mdio_base address will be 0x0 only, and ant writing to this would get dataEntry aborts. So you should not call them directly into the main function.

    --
    Thanks & regards,
    Jagadish.

     

  • In RMII mode, I have followed your suggestion to change the pull-up resistor on the RX_DV pin to 2.2K and removed the 1.5K pull-up resistor on the MDC pin. However, due to hardware constraints, it is challenging to connect a 2.2K pull-up resistor to the CRS_DV pin. Additionally, the RX_ER pin is not connected to the CPU. While conducting TCP transmission experiments, I encountered difficulties in sending data, and there seem to be issues with ping packets. Could you please advise if the CRS_DV and RX_ER pins have an impact on ping packets? Thank you.

  • Hi Hu jiangbo,

    Apologies for the delay in my response, i am on vacation for last week.

    Could you please advise if the CRS_DV and RX_ER pins have an impact on ping packets?

    I am really not aware how this would impact the behavior.

    --
    Thanks & regards,
    Jagadish.