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.

Problem during transmission of ping packet from C6678 DSP using PA_emacExample_exampleProject.

Hello all,

My task is to transmit ping packet from C6678 DSP(on our custom board) to my laptop(having fixed IP: 192,168,1,10). So far that i found "PA_emacExample_exampleProject" from the path C:\ti\pdk_C6678_1_1_2_5\packages\ti\drv\exampleProjects\PA_emacExample_exampleProject.

[C6678 DSP --> Vitesse 7421 switch--> RJ-45 connector--> laptop]

I dont know much about this project so i did some small changes here,

1) I made ICMP packet here by changing pktMatch,

UInt8 pktMatch[] = {

0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,                                       /*Dest MAC:broadcast dest MAC*/
0x00, 0x01, 0x02, 0x03, 0x04, 0x05,                                         /* Src MAC */
0x08, 0x00,                                                                                 /* Ethertype = IPv4 */
                                                                                                    /* IP version, services, total length */
0x45, 0x00, 0x00, 0x3C,                                                             /*IP data len: 60 B*/
0x00, 0x00, 0x00, 0x00,                                                              /* IP ID, flags, fragment offset */

0x64, 0x01, 0xA2, 0x4F,                                                                /*TTL: 64, ICMP protocol: 0x01, checksum*/
0xc0, 0xa8, 0x01, 0x01,                                                                /* Source IP address */
0xc0, 0xa8, 0x01, 0x0a,                                                                /* Destination IP address */

0x08, 0x00, 0xF7, 0x2D,                                                                 /*ICMP data*/
0x00, 0x0A, 0x00, 0xC8,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,            /* 32 bytes of padding data to make sure 74 bytes*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00

};

2)  Commented out below portion from cpsw_singlecore.c

/* Setup Rx */
if (Setup_Rx () != 0)
{
System_printf ("Rx setup failed \n");
BIOS_exit (-1);
}
else
{
System_printf ("Rx setup successfully done \n");
}

/* Setup PA */
if (Setup_PASS () != 0)
{
System_printf ("PASS setup failed \n");
BIOS_exit (-1);
}
else
{
System_printf ("PASS setup successfully done \n");
}

then compiled and running successfully, what i found is gTxCounter value is 10 i.e. packets are transmitted. But i didn't get any packet on system while checking in wireshark on my laptop(IP : 192.168.1.10).

console msg,

**************************************************
******* Ethernet Single Core Example Start *******
**************************************************
QMSS successfully initialized
CPPI successfully initialized
PASS successfully initialized
Ethernet subsystem successfully initialized
Tx setup successfully done
Following is the ALE table before transmits.
Packet Transmission Start ...
Tx counter value:1
Tx counter value:2
Tx counter value:3
Tx counter value:4
Tx counter value:5
Tx counter value:6
Tx counter value:7
Tx counter value:8
Tx counter value:9
Tx counter value:10
Following is the ALE table after transmits.
Packet Transmission Done.
Wait for all packets to be Received ...
Received 0 packets so far...
Received 0 packets so far...
Received 0 packets so far...
Received 0 packets so far...

pls suggest me where im doing mistakes. 

Thanks,

Gourav jain

  • Dear Gourav,
    To get the packet out, you have to disable the "loop back" mode.
    By default, the PA example is configured with loop back mode.

    Do the following in cpsw_singlecore.c

    Int cpswLpbkMode = CPSW_LOOPBACK_INTERNAL;

    To

    Int cpswLpbkMode = CPSW_LOOPBACK_NONE;
  • Hello Stalin,

    Tried your solution also but still packets are not getting out im not able to see any ICMP packet on wireshark.

    Note: im sending packets through EMAC port 2. 

    1) I made ICMP packet here by changing pktMatch,

    UInt8 pktMatch[] = {

    0x40, 0x1F, 0x32, 0x5A, 0x49, 0x2F,                                      /*Dest MAC*/
    0x20, 0x21, 0x22, 0x23, 0x24, 0x25,                                       /* Src MAC : as same as mentioned for port 1 mac address in                                                                                                                                          Init_Cpsw (Void)*/                                                                0x08, 0x00,                                                                              /* Ethertype = IPv4 */

                                                                                                       /* IP version, services, total length=60 Byte */
    0x45, 0x00, 0x00, 0x3C,                                                           
    0x00, 0x00, 0x00, 0x00,                                                             /* IP ID, flags, fragment offset */

              0x64, 0x01, 0xA2, 0x4F,                                                              /*TTL: 64, ICMP protocol: 0x01, checksum*/
              0xc0, 0xa8, 0x01, 0x01,                                                              /* Source IP address */
               0xc0, 0xa8, 0x01, 0x0a,                                                             /* Destination IP address */

              0x08, 0x00, 0xF7, 0x2D,                                                             /*ICMP data*/
              0x00, 0x0A, 0x00, 0xC8,

    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 32 bytes of padding data to make sure 74 bytes*/
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00

    };

    2)  Commented out below portion from cpsw_singlecore.c (since i just want ot transmit packets as of now)

    Initialized Main PLL(1000 MHz) and Pass PLL(1050 MHz), dont know how to verify both PLL has configured properly or not??

    /* Setup Rx */
    if (Setup_Rx () != 0)
    {
    System_printf ("Rx setup failed \n");
    BIOS_exit (-1);
    }
    else
    {
    System_printf ("Rx setup successfully done \n"); 
    }

    /* Setup PA */
    if (Setup_PASS () != 0)
    {
    System_printf ("PASS setup failed \n");
    BIOS_exit (-1);
    }
    else
    {
    System_printf ("PASS setup successfully done \n"); 
    }

    /* Wait until all packet reception is done */
    System_printf ("Packet Transmission Done.\nWait for all packets to be Received ... \n");

    while (gRxCounter != gTxCounter) {
    System_printf("Received %d packets so far...\n", gRxCounter);
    CycleDelay (10000);

    if (!cpswSimTest)
    {
    if (++ ct_show_ale >= 10) {
    view_ale_table();
    ct_show_ale = 0;
    }
    }
    }

    then compiled and running successfully, what i found is gTxCounter value is 10 i.e. packets are transmitted from Application side. But i didn't get any packet on system while checking in wireshark on my laptop(IP : 192.168.1.10).

    console msg,

    **************************************************
    ******* Ethernet Single Core Example Start *******
    **************************************************
    Main PLL setup..
    PLL1 Setup... Done.
    Main PLL is configured
    Pass PLL (PLL3) Setup ...
    PA PLL Setup... Done.
    QMSS successfully initialized
    CPPI successfully initialized
    PASS successfully initialized
    MAC Port 0 configuration is done
    configure SGMII Port against MAC port:1
    waiting for SGMII link
    MAC Port 1 configuration is done
    Ethernet subsystem successfully initialized
    Tx setup successfully done
    Following is the ALE table before transmits.
    Packet Transmission Start ...
    Tx counter value:1
    Tx counter value:2
    Tx counter value:3
    Tx counter value:4
    Tx counter value:5
    Tx counter value:6
    Tx counter value:7
    Tx counter value:8
    Tx counter value:9
    Tx counter value:10

    Following is the ALE table after transmits.
    Port = 0, MAC address = 20:21:22:23:24:25, unicast_type = 3
    Packets Sent = 10 
    Packets Received = 0 
    Example Done! 
    **************************************************
    ******** Ethernet Single Core Example End ********
    **************************************************

    pls suggest me where im doing wrong ?? Which registers i need to check ?? All the files are attached for your review.

    regards,

    Gourav. 

    emacExample.rar

  • Hello Stalin,
    Now i'm getting packet out and able to capture in wireshark. Problem was in side the function "Init_SGMII_SERDES" it was stuck for cpswSimTest=1 while in my case it was 0.

    But still there are some doubts on my mind
    1) why SGMII link is up while SERDES function isn't being called?? How SGMII link up works in force mode??
    2) How to check Pass PLL is configured properly or not??