Problems about transferring data between two C6678 DSPs through ethernet

Hi everyone,

        There are two C6678 DSPs ,whose ethernet interface are connected directly, on my board.

My goal is that C6678_A sends some data and C6678_B receives them correctly. I found an example project

under pdk_C6678_1_0_0_17\ packages \ ti \ drv \ exampleProjects \ PA_emacExample_exampleProject.

The remark in the example codes says that the packets sent by the application are sent on the wire and

since the destination MAC on the packet is the Ethernet switch MAC address,the packets are received by

simulator and passed back up to the example  application for processing.

        In my case,the packets sent by the C6678_A should be received by C6678_B. So I must set  C6678_B's

IP address, MAC address and port number in codes running in C6678_A. Here are my questions.

1.  How to allocate an IP address,MAC address and port number for C6678_B?

2.  What function should be performed by the program running in C6678_B?

3. Why this project reffered above can't be run in single steps?

        I am looking forward to your reply. Thank you very much.

Best Regards,

Nuoxi

 

 

  •  Since your board with two C6678  EMACs of being directly connected is not a typical setup, this test cannot be run without modifications. Here are a couple of suggestions.

     You example code needs to run without simulator. 

    1. Modify the example running on C6678_B to do initialize and only receive,  You will need to change the IP address of the EMAC ports, in function Init_Cpsw() --> Switch_update_addr(). You do not have to run the function Setup_Tx ()
    2. Modify the example running on C6678_A to do initialize and only transmit.  You will have to change the destination address of the packet in the test, to match the ones setup in step 1. The ethernet packet is constructed in the data structure by the name ‘pktMatch.  Setup_Rx ()function can be commented out.

     Also can you confirm how the EMACs are connected. I assume, there is no PHY in between.

     In the meanwhile, I am looking to see if there is any other example that you can use instead. You can also refer ‘PA_simpleExample_exampleProject”.

     Hope this helps. 

  • In reply to Varada Bellary:

    Hi Varada,

            Thank you very much for your detailed reply. Your assumption is correct. There is no PHY in betwween.

    I will try again according to your suggestions.

    Best Regards,

    Nuoxi

  • In reply to Varada Bellary:

    Hi varada,

            I found several example projects related to ethernet. They are listed as follows:

    mcsdk_2_00_05_17 \ examples \ ndk \ helloworld \ evmc6678l ,

    mcsdk_2_00_05_17 \ examples \ ndk \ client \ evmc6678l ,

    pdk_C6678_1_0_0_17 \ packages \ ti \ drv \ exampleProjects \ PA_emacExample_exampleProject ,

    pdk_C6678_1_0_0_17 \ packages \ ti \ drv \ exampleProjects \ PA_simpleExample_exampleProject ,

    pdk_C6678_1_0_0_17 \ packages \ ti \ drv \ exampleProjects \ PA_UnitTest_testProject .

    1.    Which project is most close to my purpose?

           My purpose is to implement DSP_A sending data to DSP_B through ethernet.

    2.    I have modified the PA_emacExample_exampleProject accordng to your suggestions.

           For project running on DSP_A, the following changes are made:

            1)  Delete the function Setup_RX() , CPSW_RXISR() and verifypacket() ;

             2) Change Add_MACAddress(), AddIPAddress() and Add_Port() to match the information of DSP_B;

             3) Change Dest mac, Dest IP and UDP port in pktMatch to match the ones set in the last step;

            4) Change the function Init_SGMII_SERDES() ,for the code assumes a 125 MHz referebce clock 

                but actual reference clock on my board is 156.25 MHz.

                CSL_BootCfgSetSGMIIConfigPLL(0x41);

                CSL_BootCfgSetSGMIIRxConfig(0 ,0x00700621);

              CSL_BootCfgSetSGMIITxConfig(0 ,0x000108A1);

              CSL_BootCfgSetSGMIIRxConfig(1 ,0x00700621);

              CSL_BootCfgSetSGMIITxConfig(1 ,0x000108A1);

              =========>

              CSL_BootCfgSetSGMIIConfigPLL(0x241);

                CSL_BootCfgSetSGMIIRxConfig(0 ,0x00700611);

              CSL_BootCfgSetSGMIITxConfig(0 ,0x00010F91);

              CSL_BootCfgSetSGMIIRxConfig(1 ,0x00700611);

              CSL_BootCfgSetSGMIITxConfig(1 ,0x00010F91);

              Then build and run the project in DSP_A, the console window shows the following information.

              Error : Inserting memory region 0 . Error code -131.

             QMSS init failed.

              Do you have any advice?(The mac address,Ip addressand  port number of DSP_B have been changed  accordingly.)

     3.    For the case of PA_simpleExample_exampleProject , I didn't change anything of it .

     But it takes a long time to build and it can't generate .out file. If I build it for the second time,

    then many errors will appear.

            Please help me. I'm looking forward to your reply.

    Best Regards,

    Nuoxi

     

         

                

               

     

     

  • In reply to Nuoxi Lin:

    Nuoxi Lin

    1.    Which project is most close to my purpose?

           My purpose is to implement DSP_A sending data to DSP_B through ethernet.

    1. The NDK examples use higher layer of the stack, that is TCP/UDP and IP. That may not be required for the initial simple example of 2 DSPs communicating.

    The other tests you mention can be used for basic test. For example : “simpleExample” test does internal loopback in the CPSW. It can be run on each of the DSP and can be used as reference and good starting point.

    Nuoxi Lin
    2) Change Add_MACAddress(), AddIPAddress() and Add_Port() to match the information of DSP_B;

    Are these functions were run on DSP_A ? these functions will change the MAC, IP and port of the local c6678.      

    Nuoxi Lin
    Change the function Init_SGMII_SERDES .....(

    I will check with an expert and reply.

    Nuoxi Lin

    .... Then build and run the project in DSP_A, the console window shows the following information.

              Error : Inserting memory region 0 . Error code -131.

             QMSS init failed.

              Do you have any advice?(The mac address,Ip addressand  port number of DSP_B have been changed  accordingly.)

    Can you run this project as is, without any modifications and single step in CCS  debugger ? Can you check  the function Init_QMSS passes and returns success ?

    Nuoxi Lin

    3.    For the case of PA_simpleExample_exampleProject , I didn't change anything of it .

     But it takes a long time to build and it can't generate .out file. If I build it for the second time,

    then many errors will appear.

    I am able to import the project ‘PA_simpleExample_exampleProject’ and also build in CCS. Can you first clean and then do a fresh build.

    Other good resource for you is this post. Here the 2 6678 EVMs are communicating through the AMC connector  card  :

     

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/192039.aspx

     

    http://processors.wiki.ti.com/images/0/00/DualEVM_BOC_quick_setup_guide_09SEPT13.pdf

  • In reply to Varada Bellary:

    Hi varada,

            Thank you very much for your kind help. Now I can build  and run the PA_emacExample correctly without any modifications.

     I am modifying the  project

    under pdk_C6678_1_0_0_17\ packages \ ti \ drv \ exampleProjects \ PA_emacExample_exampleProject.

    But there are a few questions I am not so sure .

    1.  For my case, Is it right to set the global variables  as follows ?

          cpswSimTest = 0,

         cpswLpbkMode = CPSW_LOOPBACK_EXTERNAL,

         cpswEvm6678 = 1

    2. I plan to set the two DSPs as follows:

        DSPA(transmmiter): MAC address: 0x00  01  02  03  04  05,

                                               IP address :  192.168.1.1

                                              Port number : 0x1234

        DSPB(receiver)     :    MAC address: 0x20  21  22  23  24  25,

                                               IP address :  192.168.1.8

                                              Port number : 0x9a00

        Is there any problems with these settings?

    3.  For example, I want to set the mac address of DSPB in the program running in DSPB, then

    I can achieve this by seeting the Dest mac in ethInfo to 0x20 21 22 23 24 25. Right? Please confirm.

    4.  When i run the modified project, the console window shows:

        QMSS successfully initialized.

        CPPI successfully initialized.

        PASS successfully initialized.

        Ethernet subsystem successfully initialized.

        Rx setup successfully done.

        Error obtaining a Tx free descriptor.

        PASS setup failed.

        Could you give me some suggestions?

     

    Best Regards,

    Nuoxi 

     

  • In reply to Varada Bellary:

    Hi Varada,

            I have been modifying the PA_emacExample_ExampleProject for several days but they still can't work correctly.

    I think i must have mistaken something. So I attach my projects . I will be very grateful if you can help me

    to have a look and give me some advice. The project named VPX_D6678_Ethernet_TX will be run in DSPA

    and the other will be run in DSPB.

            1.  I plan to set the mac address , IP address and port number as follows.

                DSPA:  ethernet switch port 0 : mac address---> 0x00 01 02 03 04 05,

                              ethernet switch port 1 : mac address---> 0x10 11 12 13 14 15,

                              ethernet switch  port 2: mac address---> 0x20 21 22 23 24 25  ,   IP address--->192.168.1.2 ,  UDP port number : 0x2000.

                DSPB:  ethernet switch port 0 : mac address---> 0x30 31 32 33 34 35,

                              ethernet switch port 1 : mac address---> 0x40 41 42 43 44 45,

                              ethernet switch  port 2: mac address---> 0x50 51 52 53 54 55  ,   IP address--->192.168.1.8 ,  UDP port number : 0x8000

                 The ethernet switch port 2 of DSPA is connected to port 2 of DSPB without PHY.So I consider port 2 of DSPA as souce port

    and that of DSPB as dest port.

            2.  The codes i modified are mainly listed as follows.

             cppi_qmss_mgmt.c  : data structure pktMatch,

                                                       function sendpacket() : psFlags = 0x 1---->psFlags = 0x2.

            cpsw_mgmt.c   :     Init_SGMII(),

                                              Init_SGMII_SERDES().

             pa_mgmt.c     :    varariable srcMac[6],

                                            Add_MACAddress(),

                                            Add_IPAddress(),

                                           Add_port().

              spsw_singlecore.c   :   global variable cpswSimTest = 0,

                                                         cpswLpbkMode = cpsw_LoopBACK_EXTERNAL,

                                                         cpswEvm6678 = 1.

            3. When I built and ran the two projects, the console window showed the following information.

      C66xx_0 is the core 0 of DSPA and C66xx_8 is  the core 0 of DSPB.

    [C66xx_0] **************************************************
    [C66xx_0] ******* Ethernet Single Core Example Start *******
    [C66xx_0] **************************************************
    [C66xx_0] QMSS successfully initialized
    [C66xx_0] CPPI successfully initialized
    [C66xx_0] PASS successfully initialized
    [C66xx_0] Ethernet subsystem successfully initialized
    [C66xx_0] Tx setup successfully done
    [C66xx_0] Timeout waiting for reply from PA to Pa_addMac command
    [C66xx_0] PASS setup failed
    [C66xx_8] **************************************************
    [C66xx_8] ******* Ethernet Single Core Example Start *******
    [C66xx_8] **************************************************
    [C66xx_8] QMSS successfully initialized
    [C66xx_8] CPPI successfully initialized
    [C66xx_8] PASS successfully initialized
    [C66xx_8] Ethernet subsystem successfully initialized
    [C66xx_8] Rx setup successfully done
    [C66xx_8] Error obtaining a Tx free descriptor
    [C66xx_8] PASS setup failed                                        

           I am looking forward to your reply. Thank you very much .

    Best Regards,

    Nuoxi 

  • In reply to Nuoxi Lin:

    Thanks for the detail description of your setup. 

    I am looping an expert to answer your Qs, about the PA setup errors on DSP_A and DSP_B

    I think you are doing all the setup correct. 

    One suggestion : Can you try with “cpswLpbkMode == CPSW_LOOPBACK_NONE”

  • In reply to Varada Bellary:

    HI Varada,

            Thank you for your sustaining help. I will try according to your suggestion.

    In addition, please inform me if you get more information.

    Thanks in advance.

    Best Regards,

    Nuoxi

  • In reply to Nuoxi Lin:

    Hello Nuoxi,

    Expert says :

    "It is maybe a cache related problem?  Where are the CPPI descriptors and Tx buffers?  You can ask this customer to dump memory 0x2000000 to see whether that 1 appears at address 0x2000000."

    Regards,

    Varada