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.
Hi all,
I'm using the tm4c129dncpdt in my project.It is connected to KSZ8765CLX trough MII interface.I once use the TM4C1294NCPDT in my project.The 1294 chip has internal phy in it and have ti-rtos example software support.But how can I get the ethernet example for the 129D chip?How can I developement the chip that has no phy in it?Can I use the NDK products in the tirtos_tivac_2_16_01_14 software and how?I don't have any idea of it.
Hi Amit,
I'm actually working on a similar project as Nancy, in that we're trying to use an external PHY. I was using the RTOS project as a start and I was looking at the lwipopts.h file where I would need to make changes to use an external PHY instead of an internal one. The two defines that I see that I need to change are EMAC_PHY_CONFIG and PHY_PHYS_ADDR. Can you let me know if there are any additional items that needs to be modified in order to work with an external PHY? Or do you have an expected release date of the TivaWare 2.1.4?
Thanks!
Hi Amit,
Unfortunately, we can't wait until the 2.1.4 is release so any guidance you can provide would be greatly appreciated. As I mentioned earlier, I am changing the lwipopts.h where the changes are:
// Original #define EMAC_PHY_CONFIG (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | EMAC_PHY_AN_100B_T_FULL_DUPLEX) #define PHY_PHYS_ADDR 0 // Change to #define EMAC_PHY_CONFIG (EMAC_PHY_TYPE_EXTERNAL | EMAC_PHY_INT_MDIX_EN | EMAC_PHY_AN_100B_T_FULL_DUPLEX) #define PHY_PHYS_ADDR 3
But you mentioned other files that also need to be changed, can you provide which files they are and I can take an initial look to see if I can determine what needs to be changed in those files.
Thanks!
Hi Amit,
Looks like I misread it. It stated that there's available I/O expansion interface headers for external PHY.
Thanks.
Hi Amit,
Just to provide some additional information here, I was able to establish a link between the PHY and a switch. I had to make one more change in the tiva-tm4c129.c file. When i added the #if defined (EMAC_PHY_IS_EXT) on line 321 after the InitDMADescriptiors. I also had to make sure that I don't execute the code for the PHY interrupts, so that portion of the code became:
#if defined(EMAC_PHY_IS_EXT_MII) || defined(EMAC_PHY_IS_EXT_RMII) /* If PHY is external then reset the PHY before configuring it */ EMACPHYWrite(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_BMCR, EPHY_BMCR_MIIRESET); while((EMACPHYRead(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_BMCR) & EPHY_BMCR_MIIRESET) == EPHY_BMCR_MIIRESET); #else /* Clear any stray PHY interrupts that may be set. */ ui16Val = EMACPHYRead(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_MISR1); ui16Val = EMACPHYRead(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_MISR2); /* Configure and enable the link status change interrupt in the PHY. */ ui16Val = EMACPHYRead(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_SCR); ui16Val |= (EPHY_SCR_INTEN_EXT | EPHY_SCR_INTOE_EXT); EMACPHYWrite(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_SCR, ui16Val); EMACPHYWrite(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_MISR1, (EPHY_MISR1_LINKSTATEN | EPHY_MISR1_SPEEDEN | EPHY_MISR1_DUPLEXMEN | EPHY_MISR1_ANCEN)); /* Read the PHY interrupt status to clear any stray events. */ ui16Val = EMACPHYRead(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_MISR1); #endif
This is so because the Micrel PHY that we're using doesn't have register 0x12 as defined by EPHY_MISR1. It's a reserved register in the Micrel PHY. Once I did this, then I was able to establish a link. However, I'm still not able to ping the device and I wonder if it has something to do with this or something along the line of interrupts. Can you provide any guidance on this or should it just work if I'm able to establish a link? If it should just work, then I'll look into the signals to see if we happen to cross the lines.
Thanks!
Hello Amit
I have made the changes in various posts of yours regarding RMII on the TM4C and the DP83822. I have been using this combo successfully on our custom hardware. I am attempting to get the TM4C129X development board working with the DP83822 development board with RMII and none of these examples and posts seem to work. This is the combination that I used to get the MII interface working, but I would much rather RMII. Have you had time to test RMII with this combination? I am waiting for the new TivaWare to be released, but I'm hoping to get RMII working before then if possible.
-Joe
Hi Amit,
Does current TivaWare release 2.1.4 have any update for integrating via MII interface an external PHY ?
Thanks and Regards,
Dileep
Dileep,
The current revision works just fine with MII with no editing besides enabling the pin muxing for the MII interface. I also have it working with RMII if you need any assistance with that.
-Joe
Selecting and enabling the external clock from the RMII PHY is failing in EMACPhyConfigSet.
When I use EMACPHYConfigSet(EMAC0_BASE, EMAC_PHY_CONFIG);
where EMAC_PHY_CONFIG is defined as EMAC_PHY_TYPE_EXTERNAL_RMII
Regards
Harish
Hello Dileep,
You will need to give the external PHY and the Tiva a 50MHz reference clock if you are using RMII. In my particular case, I prototyped this with a function generator. I am using the DP83822.
Once you connect all the RMII signal pins, you will need to enable them in the pinmux file for your project. After that, in lwipopts.h, you will need to set the #define to use external phy rmii instead of the internal phy. Those are basically the only changes needed to get the external phy working.
//#define EMAC_PHY_CONFIG (EMAC_PHY_TYPE_INTERNAL | EMAC_PHY_INT_MDIX_EN | \
// EMAC_PHY_AN_100B_T_FULL_DUPLEX)
#define EMAC_PHY_CONFIG EMAC_PHY_TYPE_EXTERNAL_RMII
The return value will be a zero because you probably dont have the phy address correct. I would suggest changing the address in lwipopts.h to the correct address of your phy.
#define PHY_PHYS_ADDR 0
If you need help, with the address, let me know. You could also run through a loop to find it.
int phy_reg;
for (i = 0; i < 31; i++)
{
phy_reg = EMACPHYRead(EMAC0_BASE, i, EPHY_BMCR);
}
if phy_reg is not 0xFFFF or 0x0000, you probably have a phy on that address. It is not a robust method to detect a phy, but it might help you find what you are looking for. I suggest reading the phy datasheet and finding the correct phy address. It most likely will have address pins.
-Joe
Hello Joseph,
Thank you for your input. After connecting 50Mhz i am able configure MAC and read all EXT PHY registers. But still Link is down and no IP is assigned. Please help in resolving this issue.
Best Regards,
Dileep