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.

TM4C129XNCZAD: NDK RMII MDC documentation or examples

Part Number: TM4C129XNCZAD
Other Parts Discussed in Thread: TM4C1292NCPDT

Hi,

Can anyone point me to documentation for using an external PHY and MDC port on the TM4C129X with NDK. I will be controlling a switch using RMII to talk to the RMC. Can this be achived with the NDK libraries or will they need to be mosified and re-compiled.

Thanks,

Richard. 

  • Hi Richard,

      Sorry, we don't have a documentation or example that shows how to interface with an external PHY and I'm not an expert in NDK either. You will need to modify the driver to support external PHY. This is what I will suggest:

      - Get a stock NDK example to run on the EVM board which uses the integrated PHY. Please get this example to work first and get a feel for how NDK operates. You can start with the tcpecho example. The example should work out of box. Capture the wireshark. Use this as your reference for debugging future projects. 

      - The driver that configure the integrated PHY is in C:\ti\tirtos_tivac_2_16_00_08\products\tidrivers_tivac_2_16_00_08\packages\ti\drivers\emac\EMACSnow.c You will need to modify this file. You can modify it and then rebuild the NDK library or an easier method is to just copy this file to your project directory and rebuild it. 

      - Modify EMACSnow.c for external PHY. There is a EMAC_PHY_CONFIG MACRO that is defined for internal PHY that is set to EMAC_PHY_TYPE_INTERNAL. You will need to modify to below. 

    #define EMAC_PHY_CONFIG EMAC_PHY_TYPE_EXTERNAL_RMII

      - Your application must include code to configure the GPIO pins for RMII/MII functions by calling GPIOPinTypeEthernetMII(). This is very important. If you do not configure the GPIO muxing circuit to use for Ethernet RMII or MII then they remain as GPIO pins only. So check it carefully that all relevant pins are properly configured. For example. the below two calls to configure PP0 for EN0INTRN for TM4C1292NCPDT device. 

    MAP_GPIOPinConfigure(GPIO_PP0_EN0INTRN);
    GPIOPinTypeEthernetMII(GPIO_PORTP_BASE, GPIO_PIN_0);

     - I don't know which external PHY you are using. Your external PHY should have a register that indicates link status if the PHY is up and running. You should check such register to make sure PHY is up.  In EMACSnow.c file there is the function EMACSnow_isLinkUp that checks if the PHY is up. EMAC uses the MDIO interface to read the register. Make sure you can read/write to your external PHY via the MDIO interface. 

    - Make sure you are getting EN0REF_CLK at 50Mhz  from the external PHY to the EMAC controller if you are are running in RMII mode.

    - Double check that yre you in correct MII or RMII mode. You can read the  EMACPC register at 0xFC4 to verify this. 

    At the high level this is what I can think of to support external PHY via RMII/MII. Sorry for lacking an example and documentation. 

  • Charles,

    At least I have a starting point.

    Thank you.

    Richard.