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.

question about the EMAC UDP

Other Parts Discussed in Thread: DP83640, TMS570LS3137

Hi,

I encountered a strange question when using the lwip. I initialize the EMAC with the lwIPInit() function from the lwiplib.c(source file from the ports folder of the lwip-1.3.2 from the EMAC example). The function return the right IP address then bind and connect the board and the PC right. After that, I just send the data through the udp_send() function.

The strange thing is when I push the reset button(nPORST pin low), sometimes(1 of 6 or 7) the board just send a ARP request and PC reply with a ARP, while the UDP data packet is not send properly, when you send a packet from the PC to the board, the board got nothing(the  udp_bind and udp_connect function retruns ok).

But sometimes(about 6 of 7), the board can send the UDP data packet rightly after the PC's ARP reply, and can receive the UDP packet sended by PC after that.

I don't konw why is that happen, do you anyone encounter this problem before?

Is there any problem about the hardware led to that?

Regards,

yong

  • Hello Yong,

    I have forwarded your question to one of our EMAC experts. They should get back with you shortly.

  • Hi,

    I want to know if your EMAC experts can help me with that problem? Now what I think is to send a PING command to make sure that the data can be transfered from the target board to the PC, if the board can receive a reply, then can go to next step,if not, reinitialize the program.

    I don't know whether that works. If it can work, is there any API function in the Lwip stack can send a PING command to the PC?

     Truely need your help!

    Regards,

    yong

  • Hi Yong,

    Can you please send me your project for checking?  

    qjwang@ti.com

    Regards,

    QJ

  • Hi, QJWang

    I've send the project to you already. I just debug the board myself, I found that the data cannot send out because of the board cannot receive paskets(no matter what packet), the EMACCore0RxIsr() function in the program cannot be entered at all.

    I just use the oscilloscope to test the RXD[0,1,2,3] pins(43,44,45,46 pins of the DP83640), I found that when the problem(board cannot receive data) happens, the RXD1,2,3 pins are always high while RXD0 pin is always low.The four pins should be high or low timely according to the data received. 

    How does this happen? Is something initialized to be wrong? If it's a hardware problem, the data should be lost whether the board can receive data, while now the fact is if it receive the PC's ARP response just after the Initialize at the very begining, it will always can receive the data. If it cannot receive the data at the begining, it will not receive one packet any more.

    I hope you can help me with it.

    Regards,

    yong

  • I just test the RD+,- pins of the DP83640, when everything is ok(can receive and send packets), the RD+,and RD- pins' mean value is about 3.1v, the frequency is about 29Mhz, amplitude is about 2.6v. While, when the board cannot receive packets, the mean value is 3.1v too, but the frequency is about 33MHz, the amplitude is about 3.6v. 

    Does it make any sense?

    By the way, no matter the board can receive packet or not, it can always send packets

    Regards,

    yong 

  • Yong,

    If you're having trouble with the phy itself,  you might try posting on this forum page so it gets to the right product group at TI:    http://e2e.ti.com/support/interface/ethernet/default.aspx

    They'll know much more about the DP83640 itself.   To me it sounds like you might be at that point.

  • Thanks for replying, I just cannot make sure what reason makes that happen. The PHY maybe the reason,but I'm not sure with it. I'll put it on the forum you suggest later.Another I want to know is that If I can reset the program with the chip TMS570LS3137 just like its DWWD does(What I want to do is to reinitialize the part of the EMAC program)? And still a question about the reset in the program, If the program is not perfect, it will always reset, If so,how to stop the reset and load the new version program into the MCU?

    However, there are some other problem with the program. The program may runaway once receive the Ethernet data in the while cycle  of the sys_main.c. If I comment out the program in the while cycle, It will be ok to run just with the "while(1)

    {

    }"

    The attach file is my project, you can just comment out the functions about the can bus test.

    3036.Timer 0904.rar

    Hope you can help me with it 

    Regards ,

    yong

  • Now, it seems that the hardware design may be the reason, I have solve the problem, while the runaway is because of the stack pointer overflow,  expanded the stack would work.

    Thanks for the above replys !

    Regards,

    yong