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.

C6474 NDK running on each core MAC Address questions

Other Parts Discussed in Thread: LINUXDVSDK-DV

Hi,

  When I run the NDK on the 3 cores of the C6474 EVM, I see strange behavior.  If I use the default hardcoded MAC addresses (00-01-02-03-04-05, 10-11-12-13-14-15, 21-22-23-24-25), I can ping the devices (after adding entries to the host PC arp table).  However, when I use the EFUSED mac address (+2, and +4 on cores 2 and 3), I cannot ping the device (after adding the arp entries) , though the printf sequence appears exactly the same in the console.  I am using NDK 2.0.0 with CCS 3.  So here are the questions I have

1)  Why is the behavior different using MAC addresses other than the default?

2) Why do Cores 2 and 3 not respond to ARP packets to where I have to statically add them in the table?

 

Thanks,

Josh

  • Can you try to get the same mac addresses using efuse as the hard coded addresses? I beleive there is some restriction on the mac addresses that you can use. Try it out and let me know.

    Thanks,

    Arun.

  • hello,I begin to use DM6467. Can you tell me where to load the data(i.e NDK ,PSP,image,filesystem)? Or give me the URL,I go to download myself.

  • That is taken care of by the C6000 team. LEt me see if i can transfer the post.

     

    Thanks,

    Arun.

  • All DM6467 DVSDK stuff can be downloaded from the following link:

    http://focus.ti.com/docs/toolsw/folders/print/linuxdvsdk-dv.html

    Regards, Srirami.

  • I have tried the following to no avail:

    #define EFUSE_MAC, then don't overwrite the default value with the EFUSE mac addresses

     

    In ethdriver.c, there is the following code, which does not follow the guidelines in sprug08

            if((coreNum == 1) || (coreNum == 2))
            {
                for( i=0; i<6; i++ )
                {
                     bMacAddr[i] = bMacAddr[i] + coreNum ;
                }
            }

    This definitely creates an invalid MAC address - but this is not the problem, because when I change the above code to

            if((coreNum == 1) || (coreNum == 2))
            {
                for( i=5; i<6; i++ )
                {
                     bMacAddr[i] = bMacAddr[i] + 2* coreNum ;
                }
            }

    It has the same problem. 

    NOTE: this is only a problem with Cores 1 and 2

     

  • Arun,

      Is anyone using the NDK on the C6474 EVM out of the box in this capacity

    1) NDK running on each core

    2) MAC addresses derived from the EFUSE (+0, +2, +4 on each core)

    3) Ping each core, each core responds to arp packets. 

    It seems like a pretty basic thing, so if you have some sample code that will accomplish this (I would have assumed the Hello World project would work for this), I would very much appreciate it.

     

    Thanks,

    Josh

  • HI Josh,

    As I mentioned earlier try to manipulate the MAC id from EFUSE_MAC to generate the mac id as the one you statically assigned and check.

    My EFUSED_MAC was 00-01-02-03-04-05 and I generated 10-11-12-13-14-15 for core1 and 20-21-22-23-24-25 for core2 and i was able to get the IP address. I beleive all values of MAC is not valid.

     

    Thanks,

    Arun.

  • Arun,

      Here are my changes to the NDK hello world project

    1) add ethdriver.c to the project to be able to adjust the MAC address with the modification shown below

    2) make sure EFUSE_MAC is not defined

     

    You can see I have substituted the default MAC address for my EFUSE MAC addresses.

    Here are the issues with the hello world app with #if 0

    1) Core 0 works fine (both static and DHCP)

    2) Core 1and 2 initialize properly but cannot be pinged (in the case of statically assigned IP addresses), even after adding the entries into the arp table, and do not receive DHCP ip addresses

    Even with #if 1 (using default MAC addresses - not usable for a commercial application)

    1) I can ping cores 1 and 2 only after adding the arp entries - they do not respond to arp packets

     

    So, the issue is the same whether I #define EFUSE_MAC, or use the following modified code in ethdriver.c

     

       /* Generate a default MAC address to use */
        for( j=0; (Uint8)j<(ecfg.TotalNumOfMacAddrs); j++ )
        {
            addrCfg = ecfg.MacAddr[j];
            addrCfg->ChannelNum = 0;
            if( j == 1 )
                addrCfg->ChannelNum = 1;
            if( j == 2  )
                addrCfg->ChannelNum = 2;
            if( j == 3  )
                addrCfg->ChannelNum = 3;
            if( j == 4  )
                addrCfg->ChannelNum = 4;
            if( j == 5  )
                addrCfg->ChannelNum = 5;
            if( j == 6  )
                addrCfg->ChannelNum = 6;
            if( j == 7  )
                addrCfg->ChannelNum = 7;

    #if 0
               for( i=0; i<6; i++ )
            {
                 addrCfg->Addr[i] = j * 0x10 + i ;
            }
    #else
    //         The following code is added by JM
    //         This is the EFUSE mac address which I am forcing without
    //       having to #define EFUSE_MAC
    //            00-24-ba-4c-14-18
                addrCfg->Addr[0] = 0x00;
                addrCfg->Addr[1] = 0x24;
                addrCfg->Addr[2] = 0xba;
                addrCfg->Addr[3] = 0x4c;
                addrCfg->Addr[4] = 0x14;
            if (coreNum ==0)
            {
                addrCfg->Addr[5] = 0x18;
            }
            else if (coreNum == 1)
            {
                addrCfg->Addr[5] = 0x1a;
            }
            else if (coreNum == 2)
            {
                addrCfg->Addr[5] = 0x1c;
            }
    #endif

  • It is correct that when you have static IP you have to add ARP entries. But I am able to get the DHCP ip for core0 and core1. I am attaching my NDK project with this, please try it and let me know. Due to size contraints I am attaching only my SRC and example folder in NDK.

     

    Thanks,

    Arun.

    ndk.zip
  • Arun,

      It looks like your source is exactly the same as mine for all the common and evm6474 parts, except the problem I have relates to the EFUSE MAC, not the 00-01-02-03-04-05, etc. MACs.  Again, mine works fine if the MAC addresses are (00-01..., 10-11, ... , 20-21, ...).  Does your project work (get DHCP IP addresses) in either of the following circumstances:

    1) with ethdriver.c modified as in the previous post (force the EFUSE MAC address)

    2) with EFUSE_MAC defined in the project

     

    Thanks,

    Josh

  • Hi Josh,

    As far as the ARP issue is concerned, the reason the ARP request is not answered is that the broadcast can be enabled only to one channel at a time and NDK enables broadcast in channel0 whihc is used by core0 and that is why you can see core0 answering the arp while core1 and core2 are not.

     

    As for the strange behavior, I too observed that I cannot ping after setting the mac address to anything but the static MAC assigned. When i checked, I found out that the packet is filtered in the EMAC. So for some reason the EMAC is not matching the packet to channel1 MAC. I am still debugging this one, will let you know once I get this fixed.

     

    Thanks,

    Arun.

  • Hi Josh,

    Quick update: according to the developer the best example for multicore example is the benchmarking example. Check the noncopyTCP folder in the benchmark folder. I am trying to see whether this helps your purpose. I will check it up tomorrow.

     

    Thanks,

    Arun.

  • I think I may have found the problem with not being able to ping the other cores when set to EFUSE MAC:

     

    in ethdriver.c, the MAC address needs to be assigned per channel for every core, not just updating the entry for the channel corresponding to the core which is running.  I made the following changes in ethdriver.c which seems to work - haven't thoroughly tested it, but I can now ping cores 1 and 2 with EFUSE_MAC defined.

        /* Generate a default MAC address to use */
        for( j=0; (Uint8)j<(ecfg.TotalNumOfMacAddrs); j++ )
        {
            addrCfg = ecfg.MacAddr[j];
            addrCfg->ChannelNum = 0;
            if( j == 1 )
                addrCfg->ChannelNum = 1;
            if( j == 2  )
                addrCfg->ChannelNum = 2;
            if( j == 3  )
                addrCfg->ChannelNum = 3;
            if( j == 4  )
                addrCfg->ChannelNum = 4;
            if( j == 5  )
                addrCfg->ChannelNum = 5;
            if( j == 6  )
                addrCfg->ChannelNum = 6;
            if( j == 7  )
                addrCfg->ChannelNum = 7;


            if (EfuseMac)
            {
                  addrCfg->Addr[0] = bMacAddr[0];
                  addrCfg->Addr[1] = bMacAddr[1];
                  addrCfg->Addr[2] = bMacAddr[2];
                  addrCfg->Addr[3] = bMacAddr[3];
                  addrCfg->Addr[4] = bMacAddr[4];
                  addrCfg->Addr[5] = bMacAddr[5]+j*2;       

            }
            else
            {
                   for( i=0; i<6; i++ )
                {
                     addrCfg->Addr[i] = j * 0x10 + i ;
                }
            }

  • Thank you for pointing me to this project, it helped me better understand the ARP issue.

  • J.M.,


    Can you let us know what version of the NDK and CSL that you are using?  We'd like to independently reproduce and verify that we're seeing the same thing you are.


    Thanks,

    Dan

     

  • NDK 2.0.0

    CSL_C6474 v 3.0.4.0

     

    using CCS v3.3 that came with the EVM

  • Josh,

    I did manage to reproduce this today, ann we are currently trying to find the issue.  It's definitely in the handling of the EFUSE vs static MAC address. 

    I think Arun already mentioned that you need to add the ip/mac address to the arp table in order to be able to ping the 2nd and 3rd cores.  Also, one thing we noticed is that you should avoid using a multi cast mac address on cores 1 and 2.  We found that the EFUSE addresses were doing this, which was causing an emac init failure.

    We should have more details for you early next week.

    Regards,

    Dan

     

  • Josh

    I  am beginner for NDK ,now i have urgent question I want  to change client.ptj runing on core1.

    I have modified source  ethdriver.c file

    #define MASTER_CORE 1

     static Uint32 coreNum=1;

    but NDK on core1 runing with ping  is not correct ,

    I hope you can give me suggest.

    thanks

    chaoyue