otzen42 wrote on Saturday, December 29, 2018:
Hi,
I admit to being a bit new to the SW relm (I’m an FPGA person by trade), so I appologize if I’m missing something obvious here. I have a Zybo-Z7 Xilinx Zynq-7000 board that I have been running FreeRTOS on. I started out using the FreeRTOS packaged into Xilinx SDK, but have recently moved to a bare metal project, and am pulling in the FreeRTOS source myself to allow more control over FreeRTOSConfig.h (which Xilinx insists on autogenerating if you use a FreeRTOS SDK project).
I have successfully integrated CLI into my project using the latest FreeRTOS-Plus demo code (from the v10.1.1 tag), and the UART command console is working great. However, I am running into issues trying to incorperate TCP & FAT into my project (end goal being to run the demo FTP server).
One question I have is what the best place to start from for this is. With TCP being part of the main release, but FAT only existing in the old 160919 labs distribution, I have been struggling to figure out where the best starting point is. I have tried following the steps outilined on https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCPIP_FAT_Examples_Xilinx_Zynq.html, but I have been unable to get the projects to build for either the MicroZed or ZC702 (running Vivado 2018.3). Since I don’t have either of those boards, I am eventually going to need to do it in my own environment as well. Without a buildable example that I understand, I have just been piecing this together by trial and error, so I may be missing something here.
To simplify things a bit, I started by trying to integrate just TCP into my project (from the v10.1.1 tag), but that is also not going well. First of all, I have had to modify all of the files in https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq to remove the “Zynq/” from the #include directives. I assume there is a way I can work around this, but I have not figured out how to get it to work with XSCT yet (I would much prefer to use a scripted build flow rather than using the SDK GUI if at all possible). I’m not sure why, but these seem to be the only files in FreeRTOS I have run into which have a directory as part of the #include.
Second, I had to remove the #include for Demo_Logging.h from https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq/uncached_memory.c, and replace the call to vLoggingPrintf with a simple xil_printf(). I was unable to locate Demo_Logging.h anywhere in the FreeRTOS SVN repo, the 160919 labs download, or my Xilinx install.
Finally, it appears that the x_emacpsif code in https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq is not compatible with the xNETWORK_BUFFER structure defined in https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/FreeRTOS_IP.h. I am getting a lot of errors about attempts to access a member called pxNextBuffer which does not exist. I have not tried reverting to the TCP code from the 160919 labs download yet, but I think that might be my next step. If possible, I would like to get this working with what is availible in the official FreeRTOS SVN repo so that I can manage it as an external to my repo.
if it is at all helpful, I am currently importing the following files into my project (XSCT seems to be automatically pulling the xemacps library from my Xilinx install for me, and if I manually include the version in the FreeRTOS repo I see the same results so I decided to stick with the latest from Xilinx unless it becomes a problem):
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/.c
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/BufferManagement/BufferAllocation_1.c
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq/.c
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/.h
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/Zynq/.h
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/include/.h
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/Compiler/GCC/.h
https://svn.code.sf.net/p/freertos/code/tags/V10.1.1/FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/include/*.h
I am incorperating the TCP into my application with a file based on 160919_FreeRTOS_Labs/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_and_FAT_Zynq_SDK/RTOSDemo/src/main.c, and have my #defines configured for mainCREATE_UDP_CLI_TASKS. It isn’t throwing any errors right now, so until I can get things to compile I am assuming it is OK (I commented out the parts that interact with the FAT library until I can get TCP working).
Any help or guidance would be greately appreciated.
Thanks!