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 : http://www.freertos.org/Free-RTOS-for-Xilinx-MicroBlaze-on-Spartan-6-FPGA.html
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.
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.
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:
Create a directory FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\Xilinx_Ethernet_Lite
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.
In the new NetworkInterface.c: Remove any SH2A specific header file includes, stub out xNetworkInterfaceInitialise() and xNetworkInterfaceOutput() [so they empty functions].
Add the following files to your project:
FreeRTOS_DHCP.c
FreeRTOS_DNS.c
FreeRTOS_Sockets.c
FreeRTOS_UDP_IP.c
portable/buffermanagement/BufferAllocation_2.c
and the NetworkInterface.c file you just stubbed out.
Copy a FreeRTOSIPConfig.h file from a FreeRTOS+UDP demo into the directory containing your FreeRTOSConfig.h file.
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.
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.
Create a directory FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\Xilinx_Ethernet_Lite. Done.
done.
In the new NetworkInterface.c I’can’t find any SH2A specific header file includes but I removed xNetworkInterfaceInitialise() and xNetworkInterfaceOutput().
done
I have FreeRTOSIPConfig.h and FreeRTOSConfig.h into the directory FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\includes\