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.

MAC address in EMAC



Hi, guys! I have tested the EMAC example(CCS3.3\boards\evmc6474_v1\tests\emac) on C6474 EVM in external loopback mode, and the program works well. But what confused me is that why the program use 00_01_02_03_04_05 as the source MAC address? Why the real MAC address(from EFUSE) is not used?

  • Is there anyone could offer me any help?

  • Hi Kaiqi,

    I'm afraid that I'm not a designer, but I guess it intended to show the nature of the problem instead of showing how to read EFUSE.  In addition, it shows capability that we can assign arbitrary source MAC address if we need.

    Are you looking for how to read EFUSE MAC address of C6474?

    Best Regards,
    Atsushi

  • Yokoyama,

    Thanks for your answer! I know how to read EFUSE MAC address of C6474. Currently I have completed a program which fulfill the communication between two C6474 EVMs based on the originall external loopback example, and the program works well. But when I changed the source mac address and receive mac address from EFUSE MAC address of two EVM boards to 00_01_02_03_04_05(loopback mac address), the program finished in successful result, too. And I don't know why the loopback mac address still works in the program, do you have any advice?

    Best Regards,

    Kaiqi

  • Kaiqi,

    Could you clarify the following for two EVM?

    • Source MAC address of transmitted Ethernet frames
    • Destination MAC address of transmitted Ethernet frames
    • EMAC receive addresses set by MACINDEX, MACADDRLO and MACADDRHI.  (Explained in the 2.10.3 Receive Channel Addressing of SPRUG08B).

    Did you connect two EVMs by UTP Ethernet cable, correct?

    In addition, could you explain what you meant "loopback mac address"?  I'm afraid that I don't understand what the loopback address meant.

    Regards,
    Atsushi

  • Yokoyama,

    Yes, I use UTP Ethernet cable to connect two EVMs

    • source MAC address of transmitted Ethernet frmaes set by MACSRCADDRLO and MACSRCADDRHI is 00_01_02_03_04_05(loopback address, the arbitrary address we used in loopback mode)
    • destination MAC address is not set in this program(I searched through all the code and in nowhere the destination address is set)
    • EMAC receive address is 00_01_02_03_04_05(I have tried the EFUSE address of transmitter and it works as well

    Regards,

    Kaiqi

  • Hi Kaiqi,

    > source MAC address of transmitted Ethernet frmaes set by MACSRCADDRLO and MACSRCADDRHI is 00_01_02_03_04_05(loopback address, the arbitrary address we used in loopback mode)

    Did you set same source addresses for the two EVMs?

    > destination MAC address is not set in this program(I searched through all the code and in nowhere the destination address is set)

    Destination address is put in the packet data itself.  If I'm looking at the same code, you will see the following fragment of code.

        for(j=0; (Uint8)j<(ecfg.TotalNumOfMacAddrs); j++){
            addrCfg = ecfg.MacAddr[j];
            addrCfg->ChannelNum = 0;       
            if(j>=3 && j<6)
                addrCfg->ChannelNum = 1;
            if(j>=6 && j<9)
                addrCfg->ChannelNum = 2;
               for (i=0; i<6; i++){
                 addrCfg->Addr[i] = j * 0x10 + i;   // <-- Here
            }
        }

    I think the commented line is setting the destination address and it will be copied into the Ethernet frame.

    My recommendation is observing packets (or Ethernet frames) by Wireshark which runs on your PC.  It will help us to understand what is actually transmitted by EVM.

    Regards,
    Atsushi

  • Yokoyama,

    Thanks for your answer! By checking every register in the program, I think I have got the answer. The RXPROMCH bit in the RXMBPENABLE is set, so all frames could be sent to packet buffer, no matter the mac address matches or not.

    And I searched my code, the fragment of code you posted couldn't be found. Could you offer me the soure code?

    Regards,

    Kaiqi

  • Hi Kaiqi,

    Good to hear that you found the root cause to receive any Ethernet frames.  Yes, RXPROMCH will let EMAC receive any frames regardless the destination address in the frame.

    > And I searched my code, the fragment of code you posted couldn't be found. Could you offer me the soure code?

    The code came from C6474 CSL.  You can download CSL by the following URL.

    It is shown in the C6474 website (http://www.ti.com/product/tms320c6474).

    Regards,
    Atsushi