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.

TM4C1292 ncpdt-Ethernet.

Other Parts Discussed in Thread: TM4C1292NCPDT, TM4C1294NCPDT

Hello,

I am using TM4C1292 Ncpdt micro controller.For an Ethernet application i am connecting Ethernet Mac of controller to Micreal switch(MAC) using RMII Interface.

No phy between controller and switch.I am unable to do the mac configuration and initialization.I am using initialization sequence from Tiva peripheral driver library by avoiding PHY initialization and configuration.Switch will default auto negotiate(according to switch data sheet)

I am unable to establish the connection,weather my procedure is right or wrong,any ideas or suggestions,please reply.

Even in Emac reset() Api itself code is not executing.

Please Help 

Regards,

Krishnan

  • Hello Krishnan,

    Schematics please!!! The most likely cause is that the PHY clock is not being sourced to the TM4C1292NCPDT device.

    Regards
    Amit
  • Hello,

    I am attaching the schematic.
    Controller MAC and switch MAC are communicationg via RMII(no phy).To external world switch will communicate with phy.
    I am looking for how to establish mac to mac communication.
    Using MDC/Mdio we can configure switch.
    With out Phy how can i use TIVA mac to establish communication(emac.c functions only i am using from peripheral driver library .
    Any suggestions
    Plese reply
    Regards,
    KrishnanNWG.pdf
  • Hello Krishnan,

    The schematic looks fine. Did you check

    1. the 50MHz clock is toggling?
    2. Has the PM4 pin been configured as Ethernet Clock Pin?

    Regards
    Amit
  • Hello,

    The 50 mhz rmii clock is toggling fine.

    Gpiopinconfigure(pm4),This function i used properly before sysctrl peripheral enable.

    I am using tiva ware example libraries,Actually now we are trying MAC-MAC communication between Ethernet switch and Micro controller.

    So weather i have to use phy enable and phy initialization.

    The code is getting halted in EMAC RESET function,while loop.

    How to proceed please provide an answer.

    Regards,

    Krishnan

  • Krishnan G Nair said:

    How to proceed please provide an answer.

     Hi, please don't use this form of sentence, instead gently ask volunteer in community if someone can help forever in a good manner, this is imperative form and hurt people, we are not at your service.

    Krishnan G Nair said:
    The code is getting halted in EMAC RESET function,while loop.

     Before do emac reset are all register of MAC and PHY correctly loaded, MAC unit to uC in particular, are they?

    Krishnan G Nair said:

    I am using tiva ware example libraries,Actually now we are trying MAC-MAC communication between Ethernet switch and Micro controller.

     Please can you post PHY and MAC register you loaded to Micrel device?

  • Hello Krishnan

    There is no function call as Gpiopinconfigure(pm4)

    You need to first configure the IO's correctly, then use the Ethernet MAC Configuration for EMACPC to configure the Mac to externl PHY mode. I do not see any code reference to your programming of the uC correctly.

    Regards
    Amit
  • Sir,
    I am attaching my MAC and phy initialization code,please  see
    ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |SYSCTL_CFG_VCO_480), 120000000);
    //
    // Configure the device pins.
    //
    PinoutSet();
    //**********************External PHY Configuration********************************************//
    ui32PHYConfig = EMAC_PHY_TYPE_EXTERNAL_RMII;
    ui8PHYAddr = 0;
    //** MAC address to program the hardware registers, then program the MAC address into the Ethernet Controller registers**//
    sTempAddr.addr[0] = 0x01;
    sTempAddr.addr[1] = 0x02;
    sTempAddr.addr[2] = 0x03;
    sTempAddr.addr[3] = 0x01;
    sTempAddr.addr[4] = 0x02;
    sTempAddr.addr[5] = 0x03;
    //
    // Configure SysTick for a periodic interrupt.
    //
    SysTickPeriodSet(ui32SysClock / SYSTICKHZ);
    SysTickEnable();
    SysTickIntEnable();
    GPIOPinConfigure(GPIO_PM4_EN0RREF_CLK);//Reference
    //
    // Enable and reset the Ethernet modules.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_EMAC0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_EPHY0);
    SysCtlPeripheralReset(SYSCTL_PERIPH_EMAC0);
    SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0);
    //
    // Wait for the MAC to be ready.
    //
    //UpdateStatus("Waiting for MAC to be ready...");
    while (!SysCtlPeripheralReady(SYSCTL_PERIPH_EMAC0))
    {
    }
    //
    // Configure for use with the External PHY.
    //
    EMACPHYConfigSet(EMAC0_BASE, ui32PHYConfig );
    //UpdateStatus("MAC ready.");
    //
    // Reset the MAC.
    //
    EMACReset(EMAC0_BASE);/////////////////////////  Code is getting halted here/////
    //
    // Initialize the MAC and set the DMA mode.
    //
    EMACInit(EMAC0_BASE, ui32SysClock,
    EMAC_BCONFIG_MIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED, 32, 32, 0);//4,4
    //
       // Write the PHY register that tells it to start auto-negotiation.
       //
       //UpdateStatus("Starting autonegotiation...");
       MAP_EMACPHYWrite(EMAC0_BASE, ui8PHYAddr, EPHY_BMCR,
                        EPHY_BMCR_ANEN | EPHY_BMCR_RESTARTAN);
       //
       // Poll, waiting for auto-negotiation to complete.
       //
       //UpdateStatus("Waiting for autonegotiation to complete...");
       do
       {
           ui16Val = MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_BMSR);
           MAP_SysCtlDelay(ui32SysClock / (10 * 3));
       }
       while(!(ui16Val & EPHY_BMSR_ANC));
       //
       // Wait for link to be acquired.
       //
       //UpdateStatus("Waiting for link...");
       while(!(ui16Val & EPHY_BMSR_LINKSTAT))
       {
           ui16Val = MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_BMSR);
       }
       //UpdateStatus("Link acquired.");
       //
       // What's the operating speed?
       //
       ui16Val = MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_STS);
       //
       // Set the MAC to PHY communication speed and duplex mode accordingly.
       
        
      MAP_EMACConfigSet(EMAC0_BASE,
                         (((ui16Val & EPHY_STS_SPEED) ? 0 : EMAC_CONFIG_100MBPS) |
                          ((ui16Val & EPHY_STS_DUPLEX) ? EMAC_CONFIG_FULL_DUPLEX :
                           0) |
                          EMAC_CONFIG_FULL_DUPLEX |
                          EMAC_CONFIG_CHECKSUM_OFFLOAD |
                          EMAC_CONFIG_7BYTE_PREAMBLE |
                          EMAC_CONFIG_IF_GAP_96BITS | EMAC_CONFIG_USE_MACADDR0 |
                          EMAC_CONFIG_SA_FROM_DESCRIPTOR |
                          EMAC_CONFIG_BO_LIMIT_1024),
                         (EMAC_MODE_RX_STORE_FORWARD |
                          EMAC_MODE_TX_STORE_FORWARD |
                          EMAC_MODE_TX_THRESHOLD_64_BYTES |
                          EMAC_MODE_RX_THRESHOLD_64_BYTES), 0);
    //
    // Initialize the Ethernet DMA descriptors.
    //
    InitDescriptors(EMAC0_BASE);
    //
    // Program the hardware with its MAC address (for filtering).
    //
    EMACAddrSet(EMAC0_BASE, 0, (uint8_t *) &sTempAddr);
    //
    // Wait for the link to become active.
    //
    //UpdateStatus("Waiting for Link.");
    //Not working for switch but working for rj45//
    while((MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_BMSR) &
              EPHY_BMSR_LINKSTAT) == 0)
       {
       }
    //UpdateStatus("Link Established.");
    //
    // Set MAC filtering options.  We receive all broadcast and multicast
    // packets along with those addressed specifically for us.
    //
    EMACFrameFilterSet(EMAC0_BASE, (EMAC_FRMFILTER_SADDR |
    EMAC_FRMFILTER_PASS_MULTICAST |
    EMAC_FRMFILTER_PASS_NO_CTRL));
    //
    // Clear any pending interrupts.
    //
    EMACIntClear(EMAC0_BASE, EMACIntStatus(EMAC0_BASE, false));
    //
    // Enable the Ethernet MAC transmitter and receiver.
    //
    EMACTxEnable(EMAC0_BASE);
    EMACRxEnable(EMAC0_BASE);
    //
    // Enable the Ethernet interrupt.
    //
    IntEnable(INT_EMAC0);
    //
    // Enable the Ethernet RX Packet interrupt source.
    //
    EMACIntEnable(EMAC0_BASE, EMAC_INT_RECEIVE);
    //
    // Mark the first receive descriptor as available to the DMA to start
    // the receive processing.
    //
    g_psRxDescriptor[g_ui32RxDescIndex].ui32CtrlStatus |= DES0_RX_CTRL_OWN;
    -----------------------------------------------------------------------------------------------------------------------------------------------
    Emac Reset is not occuring properly,
    Any suggestions please
    Regards,
    Krishnan
  • Hi Krishnan,

    >EMAC_BCONFIG_MIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED, 32, 32, 0);//4,4

    Something gut tells me this line is where EMAC has a fit and MPU halts, do not believe it is proper to combine mixed burst with priority fixed.

    Umm perhaps try fixed burst. Datasheet discussion DMA arbitration states with mixed burst we also set a priority weight and ratio.

  • Hello Krishnan,

    Make sure that the PHY Clock is running before the EMACReset line is executed. I have had this issue earlier where the crystal was not working and the code was getting stuck in the EMACReset for the external clock to start,

    Regards
    Amit
  • >SysTickIntEnable();

    Possibly the interrupt handler is being invoked to soon?
  • Hello,

    Thank you for the information, i got now the EMACRESET issue resolved.But  i can't send data from controller to pc via switch.

    I am using RMII interface via switch and Controller.Actually switch is not configured right now as default configurations itself is enough to communicate.

    I am attaching my code also any suggestions please ...

    Regards,

    Krishnan

    onfigure_gpiopins_for_RMII()
    {
    GPIOPinConfigure(GPIO_PG3_EN0TXEN);
    GPIOPinConfigure(GPIO_PG5_EN0TXD1);
    GPIOPinConfigure(GPIO_PG4_EN0TXD0);
    GPIOPinConfigure(GPIO_PG7_EN0RXDV);
    GPIOPinConfigure(GPIO_PQ5_EN0RXD0);
    GPIOPinConfigure(GPIO_PQ6_EN0RXD1);
    GPIOPinConfigure(GPIO_PK4_EN0INTRN);
    GPIOPinConfigure(GPIO_PF2_EN0MDC);
    GPIOPinConfigure(GPIO_PF3_EN0MDIO);
    GPIOPinConfigure(GPIO_PM4_EN0RREF_CLK);
    //------------GPIO ETHERNET OPIN CONFIGURATION---//
    GPIOPinTypeEthernetMII(GPIO_PORTG_BASE, 0xB8);
    GPIOPinTypeEthernetMII(GPIO_PORTQ_BASE,0x60);
    GPIOPinTypeEthernetMII(GPIO_PORTF_BASE,0x0C);
    GPIOPinTypeEthernetMII(GPIO_PORTK_BASE,0x10);
    GPIOPinTypeEthernetMII(GPIO_PORTM_BASE,0x10);
    GPIOPadConfigSet (GPIO_PORTG_BASE, 0xB8, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
    GPIOPadConfigSet (GPIO_PORTQ_BASE, 0x60, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
    GPIOPadConfigSet (GPIO_PORTF_BASE, 0x0C, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
    GPIOPadConfigSet (GPIO_PORTK_BASE, 0x10, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
    GPIOPadConfigSet (GPIO_PORTM_BASE, 0x10, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
    GPIODirModeSet (GPIO_PORTG_BASE, 0xB8, GPIO_DIR_MODE_HW);
    GPIODirModeSet (GPIO_PORTQ_BASE, 0x60, GPIO_DIR_MODE_HW);
    GPIODirModeSet (GPIO_PORTF_BASE, 0x0C, GPIO_DIR_MODE_HW);
    GPIODirModeSet (GPIO_PORTK_BASE, 0x10, GPIO_DIR_MODE_HW);
    GPIODirModeSet (GPIO_PORTM_BASE, 0x10, GPIO_DIR_MODE_HW);
    }
    //*****************************************************************************
    //
    // This example demonstrates the use of the Ethernet Controller with the uIP
    // TCP/IP stack.
    //
    //*****************************************************************************
    int main(void) {
    //
    ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);
    //
    // Configure the device pins.
    //
    PinoutSet();
    //**********************External PHY Configuration********************************************//
    ui32PHYConfig = EMAC_PHY_TYPE_EXTERNAL_RMII;
    ui8PHYAddr = 0;
    //** MAC address to program the hardware registers, then program the MAC address into the Ethernet Controller registers**//
    sTempAddr.addr[0] = 0x01;
    sTempAddr.addr[1] = 0x02;
    sTempAddr.addr[2] = 0x03;
    sTempAddr.addr[3] = 0x01;
    sTempAddr.addr[4] = 0x02;
    sTempAddr.addr[5] = 0x03;
    Configure_gpiopins_for_RMII();
    //
    // Enable and reset the Ethernet modules.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_EMAC0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_EPHY0);
    SysCtlPeripheralReset(SYSCTL_PERIPH_EMAC0);
    SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0);
    //
    // Wait for the MAC to be ready.
    //
    //UpdateStatus("Waiting for MAC to be ready...");
    while (!SysCtlPeripheralReady(SYSCTL_PERIPH_EMAC0))
    {
    }
    //
    // Configure for use with the External PHY.
    //
    EMACPHYConfigSet(EMAC0_BASE, ui32PHYConfig );
    //UpdateStatus("MAC ready.");
    //
    // Reset the MAC.
    //
    EMACReset(EMAC0_BASE);
    //----------------------emac clock config-------------//
    //HWREG(EMAC_O_CC  ) =
    //
    // Initialize the MAC and set the DMA mode.
    //
    EMACInit(EMAC0_BASE, ui32SysClock,
    EMAC_BCONFIG_MIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED, 4, 4, 0);
    //
       // Write the PHY register that tells it to start auto-negotiation.
       //
       //UpdateStatus("Starting autonegotiation...");
       MAP_EMACPHYWrite(EMAC0_BASE, ui8PHYAddr, EPHY_BMCR,
                        EPHY_BMCR_ANEN | EPHY_BMCR_RESTARTAN);
       //
       // Poll, waiting for auto-negotiation to complete.
       //
       //UpdateStatus("Waiting for autonegotiation to complete...");
       do
       {
           ui16Val = MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_BMSR);
           MAP_SysCtlDelay(ui32SysClock / (10 * 3));
       }
       while(!(ui16Val & EPHY_BMSR_ANC));
       //
       // Wait for link to be acquired.
       //
       //UpdateStatus("Waiting for link...");
       while(!(ui16Val & EPHY_BMSR_LINKSTAT))
       {
           ui16Val = MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_BMSR);
       }
       //UpdateStatus("Link acquired.");
       //
       // What's the operating speed?
       //
       ui16Val = MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_STS);
       //
       // Set the MAC to PHY communication speed and duplex mode accordingly.
       //
      EMACConfigSet(EMAC0_BASE,
                         (((ui16Val & EPHY_STS_SPEED) ? 0 : EMAC_CONFIG_100MBPS) |
                          ((ui16Val & EPHY_STS_DUPLEX) ? EMAC_CONFIG_FULL_DUPLEX :
                           0) |
                          EMAC_CONFIG_FULL_DUPLEX |
                          EMAC_CONFIG_CHECKSUM_OFFLOAD |
                          EMAC_CONFIG_7BYTE_PREAMBLE |
                          EMAC_CONFIG_IF_GAP_96BITS | EMAC_CONFIG_USE_MACADDR0 |
                          EMAC_CONFIG_SA_FROM_DESCRIPTOR |
                          EMAC_CONFIG_BO_LIMIT_1024),
                         (EMAC_MODE_RX_STORE_FORWARD |
                          EMAC_MODE_TX_STORE_FORWARD |
                          EMAC_MODE_TX_THRESHOLD_64_BYTES |
                          EMAC_MODE_RX_THRESHOLD_64_BYTES), 0);
    //
    // Initialize the Ethernet DMA descriptors.
    //
    InitDescriptors(EMAC0_BASE);
    //
    // Program the hardware with its MAC address (for filtering).
    //
    EMACAddrSet(EMAC0_BASE, 0, (uint8_t *) &sTempAddr);
    //
    // Wait for the link to become active.
    //
    //UpdateStatus("Waiting for Link.");
    //Not working for switch but working for rj45//
    while((MAP_EMACPHYRead(EMAC0_BASE, ui8PHYAddr, EPHY_BMSR) &
              EPHY_BMSR_LINKSTAT) == 0)
       {
       }
    //UpdateStatus("Link Established.");
    //
    // Set MAC filtering options.  We receive all broadcast and multicast
    // packets along with those addressed specifically for us.
    //
    EMACFrameFilterSet(EMAC0_BASE, (EMAC_FRMFILTER_SADDR |
    EMAC_FRMFILTER_PASS_MULTICAST | EMAC_FRMFILTER_PASS_NO_CTRL));
    //
    // Clear any pending interrupts.
    //
    EMACIntClear(EMAC0_BASE, EMACIntStatus(EMAC0_BASE, false));
    //
    // Enable the Ethernet MAC transmitter and receiver.
    //
    EMACTxEnable(EMAC0_BASE);
    EMACRxEnable(EMAC0_BASE);
    //
    // Enable the Ethernet interrupt.
    //
    IntEnable(INT_EMAC0);
    //
    // Enable the Ethernet RX Packet interrupt source.
    //
    EMACIntEnable(EMAC0_BASE, EMAC_INT_RECEIVE);
    //
    // Mark the first receive descriptor as available to the DMA to start
    // the receive processing.
    //
    g_psRxDescriptor[g_ui32RxDescIndex].ui32CtrlStatus |= DES0_RX_CTRL_OWN;
  • Hi KGN,

    > i got now the EMACRESET issue resolved

    How about sharing your find?

    Still stand firm it is not proper to have mixed priority DMA arbitration with a fixed burst rate, seemingly for reasons given in the text.

    > Ethernet Mac of controller to Micreal switch(MAC) using RMII Interface.

    Not sure why you what to have External PHY communicate to switch MAC/MAC. Don't they do that normally when forming a MAC frame on the device layer?

    Perhaps you are describing  the switch port is configured 802.1q trunk port to support VLANS? If so it stands to reason you must also configure the EMAC for 802.1q VLAN frame schema.

    BTW: TTC/RTC are Ignored when (TX/RX(StoreFwd)[21,25] are set.

    Example of DMA priority burst ratio:

    /* Initialize the MAC setting the DMA mode Rx/Tx Bursts size words.
     * Set Transmit priority weight 2, Burst priority ratio 2:1.
     * EMACInit() must be called after any calls to EMACPHYConfigset().
     * REG57:0xC00 (EMACDMABUSMOD) */
    
     MAP_EMACInit(EMAC0_BASE, ui32SysClkHz,
    //EMAC_BCONFIG_FIXED_BURST | EMAC_BCONFIG_PRIORITY_FIXED |
      EMAC_BCONFIG_TX_PRIORITY | EMAC_BCONFIG_MIXED_BURST |
      EMAC_BCONFIG_DMA_PRIO_WEIGHT_2 | EMAC_BCONFIG_PRIORITY_2_1,
    			 8, 8, 0);

  • Hello Krishnan,

    As BP101 mentioned, please post the resolution.

    Secondly, did you check if the Link is being acquired by the PHY?

    Regards
    Amit
  • Hi KGN,

    See your TM4c1292ncpdt requires to add the external PHY chip just the opposite TM4C1294 where the PHY is built in.

    Do the interrupts need to be enabled for the external PHY and possibly consider to set an INT priority for the MAC?

      ui16Val |= (EPHY_SCR_INTEN_EXT | EPHY_SCR_INTOE_EXT);
      EMACPHYWrite(EMAC0_BASE, PHY_PHYS_ADDR, EPHY_SCR, ui16Val);

  • Hello BP101,

    Excellent point. Has the interrupt been enabled in the external PHY to indicate to the MAC...

    Regards
    Amit
  • HI KGN,

    Appears a few other issues  in the code you posted. Seems you started to configure the RMII PHY clock source then never finished.

    RMII clock enable source is not set (internal / external) and the TMP MAC address (01,02,03,01,02,03) may be consider invalid MAC by the switch.

    Typical code:

        //
        // If using an external RMII PHY, we must set 2 bits in the Ethernet MAC
        // Clock Configuration Register.
        //
            //
            // Select and enable the external clock from the RMII PHY.
            //
            HWREG(EMAC0_BASE + EMAC_O_CC) |= EMAC_CC_CLKEN;
    

  • Hello,

    How we resolved the EMACReset(EMAC0_BASE); Halt  Issue is 

    1)Configuration Done on RMII Signals

    GPIOPinConfigure(GPIO_PG3_EN0TXEN);
    GPIOPinConfigure(GPIO_PG5_EN0TXD1);
    GPIOPinConfigure(GPIO_PG4_EN0TXD0);
    GPIOPinConfigure(GPIO_PG7_EN0RXDV);
    GPIOPinConfigure(GPIO_PQ5_EN0RXD0);
    GPIOPinConfigure(GPIO_PQ6_EN0RXD1);
    GPIOPinConfigure(GPIO_PK4_EN0INTRN);
    GPIOPinConfigure(GPIO_PF2_EN0MDC);
    GPIOPinConfigure(GPIO_PF3_EN0MDIO);
    GPIOPinConfigure(GPIO_PM4_EN0RREF_CLK);

    2)Our TIVA_RMII_50MHZ-was unstable so we made a pull down and made it stable.

    Regarding Emac -Switch Interface problem still exist.

    3)Link LED is blinking when connecting External PHY AND PC.

    4)In TM4C1292NCPDT DATASHEET  (pAGE nO:1452 20.4 Initialization and Configuration) for RMII 

    EMACReset(EMAC0_BASE);
    HWREG(EMAC0_BASE + EMAC_O_CC) |= (EMAC_CC_CLKEN|EMAC_CC_PTPCEN);
    HWREG(EMAC0_BASE +EMAC_O_DMABUSMOD) |=(EMAC_DMABUSMOD_SWR);


    I have  done the above configuration and according to forum members suggestions i made changes the Mixed Burst and PHY interrupts.

    Still the result the same.

    I am attaching my project folder alsoCTI_NPOL_NWG.rar

     

     

  • >according to forum members suggestions?

    Not very friendly response actually not one direct reply. When someone helps it kind reward to give personal feedback even banter so we both learn new things. This is forum of collaboration!

    Good luck to you!

    Bye
  • Hello BP101,

    I am so sorry to you.

    Ok,now onwards i will make sure to give personal feedback to the particular person.Please accept this message.

    Good luck to you!.

    Regards,
    Krishnan
  • Hi All

    Can you please help to clarify my below doubts ?

    1. If I use RMII mode, the tiva datasheet listed to enable ECEXT and CLKEN bit in the EMACCC register.
    I can find CLKEN bit , but ECEXT bit is not listed in the datasheet

    2. Tiva datasheet says Select the RMII interface by programming the PINTFS bit field to 0x4 in EMACPC register
    but that register is stated as ReadOnly.. What is the bit position of PINTFS

    3. EMACPHYREAD & EMACPHYWRITE - These API's can be used to read the External PHY registers also ?
    or these API's are meant for only internal PHY inside Tiva


    Please help me on the above

    Thanks in advance
    Krishnan

  • Krishnan,
    You have yet to reply to the suspect MAC address being invalid. Stands to reason the auto negotiate mode of a switch might release (abort the TCP connection) to the client if the negotiate mode fails to establish a (MAC frame) at the MLID of the device layer in the client PHY. It would then try again a short time later to auto negotiate a link/speed. Hence one reason for flashing Link LED. Perhaps try to set the switch port or insure Auto-NEG and or set a fixed link speed connection either 10/100.

    >1. If I use RMII mode:
    Perhaps there is not an ECEXT clock input pin source on the RMII interface, suggest to check the main clock tree illustration.

    >2. Tiva datasheet says Select the RMII interface:
    Perhaps (typo) and there is no need to select RMII interface as it is the only interface for the external PHY.

    >3. EMACPHYREAD & EMACPHYWRITE:
    My belief is the PHY address field determines the PHY peripheral addressable location in both commands
  • Hello,

    Thank you for the replay.

    >1.I tried with broadcast MAC address(FF-FF-FF-FF-FF-FF) and braodcast ip(This i tested successfully for TM4C1294 UDP program(RAW SOCKET-NOT LWIP OR UIP).

    One more doubt I am having is  

    >2.what is the difference EMAC PHY WRITE and EMAC EXTENDED PHYWRITE?

    Looking forward for suggestions.

    Thanks in advance.

    Regards,

    Krishnan

  • So it seems the hardware PHY confirmed working by the UDP test and the TCP or other configuration aspect remains suspect?

    For the TM4c1294NCPDT:

    Extend write gains access to program the PHY registers via the address provided to (MII Management (Accessed through the EMACMIIADDR Register)).

    Like this:

        // Using the EMAC0 MII address field in REG5 0x10 to configure PHY MR37 (EPHYLEDCFG)
        // and reconfigure TX/RX activity for LED2, Flash 5Hz datasheet pages 1486, 1638, 1647
        // EMAC_PHY_PK4LED0LNK_PK5LED2ACTY or EMAC_PHY_PF0LED0LNK_PF1LED2ACTY
        MAP_EMACPHYExtendedWrite(EMAC0_BASE, EMAC_MIIADDR_PLA_M, EPHY_LEDCFG, EMAC_PHY_PF0LED0LNK_PF4LED1ACTY);
    
        MAP_EMACPHYExtendedWrite(EMAC0_BASE, EMAC_MIIADDR_PLA_M, EPHY_LEDCR, EPHY_LEDCR_BLINKRATE_5HZ);

  • I have similar setup TM4C1292ncpdt coupled to Microchip LAN9354 on RMII. And I ask myself exactly the same questions (1. and 2.)
    For almost a year now, have you managed to solve your problem?
  • Hello,

    I managed the issues at that time itswlf.

    Use external Rmii phy configurations for controller to initialise phy

    Remaining things are like usual procedure.

    Any more further doubts just mail me .it is as simple.

    Regards,

    Krishnan

  • Hi Krishnan,

    I'm actually working on something similar to what you were working on. I have an external RMII PHY with a TM4C129 but I'm unable to get the communication going. I see the PHY link LED but when I try to ping the TM4C129, I get nothing back. I also tried to have the TM4C129 send out a UDP broadcast, but I don't see anything on the computer. However, I do see the PHY LED blinking showing that there's activity.

    Can you share your findings, such as what is the configuration you did for the TM4C129 EMAC0?

    Thanks!