UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor kp9mueller
Visitor
16,526 Views
Registered: ‎12-30-2009

MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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.

 

11 Replies
Newbie speccy
Newbie
16,296 Views
Registered: ‎02-10-2010

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

Thanks!!! This works.

My setup was the ML402 board, with emaclite and microblaze.

 

 

0 Kudos
Newbie billblade
Newbie
16,265 Views
Registered: ‎02-18-2010

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

I was having the same problem with my Spartan SP601 board, and this fix solved the problem - thanks.

 

0 Kudos
Visitor miracle
Visitor
15,941 Views
Registered: ‎03-08-2010

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

Many thanks! Now my echo server works fine.
0 Kudos
Visitor aarunach
Visitor
14,209 Views
Registered: ‎04-25-2011

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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.

 

0 Kudos
Visitor aarunach
Visitor
14,200 Views
Registered: ‎04-25-2011

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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!

0 Kudos
Visitor aarunach
Visitor
14,184 Views
Registered: ‎04-25-2011

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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!

0 Kudos
Visitor aarunach
Visitor
14,164 Views
Registered: ‎04-25-2011

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

Hi,

 

Could someone reply to my previous query?

 

Thanks!

0 Kudos
13,927 Views
Registered: ‎08-17-2011

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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!

0 Kudos
Visitor kp9mueller
Visitor
13,918 Views
Registered: ‎12-30-2009

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

Hi gentlebreeze5,

 

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:

  • xps_timer is present in design and interrupt is connected to interrupt controller (xps_intc)
  • Ethernet_MAC (xps_ethernetlite) has interrupt output connection to xps_intc
  • Connect your board to the same ethernet cable as an ordinary PC (direct connection PC <-> board with a normal cable does not work!)
  • watch LEDs on ethernet connector - every character you send should flash an LED (usually two times R/T)
  • the same thing happens with PING, which should/must work
  • take care of the correct network mask

I am confident it will work for you also - good luck! :smileyhappy:

0 Kudos
Adventurer
Adventurer
3,795 Views
Registered: ‎02-13-2012

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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!

 

Tags (1)
0 Kudos
Visitor sachinteotia
Visitor
3,434 Views
Registered: ‎03-28-2013

Re: MicroBlaze lwIP Echo Server Application on Spartan 3E (Rel. 11.4)

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.....

0 Kudos