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.

C6678 SGMII data transfer

Hi !

       Recently I want to develope  emac loopback utility for C6678.For this I use <PDK_INSTALL_DIR>\ti\drv\exampleProjects\PA_emacExample_exampleProject . And I  modify it ,then treat one as Sender,one as Receiver,and configure them all in Master Mode.

      In this project , it sends 10 packets by SGMII ,now I can successfully achieve the data transmission.But when I want to transmit more packets ,such as 100 packets,I find it only transmits 16 packets.Then I set the packet number  more larger ,such as 3000,at this time ,the Receiver will get 48 packets ,maybe more,but these packets are not continuous ,the situation is that : firstly receive 16 packets ,then interval for a period of time,it then receive other 16 packets ....

     So I want to know whether I do not configure something properly?And how do I configure the SGMII Example?

Thanks for any idea!

Shi

  • Hi Shi,

    Are you working on custom C6678 or EVM board? Thanks.

  • Hi K,

    Thanks for your attention! I am using my own board which has two C6678 DSPs,and I just want to using SGMII to transmit data between them. I hope I have described the question clearly.

    Wait for your reply.

    THX !

    Shi

  • Shi,

    Are you send/receive between devices(C6678) or cores?
    You can find the reference code at the below in the PDK package.
    pdk_C6678_1_1_2_6\packages\ti\drv\exampleProjects\PA_multicoreExample_exampleProject
    This code will work on between cores, but in your case please make sure the platform init call.

    You have modify this init call according to your custom board. 

    If you like to communicate between two devices, you need to configure SGMII properly.
    The below E2E post will help you.
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/202083.aspx
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/202083/719489.aspx#719489
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/196299/700615.aspx#700615

  • Hi,Pubesh

         I have seen the posts you give, here let me express my problem again.

        Firstly,I use the PA_EmacExample below in the PDK_C6678_1_1_2_6 to transmit data between two C6678 DSPs  in one board,not cores.Then I make sure the platform init call right because I have successfully achieve to transmit 10 packets from DSP1 to DSP2. But when I want to send more packets(by configure MAX_NUM_PACKETS),DSP2 which  runs Receive program only receive 16 packets,when I increase the packet number ,it can receive more but the data is not continous ,why?

    So I think it does not matter with the platform,maybe the init process' problem of PA_EmacExample,somewhere about the packet number.Can you help me check the project? 

       At last,I tell you some configurations about my project .I  configure forced link mode as in mentioned in GbE Switch Subsystem User Guide. And I choose SGMII port 1 ; cpswLpbkMode=CPSW_LOOPBACK_INTERNAL;cpswSimTest = 0,

    Thanks for your attention!

    Wait for your reply!

    Shi

  • Shi,

    Can you debug through CCS using break point(BP), find where its stopping/halting. This example code supports for 10 packets send and receive with the help of defined MAX_NUM_PACKETS. Please make sure the interrupts at the  Setup Rx / Tx functions.

  • Shi,

    You said, when sending 10 packets working. How you testing this? Is DSP1 core0 sends to DSP2 core0 receive the packets? 

  • Shi,

    Some more details for PA LLD example projects. How this will be working on EVM of C6678. 

    PA_emacExample_exampleProject works in the single core. Please find the detailes at readme file as per below.
    The CPSW (EMAC) Single core example demonstrates the use of CPSW CSL APIs to configure the ethernet switch on target (silicon and simulator). It further demonstrates the use of CPPI/QMSS/PA LLDs to send/receive data through the ethernet switch using Host descriptors on any given DSP core.

    PA_multicoreExample_exampleProject works in the multicores of C6678. Please find the detailes at readme file as per below.
    The PASS multi core example demonstrates the use of CPP/QMSS/PA/CSL APIs to send/receive data through the ethernet switch using Host descriptors in a multi core scenario. By default the project runs on 4 cores (0-3).

    Find the console message of multicore example project:

    [C66xx_2] ************************************************
    *** PA Multi Core Example Started on Core 2 ***
    ************************************************
    Waiting for global config...
    [C66xx_3] ************************************************
    *** PA Multi Core Example Started on Core 3 ***
    ************************************************
    Waiting for global config...
    [C66xx_0] ************************************************
    [C66xx_1] ************************************************
    [C66xx_0] *** PA Multi Core Example Started on Core 0 ***
    [C66xx_1] *** PA Multi Core Example Started on Core 1 ***
    [C66xx_0] ************************************************
    [C66xx_1] ************************************************
    [C66xx_0] Initializing Free Descriptors. 
    [C66xx_1] Waiting for global config...
    [C66xx_0] QMSS successfully initialized 
    CPPI successfully initialized 
    PASS successfully initialized 
    Ethernet subsystem successfully initialized 
    Tx setup successfully done 
    Rx setup successfully done 
    PASS setup successfully done 
    Waiting for all cores to reach the barrier before transmission starts ... 
    [C66xx_1] QMSS Local successfully initialized 
    [C66xx_2] QMSS Local successfully initialized 
    [C66xx_3] QMSS Local successfully initialized 
    [C66xx_1] Rx setup successfully done 
    [C66xx_2] Rx setup successfully done 
    [C66xx_3] Rx setup successfully done 
    [C66xx_1] PASS setup successfully done 
    [C66xx_2] PASS setup successfully done 
    [C66xx_3] PASS setup successfully done 
    [C66xx_1] Waiting for all cores to reach the barrier before transmission starts ... 
    [C66xx_2] Waiting for all cores to reach the barrier before transmission starts ... 
    [C66xx_3] Waiting for all cores to reach the barrier before transmission starts ... 
    [C66xx_1] Packet Transmission Start ... 
    [C66xx_2] Packet Transmission Start ... 
    [C66xx_3] Packet Transmission Start ... 
    [C66xx_1] Packet Transmission Done.
    [C66xx_2] Packet Transmission Done.
    [C66xx_3] Packet Transmission Done.
    [C66xx_1] Wait for all packets to be Received ... 
    [C66xx_2] Wait for all packets to be Received ... 
    [C66xx_3] Wait for all packets to be Received ... 
    [C66xx_1] Core 1: Packets Sent		=	10 
    [C66xx_2] Core 2: Packets Sent		=	10 
    [C66xx_3] Core 3: Packets Sent		=	10 
    [C66xx_1] Core 1: Packets Received	=	10 
    [C66xx_2] Core 2: Packets Received	=	10 
    [C66xx_3] Core 3: Packets Received	=	10 
    [C66xx_1] **********************************************
    [C66xx_2] **********************************************
    [C66xx_3] **********************************************
    [C66xx_1] *** PA Multi Core Example Ended on Core 1 ***
    [C66xx_2] *** PA Multi Core Example Ended on Core 2 ***
    [C66xx_3] *** PA Multi Core Example Ended on Core 3 ***
    [C66xx_1] **********************************************
    [C66xx_2] **********************************************
    [C66xx_3] **********************************************
    [C66xx_0] Packet Transmission Start ... 
    Packet Transmission Done.
    Wait for all packets to be Received ... 
    Core 0: Packets Sent		=	10 
    Core 0: Packets Received	=	10 
    Wait for all packets to be Received in all cores... 
    Test passed on core 0
    Test passed on core 1
    Test passed on core 2
    Test passed on core 3
    **********************************************
    *** PA Multi Core Example Ended on Core 0 ***
    **********************************************
    

  • Hi Pubesh !

    Yes,just you said,I can let DSP1 core0 send 10 packets to DSP2 core0 ,then I set MAX_NUM_PACKETS to 100,the console message as follows:

    [C66xx_24] **************************************************
    ******* Ethernet Single Core Example Start *******
    **************************************************
    QMSS successfully initialized
    CPPI successfully initialized
    PASS successfully initialized
    Ethernet subsystem successfully initialized
    Tx setup successfully done
    Rx setup successfully done
    PASS setup successfully done
    Packet Transmission Start.
    Wait for all packets to be Received ...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    Received 0 packets so far...
    [C66xx_0] **************************************************
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] ******* Ethernet Single Core Example Start *******
    [C66xx_24] Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    [C66xx_0] **************************************************
    [C66xx_24] Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    [C66xx_0] QMSS successfully initialized
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] CPPI successfully initialized
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] PASS successfully initialized
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Ethernet subsystem successfully initialized
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Tx setup successfully done
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Rx setup successfully done
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] PASS setup successfully done
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Following is the ALE table before transmits.
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Port = 0, MAC address = 00:01:02:03:04:05, unicast_type = 0
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Port = 2, MAC address = 20:21:22:23:24:25, unicast_type = 0
    [C66xx_24] Received 0 packets so far...
    [C66xx_0] Packet Transmission Start ...
    [C66xx_24] Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    [C66xx_0] Following is the ALE table after transmits.
    [C66xx_24] Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    [C66xx_0] Port = 0, MAC address = 00:01:02:03:04:05, unicast_type = 0
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] Port = 0, MAC address = 20:21:22:23:24:25, unicast_type = 0
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] SGMII_TX Packets Sent = 100
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] Packets Received = 0
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] Example Done!
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] **************************************************
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] ******** Ethernet Single Core Example End ********
    [C66xx_24] Received 16 packets so far...
    [C66xx_0] **************************************************
    [C66xx_24] Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Port = 0, MAC address = 30:31:32:33:34:35, unicast_type = 0
    Port = 2, MAC address = 50:51:52:53:54:55, unicast_type = 0
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...
    Received 16 packets so far...

    when I set BP in the CPSW_ISR of the Receiver ,I find the ISR only reponses 16 times,and the  pHostDesc->buffPtr which stores the received data also has the 16th packet's data.next is my ISR's main code modified by myself.

    ****************************************************************************************

    pCppiDesc = (Ptr) ((UInt32) pCppiDesc & 0xFFFFFFF0);

    Cppi_HostDesc *pHostDesc;
    pHostDesc = (Cppi_HostDesc *)pCppiDesc;

    DMA_Init(0);
    DMA_transportAB(0,(UInt32 *)Convert_CoreLocal2GlobalAddr((UInt32)pHostDesc->buffPtr+0x2c), pkt_size , pkt_size , (UInt32 *)(0xb0000000+pkt_size*gRxCounter*4),pkt_size, 4);
    waitDMAover(0);

    gRxCounter ++;
    /* Reset the buffer lenght and put the descriptor back on the free queue */
    pHostDesc->buffLen = pHostDesc->origBufferLen;
    Qmss_queuePush (gRxFreeQHnd, (Ptr)pHostDesc, pHostDesc->buffLen, SIZE_HOST_DESC, Qmss_Location_TAIL);

    ************************************************************

    Now I just want to know whether the PA_emacExample_exampleProject can send many packets as  I like ?

    Or  something is wrong about my configuration ? I will find the details at readme file you suggested.

    Thanks for your any idea!

    Shi

  • Shi,

    I have checked PA_emacExample_exampleProject, this project have designed to work on Core0.
    Here DNUM plays a part in how L2 is addressed. Please take a look at the function onvert_CoreLocal2GlobalAddr (cppi_qmss_mgmt.c).
    You can find that the coreNum plays a part in calculating the global address.

    Init_Qmss (Void)
    memCfg.descBase = (UInt32 *) Convert_CoreLocal2GlobalAddr ((UInt32) gHostDesc);

    Int32 Setup_Rx (Void)
    accCfg.listAddress = Convert_CoreLocal2GlobalAddr((Uint32) gHiPriAccumList);

    And also a couple other places in the code such as the Rx descriptor addresses.
    Yes, the Cpsw_RxISR function must be getting impacted as a result.
    I tried and noticed that the gTxCounter would increment fine but not gRxCounter when run on Core1.
    I believe this will help you in some way, the core change seems to have an impact on the addressing.

  • Hi ,Pubesh

          Thank you for your suggestion,I will check these places carefully.But I just tested between two DSPs which all ran core0.Then I want to know whether you tried to send more than 10 packets such as 100?Did it work?

    Thanks again for your attention!

    Shi

  • Shi,

    Shi: said:
    Then I want to know whether you tried to send more than 10 packets such as 100?Did it work?

    Yes, I have tested on EVMC6678 with CCS. See the snapshot for your reference.

  • Hi,Pubesh

    Thanks for your work.I also tested the PA_EmacExample on core 0,and the project do not need to change anything but the MAX_NUM_PACKETS ,I can also succeed to send 100 packets. But problem is when I send 100 packets between two DSPs,it does not work as this. So ask you a question ,according to TI's design,It should work no matter the project run on one or two DSPs,right? Do you have tested between two DSPs? 

    Regards

    Shi

  • Shi,

    This example code will be running on Core0 only. I have tested on EVMC6678 board which is having ONE DSP(8Cores) only. I do not have the setup like yours to test this example between two DSPs. I believe that if you are using two boards, it requires to enable the SGMII with PHY port to send the packets to external world. I think, you can use the PA Multicore EMAC example. 

  • Hi Pubesh!

    Thanks for your reply,I will do as you say.When I  make progress I will tell you.

    Regards!

    Shi

     

  • Shi,

    Do you need any further follow-up on the same? However this discussion of thread can helpful for future readers, If you close this thread.