FreeRTOS on Xilinx ML605 with Microblaze - problem with Ethernet

roberto-plus wrote on Thursday, October 31, 2013:

Hello guys,
I’m using FreeRTOSv7.5.3 on xilinx ML605 with soft processor Microblaze.
For to create a new project I’m following this guide :
and until now I have no problems in the management of task and aquire data from peripherals.
Now, I would like send this data to a NAS for writing on file. I need to use Ethernet but I don’t know how.
Thank you at all.

rtel wrote on Thursday, October 31, 2013:

I think the BSP used in that demo is already using lwIP, so presumably the MAC is included in the FPGA design. You can look at the code that is already using lwIP, but if you need instruction on using lwIP I would suggest using the Wiki and mailing lists dedicated to that subject.


roberto-plus wrote on Thursday, October 31, 2013:

Hi Richard, thank you for answer.
I m reading about lwIP but if possibile I’d rather use UDP protocol.
If I try by the down guide :
I have a lots of problems with including libraries.
I have the same problem if I try to create a new project without this guide:

I tried many time to import the source and include freeRTOS files but with the same useless result.

Best Regards.

rtel wrote on Thursday, October 31, 2013:

I think the project already contains a low level driver to link lwIP into the Ethernet peripheral drivers provided in the Xilinx BSP. I would recommend the following:

  1. Create a directory FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\Xilinx_Ethernet_Lite

  2. Copy the file NetworkInterface.c from the \FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\SH2A directory into the directory you just created. The SH2A interface is very basic (no zero copy) so is a good starting point.

  3. In the new NetworkInterface.c: Remove any SH2A specific header file includes, stub out xNetworkInterfaceInitialise() and xNetworkInterfaceOutput() [so they empty functions].

  4. Add the following files to your project:

and the NetworkInterface.c file you just stubbed out.

  1. Copy a FreeRTOSIPConfig.h file from a FreeRTOS+UDP demo into the directory containing your FreeRTOSConfig.h file.

  2. Add the following paths to your include path:


  1. Try compiling and tidy up any errors.

Once you have it compiling you can remove the lwIP code, and the functions that initialise the lwIP demo, and implement the functions that were stubbed out in NetworkInteface.c by calling the Xilinx Ethernet driver functions as appropriate. You will also need to implement a function that passes received packets into the FreeRTOS+UDP task on a queue. You can find examples of how to do that in the other NetworkInterface.c files for the other chips. For example, in the LPC17xx driver ENET_IRQHandler() is the Ethernet interrupt handler, and it unblocks the prvEMACHandlerTask() task each time a packet is received. The prvEMACHandlerTask() places a reference to the received Ethernet frame into a structure obtained by calling pxNetworkBufferGet(), then posts the structure by reference onto the queue called xNetworkEventQueue.


roberto-plus wrote on Monday, November 04, 2013:

Hi Richard,
I’m trying but I still have problems.
I made a new project as FreeRTOS hello world and it compiles with no problem.

  1. Create a directory FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\Xilinx_Ethernet_Lite. Done.
  2. done.
  3. In the new NetworkInterface.c I’can’t find any SH2A specific header file includes but I removed xNetworkInterfaceInitialise() and xNetworkInterfaceOutput().
  4. done
  5. I have FreeRTOSIPConfig.h and FreeRTOSConfig.h into the directory FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\includes\
  6. done.

when I try to compile this is the output :

Do I need the #include “hwEthernet.h”?
Best Regards.

roberto-plus wrote on Monday, November 04, 2013:

If I remove xNetworkInterfaceInitialise() and xNetworkInterfaceOutput() and #include “hwEthernet.h” I have this error:

rtel wrote on Monday, November 04, 2013:

I replied to your other (same) thread.