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 Emac loopback example error

Other Parts Discussed in Thread: SYSBIOS

Hi,


I am testing internal loopback in PA_emacExample_exampleProject on c6678 evm board.

I have bypassed PA add_ipaddress and add_port. Iam checking only MAC address and routing the packet to Host.


The packet send using send_packet is getting looped back and received under Cpsw_RxISR. But iam seeing a loss of data in receive packets. The RXGOODFRAMES is showing correct value. but when it is coming into the core, some bytes are getting missed in the packet. The loss is more when i increase the size of packet.

All the packets are getting received. RXGOODFRAMES = Number of RX interrupts coming.

But there is mismatch in RX number of bytes. RXOCTETS is equal to TXOCTETS. But the number of bytes received by host descriptor is less than RXOCTETS.

I removed prints in VerifyPacket because it was giving some runtime error. Instead i have put some variables to see the packet error.

Is the issue due to some configuration in QMSS?
Please help to resolve this issue.

  • Aswathy,

    This example is using for packet send and receive through the MAC, IP address and Port. I hope, you are disabled  the Add_IPAddress and Add_Port in the Setup_PASS(). I will check this scenario and let you know the result.

    Before going this, did you check as it is this test code with help of Readme file? Is it working properly without any changes in the test code? 

    If you done more changes in this test code, share your modified code to look and provide the technical suggestion on this.

  • Iam using pdk_C6678_1_1_2_5 for your reference.

    I tried the PA_emacExample_exampleProject without any changes. But Receive packets was 0. RxISR was not getting triggered.

    In this version of pdk, SGMII intialization is disabled by cpswSimTest = 0.
    So i enabled SGMII enable by commenting out the check of cpswSimTest.

    After this Rx interrupts was getting triggered. gRxCounter =0. But it was giving the following error for System_printf

    ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.
    xdc.runtime.Error.raise: terminating execution

    The error was coming in

    System_printf ("VerifyPacket: Byte %d expected 0x%02x, found 0x%02x\n", i, pktMatch[i], pDataBuffer[i]);

    I could verify this by putting some flag.


    Can you give any suggestions for the resolution of the problem? Also I need a solution for the runtime error when system_printf is called.

  • Aswathy,

    I have tested emac example and post here the console output here. Here, the MAX_NUM_PACKETS set to 100

  • ok. So can you suggest on how to debug the problem at my end?

  • Aswathy,

    See this E2E post, will help you.

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/341579/1193312.aspx#1193312

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

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

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

    For External Loopback:

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

  • Aswathy,

    Do you need further follow-up on your issue? I believe that, the above post will be helpful to solve your issue. Please close this thread, if there is no issue for this loopback test on your side.

  • i need more help.

    I have gone through all the posts and i have tried some of the solutions. but it is not solving the problem.

    Is it something related to the mcsdk/pdk package i am using?

    iam using mcsdk 2.1.2.5. pdk 1_1_2_5

  • Aswathy,

    Please download latest MCSDK for Keystone I device supported and try to use this one. The old version of mcsdk and pdk are using by you. TI recommends to use the latest version of packages always.

    http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/latest/index_FDS.html

  • I tried with latest MCSDK. But the result is same. I am receiving back less number of bytes.

    For 122 bytes transmitted (pktMatch), iam receiving back 92 bytes.

    In the readme file included with the PA project, there are only steps to be done for simulation.

    I guess for emulation no prerequisites need to be followed. is it true?

  • Aswathy,

    How you are validating the mismatch count of TX and RX bytes?
    Did you test this code without any modification on your end?
    Please share the files if changed anything on this project.
    I could not reproduce like your issue, If possible share some more details to reproduce.
    Yes, your understanding is correct, the readme file gives the steps for simulation. But you can identify, how to test this test code.

  • I have done some changes in pa_mgmt.c to test as per the links you have send before. Other than that I have not done any changes to the code other than for debugging.

    I am putting Tx & Rx num of bytes to some variables.  And i am viewing the variables in Memory.

    For receive i have put breakpoints in Cpsw_rxisr error condition and found that the receive length is always 92 bytes for 122 bytes transmitted.I could see the actual data in the data buffer with some bytes missing.

    When i reduce the Tx num of bytes, loss of bytes reduces.

    I have attached the c files in the code where i have made changes.


    Following is the output:

    **************************************************
    ******* 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
    Following is the ALE table before transmits.
    Packet Transmission Start ...
    Following is the ALE table after transmits.
    Packet Transmission Done.
    Wait for all packets to be Received ...
    Packets Sent        =    10
    Packets Received    =    0
    RxISRs    =    10
    Tx = 122 Bytes
    Rx = 92 Bytes

    files.zip
  • Aswathy,

    I have tested your modified code on the EVM board and also find TX and RX bytes are 122 & 126 respectively.

    But the pktMatch and pDataBuffer are the same values, which is identified by CCS memory view. I have checked the size of 122 bytes on the both buffers like TX, RX.

    In addition that, the receive buffer is allocated 1518 in the initial code like pHostDesc->origBufferLen, see the Cppi_setPacketLen call in the Setup_Rx function.

  • I made pHostDesc->origBufferLen = 1518 in Cppi_setPacketLen

    It is still not working here.

  • Is there any switch (SW) settings to be there on the EVM board?
    Presently i have put the card in Big-endian, No-boot, static ip configuration.
  • Aswathy,

    You check the board setup for no-boot as well as ethernet configuration like DHCP or Static IP. Did you check little endian mode? Normally, I used to test little endian mode.

    http://processors.wiki.ti.com/index.php/TMDXEVM6678L_EVM_Hardware_Setup

  • I have tested first in little endian mode only, because the code was in default little endian. It was also not working.

    I checked the setup. My evm board configuration is in no-boot config, static IP, Big-endian mode.
    sw3 - on, on, on, on
    sw4 - on, on, on, on
    sw5 - on, on, on, on
    sw6 - on, on, on, on
    sw9 - off, off
  • It is working now.
    I was not running the correct GEL script.

    Thank you for the help.
  • Aswathy,

    Glad to hear, Its working on your side. I hope, this will be good learning experience for you. Please always check proper gel file, switch settings(If applicable).