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.

TM4C1294NCPDT: Ethernet activity LED (PK5) is not working in TM4C1294NCPDT

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hello team,

We are using a customized board which has TM4C1294NCPDT microcontroller. In that we have used PK_4 and PK_5 Pins as Ethernet link/Activity LED's. Currently we are testing using enet_io Tivaware code and changed Ethernet LED code part in drivers/pinout.c file as below.

MAP_GPIOPinConfigure(GPIO_PK4_EN0LED0);
MAP_GPIOPinConfigure(GPIO_PK5_EN0LED2);

MAP_GPIOPinTypeEthernetLED(GPIO_PORTK_BASE, GPIO_PIN_4 | GPIO_PIN_5);

After doing the above configuration, both PK4 and PK5 LED's are acting as Link LED only. But as per the tm4c1294ncpdt datasheet(section 20.4.2.4), PK5(EN0LED2) should act as activity LED. Please give us clarification about this issue.

Thank you.

  • Hello Chethan,

    So the datasheet is slightly wrong in that statement on 20.4.2.4. Its only LED1 that is setup to be a TX/RX Activity LED. LED2 is set to indicate 100-Base TX. You'll see the actually 'at reset' settings for LED1 is 0x01 and LED2 is 0x05. So what you see seems to be accurate to the actual device settings.

    You can just configure the EPHYLEDCFG register with hardware level calls. I was surprised we don't have a TivaWare function for that, but you'll find hw_emac.h has the register defined as EPHY_LEDCFG and then starting on Line 1745 the following definitions are provided:

    #define EPHY_LEDCFG_LED2_M      0x00000F00  // LED2 Configuration
    #define EPHY_LEDCFG_LED2_LINK   0x00000000  // Link OK
    #define EPHY_LEDCFG_LED2_RXTX   0x00000100  // RX/TX Activity
    #define EPHY_LEDCFG_LED2_TX     0x00000200  // TX Activity
    #define EPHY_LEDCFG_LED2_RX     0x00000300  // RX Activity
    #define EPHY_LEDCFG_LED2_COL    0x00000400  // Collision
    #define EPHY_LEDCFG_LED2_100BT  0x00000500  // 100-Base TX
    #define EPHY_LEDCFG_LED2_10BT   0x00000600  // 10-Base TX
    #define EPHY_LEDCFG_LED2_FD     0x00000700  // Full Duplex
    #define EPHY_LEDCFG_LED2_LINKTXRX                                             \
                                    0x00000800  // Link OK/Blink on TX/RX Activity
    #define EPHY_LEDCFG_LED1_M      0x000000F0  // LED1 Configuration
    #define EPHY_LEDCFG_LED1_LINK   0x00000000  // Link OK
    #define EPHY_LEDCFG_LED1_RXTX   0x00000010  // RX/TX Activity
    #define EPHY_LEDCFG_LED1_TX     0x00000020  // TX Activity
    #define EPHY_LEDCFG_LED1_RX     0x00000030  // RX Activity
    #define EPHY_LEDCFG_LED1_COL    0x00000040  // Collision
    #define EPHY_LEDCFG_LED1_100BT  0x00000050  // 100-Base TX
    #define EPHY_LEDCFG_LED1_10BT   0x00000060  // 10-Base TX
    #define EPHY_LEDCFG_LED1_FD     0x00000070  // Full Duplex
    #define EPHY_LEDCFG_LED1_LINKTXRX                                             \
                                    0x00000080  // Link OK/Blink on TX/RX Activity
    #define EPHY_LEDCFG_LED0_M      0x0000000F  // LED0 Configuration
    #define EPHY_LEDCFG_LED0_LINK   0x00000000  // Link OK
    #define EPHY_LEDCFG_LED0_RXTX   0x00000001  // RX/TX Activity
    #define EPHY_LEDCFG_LED0_TX     0x00000002  // TX Activity
    #define EPHY_LEDCFG_LED0_RX     0x00000003  // RX Activity
    #define EPHY_LEDCFG_LED0_COL    0x00000004  // Collision
    #define EPHY_LEDCFG_LED0_100BT  0x00000005  // 100-Base TX
    #define EPHY_LEDCFG_LED0_10BT   0x00000006  // 10-Base TX
    #define EPHY_LEDCFG_LED0_FD     0x00000007  // Full Duplex
    #define EPHY_LEDCFG_LED0_LINKTXRX                                             \
                                    0x00000008  // Link OK/Blink on TX/RX Activity

    Best Regards,

    Ralph Jacobi

  • Thank you Ralph Jacobi,

    We have already configured  PK_4 and PK_5 Pins for Ethernet link/Activity LED's in our customized board, now cant we use that Pins by modifying 

    some resister or code?

    is there any other possibility to make them work. Please give us clarification about this issue.

    thanks regards 

    Chethan

  • Hello Chethan,

    We have already configured  PK_4 and PK_5 Pins for Ethernet link/Activity LED's in our customized board, now cant we use that Pins by modifying 

    some resister or code?

    Can you post the code used to do this? The code you posted previous just enables them for Ethernet peripheral usage, it does not explicitly turn them into LEDs that shows Ethernet Activity.

    Best Regards,

    Ralph Jacobi

  • Hi Ralph Jacobi,

    We have used enet_io Tivaware library code. We have only modified the drivers/pinout.c file. We have replaced PF_0 and PF_4 with PK_4 and PK_5 respectively as mentioned in the earlier code snipped.

     Do we need to add/modify the code anywhere else to make PK_4 and PK_5 work as ethernet link and activity LED respectively?

    I have tested the same code using EK-TM4C1294XL Launchpad and I have configured PK_6 also as ethernet led. What I observed was, PK_6 is properly working as activity LED. The issue is only with PK_5.

    Thank You,

    Regards,

    Chethan

  • Hello Chethan,

    So what you are running into is the following:

    PF0 & PK4 both map to LED0.

    But PF4 maps to LED1 and PK5 maps to LED2.

    The enet_io example does not change any register configurations for the LEDs because PF4 maps to LED1 which is set to show RX/TX Activity.

    However when you now use LED2 in your application, you must change the default register setting from 0x05 to 0x01 to get RX/TX Activity to show up on LED2.

    PK5 will not show RX/TX Activity until you change the EPHY_LEDCFG setting.

    Best Regards,

    Ralph Jacobi