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.

PA_emacExample send&recv packet out of EVM

hi,everyone

I,ve been traped in a problem for a long time of changing the PA_emacExample into a non_loopback program,

I want to let the emac send out some packet to my pc, and receive the packet generate by my pc to do some PA classification, instead of the packet generate by the dsp itself 

I,ve tried a lot on changing the project to meet my requirements, but I think some  config is not done right on SGMII or ALE, since I can't see any packet the EVM generted send out to my pc, which connected directly to the EVM's RJ45.

heartbreak and wasted time. I wonder someone can help me out, some actual config lines is the best.

thanks. 

the version info:

mcsdk_02_00_05_17

  • more information, I'm using a c6670

    the change i'v made upon the original PA_emacExample is:

    in Init_SGMII_SERDES

    configPLL 0x00000051

    RxConfig 0x00700621 of SGMII1

    TxConfig 0x000108A1 of SGMII1


    in Init_SGMII to disable the mac-to-mac force mode, which I think its a kind of loopback. I tried to use the sgmii to PHY mode described in the GbE user guide,the config of SGMII1 is

    doSoftReset

    startRxTxSoftReset

    disableMasterMode

    enableAutoNegotiation

    endRxTxSoftReset

    sgmiiCfg.linkSpeed = 1000mbps

    sgmiiCfg.duplexMode = full duplex

    setAdvAbility

    and checked link, it's up

    cpswSimTest = 0

    cpswLpbkMode = CPSW_LOOPBACK_NONE


    that's all

    sorry about the abbreviation of the CSL function cause i'm typing with a pad.

  • I'm a new one on this, so...

    I find more things confused. 

    It's MDIO need to be config to communicate with the 88E1111, sincce in the PA_emacExample, the Init_MDIO is just returned.

    in the SendPacket() function, I can't find out which  SGMII(0\1) is the pktMatch  send out from. And if it configured to be send out from the SGMII 0, then how and where I can change it. Is it the PS_FLAGS talked in the GbE user guide? But I can't locate the register till now

    .

    in the Init_Switch, I change nothing, is there something to do here?

  • hi, everyone,  part of the problem just solved.

    If you want to send the packet the dsp generated out of the RJ45 of the EVM to your PC with the PA_emacExample, there are some coding you have to do.

    firstly,

    cpswSimTest = 0;

    CpswLpbkMode = CPSW_LOOPBACK_NONE;

    second, in Init_SGMII,  do //  to all lines in the if((macPortNum == 0)&&(cpswEVM6678))

    cause you don't want the loopback mode anymore, and It's the SGMII1 who linked to the phy.  Finally, in SendPacket, set the psFlags = 0x2, cause you want to send the packet out from sgmii1 rather than sgmii0 who linked to the AMC. then build and emulate,  you can grab packet on your PC, which you send from DSP using SendPacket.

    but, some of the phenomenon can't be explain

    1,if you don't change the psFlags in SendPacket, you can still see packet received from your PC, is it because the ALE send the packet to both of the SGMII with some unknow config?

    2, if you keep sending packet out with SendPacket, the console will tell you “No Tx free descriptor. Cant run send/rcv test”, is it forget to free the descriptor, and how

    and I will try more to find the answers of the two

  • keep going, the former 2 problem solved just by // the line if(cpswLpkMode != CPSW_LOOPBACK_NONE), which cause the psFlags not configured

    after that, we can certainly send the packet out through the SGMII we specified with the psFlags.


    and the “No Tx free descriptor” problem solved too I can send as much as I want.  without knowing  why. 

    question here need to be discussed 

  • what a nice day!

    i just realized the fuction of EVM recv&send packet from/to a outside PC, based on the PA_emacExample.

    the following step is what i did:

    1. cpswLpbkMode = CPSW_LOOPBACK_NONE

    2. set the psFlags to 2, cause the SGMII linked to the RJ45

    3. // the if line of the SendPacket,

    4. in Init_SGMII, if it's the macPortNum 0 to be configured,  don't do the linkup check or autonegcomplete check cause the EMAC0 is not connected  to a phy

    then,  after all that, you can catch ten packet the DSP send from your pc when you do the emulate

  • then let's go on to receive some packet the PC generated.

    1. exchange the origin mac address of the two EMAC port, in the definition  of macSrcAddress[2][6] in Init_Cpsw, cause I want the exact thing done by SGMII1 what used be done by SGMII0.

    2. you can find Switch_Update_Addr in the Init_Cpsw, exchange the setting of the two SGMII with the same concern in step 1

    3. in the Add_MACAddress, // the if(cpswLpbkMode = CPSW_LOOPBACK_NONE) line and the line under it. these code change the classification criteria defined in the ethInfo in former lines. 

    4. the last step is // the if(cpswLpbkMode != CPSW_LOOPBACK_NONE) line, to bypass the ALE.

    after all that, you can throw back what you grab from the pc to the EVM, and you can get the same result just like what's used to be done through a loopback in EMAC0

  • Hi Eric,

    The PA example does not program the PHY of the EVM nor does it program the SGMII's for PHY operation. This is because the PA example is meant to run in any platform so it does not have board specific programming. I believe the thread below shoudl answer your question.

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

    Regards,

    Javier

  • hi Eric,

    Thanks to your post, I was able to reconfigure nimu_eth.c provided with the platform library to work using SGMII0 rather than 1. I followed your direction and it worked out fine.

    I was just wondering if, following your changes, you faced problem on disconnection? Now that I have made this changes, when disconnection the ethernet cable, the link comes back but the library does not seem to enable receiving data or ping as a matter of fact.

    Thanks in advance

  • eric meng1 said:

    keep going, the former 2 problem solved just by // the line if(cpswLpkMode != CPSW_LOOPBACK_NONE), which cause the psFlags not configured

    after that, we can certainly send the packet out through the SGMII we specified with the psFlags.


    and the “No Tx free descriptor” problem solved too I can send as much as I want.  without knowing  why. 

    question here need to be discussed 

    This problem occurs on my EVM (C6670) as well. Just reset the EVM will do the trick. 

  • Hi Eric

    i am using c6670  and i just want to send the 10 packets defined by emac example project ..... i did all the modifications that you mentioned but i still can't capture the 10 packets by wire shark ,is there any other modifications that i should do ??

    thanks 

  • Hi Eric ,

    I am trying to send and receive the UDP  packets between PC and EVM , i am able to transmit the UDP packets from the EVM to PC , but not able to receive the UDP packets from the PC . So the receive is not working and in prints it is  showing always receive packets are zero. I am using PA EMAC example in the pdk_keystone2_3_01_04_07 for K2L  so please help me in resolving this issue.I am using small piece of C code which use windows Pcap library to send the packets from the PC.

    Regards,

    R D Nadaf