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.

CCS/TM4C1294NCPDT: Device sending packets with mac FF:FF:FF:FF:FF:FF

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

Tool/software: Code Composer Studio

I'm manually configuring and initiating the NDK stack using C code (as described in spru523k, section 2.1) and I succeeded in making a TCP connection with a server configuring my IP statically, but I was not able to get an IP using DHCP. When I analyzed the packets in Wireshark, I saw that the MAC of the DHCP request packets sending by my device was FF:FF:FF:FF:FF:FF (See figure attached)

I think the problem is that my router is not responding the DHCP request because of the wrong MAC source. This problem also occurs when the IP is configured statically, but the packet is correctly delivered because the device already has a IP assigned. (See figure attached)

Does anyone know why the MAC address is wrong in the packets and how i can solve this?

Thanks in advance,

Ronan

P.S: I have already tried to program the MAC again using UniFlash, but it doesn't make any difference.

  • Hi,

      Do you have a custom part or you are using a LaunchPad board? Normally, a launchPad will be shipped with a pre-programmed MAC address. However, for a custom part, the MAC address will not be programmed by the factory. You will need to program it yourself based on the MAC address pool that is assigned to your company, 

      You can use the Uniflash to first read the MAC address and see what is returned. If it returns all F's then it explains your problem. See below image to read the MAC address. My board has the MAC address 00-1A-B6-02-B4-BA. Yours will be different, most likely all F's currently.

      If your MAC is all F's then you need to program the MAC address. Provide your MAC address and make sure you click the 'commit MAC address' checkbox before you hit the 'Program MAC Address' button in the above picture. Again, you don't program any MAC address but a MAC address from the pool that is assigned to your company by IEEE. In the MAC that was shown above the 00-1A-B6 denotes Texas Instruments. 

  • Hi Charles,

    I'm using a LauchPad EK-TM4C1294XL. When I read the MAC address in UniFlash I got this:

    which is the same address printed under the board.

  • Hi,

      Did you call  Board_initEMAC() in your main()? Have you tried TI-RTOS Ethernet examples? If you try any of the TI-RTOS examples you will see the call to Board_initEMAC(). The Board_initEMAC() will read out the MAC address from the non-volatile memory. See below code. I will suggest you first run the TI-RTOS Ethernet examples first. If you can get them to work then you can compare it with your own application.

    In Board.h file:

    #define Board_initEMAC EK_TM4C1294XL_initEMAC

    In EK_TM4C1294XL.c file.

    /*
    * ======== EK_TM4C1294XL_initEMAC ========
    */
    void EK_TM4C1294XL_initEMAC(void)
    {
    uint32_t ulUser0, ulUser1;

    /* Get the MAC address */
    FlashUserGet(&ulUser0, &ulUser1);
    if ((ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff)) {
    System_printf("Using MAC address in flash\n");
    /*
    * Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
    * address needed to program the hardware registers, then program the MAC
    * address into the Ethernet Controller registers.
    */
    macAddress[0] = ((ulUser0 >> 0) & 0xff);
    macAddress[1] = ((ulUser0 >> 8) & 0xff);
    macAddress[2] = ((ulUser0 >> 16) & 0xff);
    macAddress[3] = ((ulUser1 >> 0) & 0xff);
    macAddress[4] = ((ulUser1 >> 8) & 0xff);
    macAddress[5] = ((ulUser1 >> 16) & 0xff);
    }
    else if (macAddress[0] == 0xff && macAddress[1] == 0xff &&
    macAddress[2] == 0xff && macAddress[3] == 0xff &&
    macAddress[4] == 0xff && macAddress[5] == 0xff) {
    System_abort("Change the macAddress variable to match your boards MAC sticker");
    }

    GPIOPinConfigure(GPIO_PF0_EN0LED0); /* EK_TM4C1294XL_USR_D3 */
    GPIOPinConfigure(GPIO_PF4_EN0LED1); /* EK_TM4C1294XL_USR_D4 */
    GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_4);


    /* Once EMAC_init is called, EMAC_config cannot be changed */
    EMAC_init();
    }

    The TI-RTOS examples can be imported from the Resource Explorer in CCS. Try the TCP_echo example first. 

  • Hi Charles,

    Thank you for helping me! I had forgotten to call the function Board_initEMAC() in my main. The problem is solved now!