By Adam Taylor

After a slight sojourn to look at the XADC interrupts and alarms in the Zynq SoC last week we are back on track now looking at how we can get the FreeRTOS demo up and running on the MicroZed. FreeRTOS was developed by Real Time Engineering and provides a very real benefit to embedded systems with its small footprint and very fast execution.

FreeRTOS over the years has increased in popularity to become incredibly popular and has for the last four years been a top-off-class RTOS in the EE Times embedded systems marketing survey. This is not surprising because it is totally free even for commercial applications. There’s also a certified, safety-critical version called SafeRTOS, which is available for purchase. FreeRTOS benefits from a considerable ecosystem which includes CLI, TCP/IP, UDP/IP, and file systems to reduce the time to market for many applications.

The FreeRTOS website also includes a number of discussion forums for developers and engineers to ask questions and learn about how to best use the OS ( see http://www.freertos.org/FreeRTOS_Support_Forum_Archive/freertos_support_forum_archive_index.html).

To get the demo up and running, we first need to download the FreeRTOS application, which can be obtained from http://www.freertos.org/. The current version is V8.0.1. The download includes all the architecture ports and demos, which demonstrates the small size of the RTOS—the entire download is just over 175 MB when extracted.

The downloaded zip file is self-extracting and contains links that need to be maintained so please ensure you extract the within the directory structure you want.

The next step is to import the Zynq demo project into SDK (File -> Import). This demo has been developed for the ZC702 development board and comes with a BSP and hardware definition for that particular board. However, as I am using the MicroZed board, I will be using my own hardware definition and BSP to run this demo. Thus I will be only importing the demo application.

I therefore checked only the top box to import the actual project. This requires that we change the referenced BSP for the demo application. To do this, we select the demo application and choose the “change BSP” option. Selecting the BSP of choice will of course select the reference for the hardware design.





Having referenced the desired BSP we are now in a position to build the demo application and try it on the MicroZed hardware. All of this is the same as for any of the other developments we have built over the course of this blog.

However, as we are using the MicroZed and not the ZC702 board, we need to make a slight change to the code. The demo should flash a LED on the development board. However the ZC702 uses a LED connected MIO10 while the MicroZed has a LED connected to MIO47. Making this change is very simple under the RTOSDemo application SRC folder. Select the file ParTest.c which defines the GPIO interfaces for the processor open the file and change the line as below:

#define partstLED_OUTPUT (10) //before

#define partstLED_OUTPUT (47) //after

This changes the pin mapping from MIO10 to MIO47.

The successfully running demo has a very nice command line interface (CLI) available over the RS-232 interface as well as the flashing LED. This is a very interesting interface as it allows us to see the run-time stats of all the tasks currently running. A snap shot of this appears below:

In my next blog we will look a little more at how we can use FreeRTOS to develop code to run on the Zynq SoC using some of the Zynq’s peripherals and interfaces.

Please see the previous entries in this MicroZed series by Adam Taylor:

Adam Taylor’s MicroZed Chronicles Part 43: XADC Alarms and Interrupts

Adam Taylor’s MicroZed Chronicles MicroZed Part 42: MicroZed Operating Systems Part 4

Adam Taylor’s MicroZed Chronicles MicroZed Part 41: MicroZed Operating Systems Part 3

Adam Taylor’s MicroZed Chronicles MicroZed Part 40: MicroZed Operating Systems Part Two

Adam Taylor’s MicroZed Chronicles MicroZed Part 39: MicroZed Operating Systems Part One

Adam Taylor’s MicroZed Chronicles MicroZed Part 38 – Answering a question on Interrupts

Adam Taylor’s MicroZed Chronicles Part 37: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 8

Adam Taylor’s MicroZed Chronicles Part 36: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 7

Adam Taylor’s MicroZed Chronicles Part 35: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 6

Adam Taylor’s MicroZed Chronicles Part 34: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 5

Adam Taylor’s MicroZed Chronicles Part 33: Driving Adafruit RGB NeoPixel LED arrays with the Zynq SoC

Adam Taylor’s MicroZed Chronicles Part 32: Driving Adafruit RGB NeoPixel LED arrays

Adam Taylor’s MicroZed Chronicles Part 31: Systems of Modules, Driving RGB NeoPixel LED arrays

Adam Taylor’s MicroZed Chronicles Part 30: The MicroZed I/O Carrier Card

Zynq DMA Part Two – Adam Taylor’s MicroZed Chronicles Part 29

The Zynq PS/PL, Part Eight: Zynq DMA – Adam Taylor’s MicroZed Chronicles Part 28

The Zynq PS/PL, Part Seven: Adam Taylor’s MicroZed Chronicles Part 27

The Zynq PS/PL, Part Six: Adam Taylor’s MicroZed Chronicles Part 26

The Zynq PS/PL, Part Five: Adam Taylor’s MicroZed Chronicles Part 25

The Zynq PS/PL, Part Four: Adam Taylor’s MicroZed Chronicles Part 24

The Zynq PS/PL, Part Three: Adam Taylor’s MicroZed Chronicles Part 23

The Zynq PS/PL, Part Two: Adam Taylor’s MicroZed Chronicles Part 22

The Zynq PS/PL, Part One: Adam Taylor’s MicroZed Chronicles Part 21

Introduction to the Zynq Triple Timer Counter Part Four: Adam Taylor’s MicroZed Chronicles Part 20

Introduction to the Zynq Triple Timer Counter Part Three: Adam Taylor’s MicroZed Chronicles Part 19

Introduction to the Zynq Triple Timer Counter Part Two: Adam Taylor’s MicroZed Chronicles Part 18

Introduction to the Zynq Triple Timer Counter Part One: Adam Taylor’s MicroZed Chronicles Part 17

The Zynq SoC’s Private Watchdog: Adam Taylor’s MicroZed Chronicles Part 16

Implementing the Zynq SoC’s Private Timer: Adam Taylor’s MicroZed Chronicles Part 15

MicroZed Timers, Clocks and Watchdogs: Adam Taylor’s MicroZed Chronicles Part 14

More About MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 13

MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 12

Using the MicroZed Button for Input: Adam Taylor’s MicroZed Chronicles Part 11

Driving the Zynq SoC's GPIO: Adam Taylor’s MicroZed Chronicles Part 10

Meet the Zynq MIO: Adam Taylor’s MicroZed Chronicles Part 9

MicroZed XADC Software: Adam Taylor’s MicroZed Chronicles Part 8

Getting the XADC Running on the MicroZed: Adam Taylor’s MicroZed Chronicles Part 7

A Boot Loader for MicroZed. Adam Taylor’s MicroZed Chronicles, Part 6

Figuring out the MicroZed Boot Loader – Adam Taylor’s MicroZed Chronicles, Part 5

Running your programs on the MicroZed – Adam Taylor’s MicroZed Chronicles, Part 4

Zynq and MicroZed say “Hello World”-- Adam Taylor’s MicroZed Chronicles, Part 3

Adam Taylor’s MicroZed Chronicles: Setting the SW Scene

Bringing up the Avnet MicroZed with Vivado