This demo is indeed to explain how FreeRTOS+TCP (a scalable, open source and thread safe TCP/IP stack for FreeRTOS) can be integrated in a Xilinx SDK project. There is a more detailed explanation tutorial in the FreeRTOS webpage on how use the stack , so this demo is focused on implementing the examples in the Xilinx SDK environment using the FreeRTOS release included within the SDK installation. There is also a complete demo example for ZC702 including both TCP and FAT stacks.

Table of Contents

Files Required

The FreeRTOS TCP/IP stack can be downloaded from the FreeRTOSLabs website.

Basic Project Structure

Create a FreeRTOS empty project in the SDK using the new application wizard.

Import TCP stack to the application project (File -> Import) and select GCC compiler files and Zynq network interface files within the portable folder (Listed files bellow)

Import memory related implementations from the Zynq Demo.

Create a main.c file and copy the example code provided

Project Configuration

Configure compiler include paths to get the stack header files.

Modify IP Stack configuration file (FreeRTOSIPConfig.h) modifying the following values

Comment the following lines within uncached_memory.c to avoid compilation errors

In order to be able to implement this example, the default amount of memory pool have to be increased in the FreeRTOS configuration (Modify BSP Settings), and the heap stack increased in the linker script.

Example Demo

Configure the target IP address in the main.c file according to your setup
Note: Configure your host IP address and ensure that the target address is also in the same network address range

Create a debug configuration for the demo application and run in the target.
Check TCP/IP conectivity running a ping command from your host system to the target

Open a serial terminal and telnet terminal (ie. Kitty/Putty). Once the application is launched the initialization messages will be printed in the serial terminal. The demo consist in a echo server which would return the lines send from TCP client to the server.

Related Links