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.

RM46 Hercules board Ethernet RMII mode is not working

Other Parts Discussed in Thread: HALCOGEN, DP83640, RM46L852

Hi,

I am working on RM46 Hercules development kit for RMII Ethernet. I have enabled MII mode and it is working fine. When I enable RMII mode by settings

1. Bit 24 of PINMMR24 register

2. playing with GMII bit of EMAC Control register

3. pin muxing for RMII pins as verified with HALCoGen

RMII mode is not working. Is there any thing that am I missing to enable RMII? I have seen following threads but could not conclude for RM46 Hercules development kit.

http://support.eccn.com/questiondetail-questionid_26742-set_2.html

https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/493614

https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/477426

Thanks in advance

BR,

Jam

  • You need to check that the PHY is also configured for RMII mode not MII mode.

    This is usually done either through straps (at phy reset) or by configuration of the PHY serial management registers.

    -Anthony

  • Hi,

    is there a clean and clear working schematics how to connect the DP83640 in RMII to the RM46L852? From the HDK I can't see it very well

    Thanks,

    -Jarno
  • Jarno, 


    The HDK works as-is in RMII mode no need to change schematics. I just did this for some test code I had to create.

    It's not anything I can distribute though... 

    Here are some snippets I added to phy_dp83640.h / .c inside the /* USER CODE */ sections: 

    #define PHY_PAGESEL (19u)

    #define PHY_PAGE0_RBR (23u)

    #define PHY_PAGE0_EXTENDED_REG (0x0000U)
    #define PHY_PAGE2_LINK_DIAG (0x0002U)
    #define PHY_PAGE4_PTP_BASE (0x0004U)
    #define PHY_PAGE5_PTP_CONFIG (0x0005U)
    #define PHY_PAGE6_PTP_CONFIG (0x0006U)

    #define PHY_RMII_MASTER (0x4000U)
    #define PHY_RMII_SLAVE (0x0000U)
    #define PHY_RMII_MODE_ON (0x0020U)
    #define PHY_ELAST_BUF_DEFAULT (0x0001U)

    uint32 Dp83640SetRMIIMode(uint32 mdioBaseAddr, uint32 phyAddr)
    {
    /* Configure PHY for RMII Master Mode */
    MDIOPhyRegWrite(mdioBaseAddr, phyAddr, (uint32)PHY_PAGESEL, PHY_PAGE0_EXTENDED_REG);
    MDIOPhyRegWrite(mdioBaseAddr, phyAddr, (uint32)PHY_PAGE0_RBR, (PHY_RMII_MASTER | PHY_RMII_MODE_ON | PHY_ELAST_BUF_DEFAULT));
    return TRUE;
    }

    And you need to configure the MAC also for RMII mode which normally gets done through HalCoGen if you click the RMII switch(s) on pinmux. 
    There is a pinmux element to this. 

    Also you have to find out what speed got autonegotiated by the PHY when in RMII mode and flip a bit accordingly in the MAC; because the clocking is a little different on that interface in 10Mbit vs. 100Mbit and there is a bit in the MAC that needs to be changed to match the phy speed.   (I don't think this bit exists for MII mode). 

    There should already be a HalCoGen function that does this latter thing.. 

    -Anthony

  • Hello Anthony,

    thanks for the snippets. However I'm looking for the schematics that show the RMII only configuration between the RM46L852 and the PHY DP83640. On the HDK there is also MII stuff. Is there a simple working RMII schematics available?

    Best,

    -Jarno

  • Hi Jarno, 

    From an MCU perspective the RMII interface signals are a subset of the MII signals which is why you can make just a software change and the HDK will work. 
    You can see this in the TRM Figure 28-3. Ethernet Configuration—RMII Connections

    But you should probably spend a little time understanding the PHY and it's 'strap' options and make sure that you either have them pulled such that RMII will work without the MDIO writes that I pasted,   or just decide to flip the PHY into RMII mode through MDIO writes as I did.  

    (you can either 'strap' it into RMII mode or explicitly force it into that mode as I showed..) 

    This phy also has a nice feature where you give it a 25MHz clock and it can produce a 50MHz RMII master clock from it.  You may not have this feature with every phy.

    There is a special forum for ethernet Phy questions on E2E.. look under 'Interface'. 

    -Anthony

  • Thanks Anthony, I will check this out.

    Best,

    -Jarno