12-30-2009 01:28 PM
In EDK the managed C application project "lwIP Echo Server" did not work. After some experiments it turns out that the following change in "platform.c" was required to successfully ran the application:
void platform_setup_interrupts()
{
XIntc *intcp;
intcp = &intc;
XIntc_Initialize(intcp, XPAR_XPS_INTC_0_DEVICE_ID);
XIntc_Start(intcp, XIN_REAL_MODE);
/* Start the interrupt controller */
XIntc_mMasterEnable(XPAR_XPS_INTC_0_BASEADDR);
/*
** ### proper location is here...
*/
platform_setup_timer();
#ifdef __PPC__
XExc_Init();
XExc_RegisterHandler(XEXC_ID_NON_CRITICAL_INT,
(XExceptionHandler)XIntc_DeviceInterruptHandler,
(void*) XPAR_XPS_INTC_0_DEVICE_ID);
#elif __MICROBLAZE__
microblaze_register_handler((XInterruptHandler)XIntc_InterruptHandler, intcp);
#endif
#ifdef XPAR_ETHERNET_MAC_IP2INTC_IRPT_MASK
/* Enable timer and EMAC interrupts in the interrupt controller */
XIntc_mEnableIntr(XPAR_XPS_INTC_0_BASEADDR,
#ifdef __MICROBLAZE__
PLATFORM_TIMER_INTERRUPT_MASK |
#endif
XPAR_ETHERNET_MAC_IP2INTC_IRPT_MASK);
#endif
/*
** ### DO NOT PLACE
** ==>> platform_setup_timer();
** after "XIntc_mEnableIntr" since this disables Ethernet MAC interrupts!?!
*/
}
Note that platform_setup_timer() was moved to the top.
If platform_setup_timer() is called at the end of platform_setup_interrupts() it will probably disable the Ethernet MAC interrupt since platform_setup_timer() contains
XIntc_mEnableIntr(XPAR_XPS_INTC_0_BASEADDR, PLATFORM_TIMER_INTERRUPT_MASK);
(and thus no data from the MAC will be received). I don't think that PPC is affected since it works different.
Hopefully it helps people running into the same problem using MicroBlaze and Release 11.4 of EDK/SDK.
After the modification everything works fine with different telnet clients.
02-16-2010 05:24 PM
Thanks!!! This works.
My setup was the ML402 board, with emaclite and microblaze.
02-18-2010 03:08 PM
I was having the same problem with my Spartan SP601 board, and this fix solved the problem - thanks.
04-20-2010 09:32 AM
04-28-2011 11:27 AM
Hello Mr. kp9mueller,
Thanks a ton. I was stuck with this issue for more than 3 days with very little success.
Just got hold off this page and your solution worked.
Really appreciate your effort/initiate to document this.
04-28-2011 11:06 PM
Hi,
I am now trying to add my software program to process the data received from the PC.
I am currently adding it to the transfer_data() function in echo.c. I am using the XEmacLite_RecvFrame API defined for emaclite. Somehow, when I add these additional piece of code, it fails to respond.
Is this the right place to do? Do I need to call any timer functions before doing this?
Could you send me some sample working user code where XEmacLite_RecvFrame is used?
BTW, I would appreciate if someone could educate me what the *FramePtr argument should be for XEmacLite_RecvFrame.
Thanks!
04-29-2011 08:42 PM
Could anyone who have used the XEmacLite_RecvFrame or XEmacLite_SendFrame kindly reply to my above query.
Do timers or interrupts need to be called explicitly?
I am stuck and am looking for a way out.
Thanks!
05-01-2011 12:55 AM
Hi,
Could someone reply to my previous query?
Thanks!
09-01-2011 10:41 PM
Hi, I'm using EDK 13.2, where the postion of platform_setup_timer() is originally right. But still I cannot even ping my board (virtex 605) which is connnected directly with cat5 cable, not to mention the telnet trial.
Can you please help me? Thanks!
09-04-2011 11:46 AM
I cannot verify the problem you have with "lwip_echo_server". Currently I am using EDK/SDK 13.1 and indeed the position of
platform_setup_timer(); in platform.c is correct. The program should give the following output:
-----lwIP TCP echo server ------ TCP packets sent to port 6001 will be echoed back Board IP: 192.168.220.155 Netmask : 255.255.255.0 Gateway : 192.168.220.1 TCP echo server started @ port 7
(according to your IP settings).
Ping results in (sorry it's german):
C:\dobudish-1.1.4>ping 192.168.220.155 Ping wird ausgeführt für 192.168.220.155 mit 32 Bytes Daten: Antwort von 192.168.220.155: Bytes=32 Zeit=1ms TTL=255 Antwort von 192.168.220.155: Bytes=32 Zeit=1ms TTL=255 Antwort von 192.168.220.155: Bytes=32 Zeit=1ms TTL=255 Antwort von 192.168.220.155: Bytes=32 Zeit=1ms TTL=255 Ping-Statistik für 192.168.220.155: Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0 (0% Verlust), Ca. Zeitangaben in Millisek.: Minimum = 1ms, Maximum = 1ms, Mittelwert = 1ms
I used telnet on port 7 and if I enter "12345" I get this result (local echo forced on):
112233445566
Please check if the following conditions are met:
I am confident it will work for you also - good luck! :smileyhappy:
03-19-2012 05:32 AM
Hello,
I'm reading your last reply, and I have checked all the details you mentioned in my porject.
But I cannot get connected to the board.
The terminal prints what may print. And i used the ethernet cross wire.
Hoping you can read this post.
Best regards!
03-28-2013 02:42 AM
Hi sir, I am very new in EDK projects and I need an example code for the lwIP Echo- server program on xilinx EDK virtex 2 pro kit.........
Thanx in advance.....