Cora Z7: FreeRTOS – Vivado Built-in Example Code

Implementation of a simple TCP/IP server on the Cora Z7 board using FreeRTOS. This implementation is done with Vivado 2019.1, its associated SDK, and the example code included with this distribution. It will likely build and run fine with other distributions.

To start create the hardware system described in this element14 community blog. I followed the example closely except that I named the block design cora_design_1 and I added Cora’s two push buttons and the 2 RGB LEDs through and AXI_GPIO connection by dragging them from the Board tab of the Block Design window. When complete the block design appears as follows.

Block Design

After validating the the design (F6), generate the Bitstream. Launch the SDK from within Vivado; File=>Launch SDK. Alternatively export the hardware; File=>Export=>Export_Hardware and then import the hardware description file after starting the SDK separately. If you don’t already have a Workspace create one. From within the SDK create a new application program. Give it a name and choose freertos as the OS Platform. Select the processor. Choose processor zero on a dual processor system. Create a new BSP. Click “Next>”.

Create a New Application Project

Select the “lwIP TCP Perf Server” template. Click “Finish”.

TCP Perf Server Example

Build the application. The default IP address of the application is 192.168.1.10. Configure your host IP to have a static IP on the same class-C subnet. You may change the default address of the application by editing the value of the #define DEFAULT_IP_ADDRESS in the main.c source file. Connect your host PC to the Cora board with an Ethernet cable. Also connect the Cora board micro USB port to your host PC. You will need a terminal program. You can use the terminal inside the SDK program or an external terminal program. I use TeraTerm which is a free download. Open the terminal. Connect to the terminal through the Cora boards COM port. Configure the settings to the default application values of 115,200 baud, 8N1.

Right click the application project and select Run as=>Run configurations … . Configure as shown

Run Configuration

Click run. If the terminal is connected to the COM port the following startup status information will be displayed.

If using a Windows host you will need to down7load the iperf utility. Download iperf version 2. iperf3 in incompatible with the server running on the Cora board. Open a cmd or terminal window on your host PC. In windows change directory where you have put the iperf executable.

PC Host CMD Window

from the command window run,

iperf -c 192.168.1.10 -i 5 -t 90 -w 2M

The output on the Windows 10 client and the Cora Z7 server are;

iperf Client Output
iperf Server Output

You should achieve a performance of approximately 500 Mbits/sec.

To be continued in the next post.

One Reply to “Cora Z7: FreeRTOS – Vivado Built-in Example Code”

Comments are closed.