UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Adam Taylor’s MicroZed Chronicles Part 44: MicroZed Operating Systems—FreeRTOS

by Xilinx Employee on ‎08-02-2014 11:01 AM (228,017 Views)

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.

 

 

 

 Image 1.jpg

 

 

Image 2.jpg

 

 

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.


 

 

Image 3.jpg

 

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:

 

 

 Image 4.jpg

 

 

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

 

 

Comments
by Explorer
‎08-03-2014 01:24 AM - edited ‎08-03-2014 01:05 PM

hi Adam

 

nice tutorial, as an introcution to FeeRTOS, by the way, i used it , just to test the similar application, ( on zedboard), but i conclude that the standalone demo, is more fast, but FreeRTOS, as you mentioned, there is some more option, like the command line interface, whitch abscent when we use standalone demo, ( it's take more time, to code it ).

 

thank you Adam, and by the way, am so apraciate for the previouse tutorial, it's work on my board Smiley Wink

 

 

have a nice week

by Adventurer
on ‎08-04-2014 01:34 PM

Do be aware of context switching w/ FreeRTOS; a user just posted in the forums about discovering that the stdlib implementations of functions like memcpy/memset utilize the 64-bit NEON instructions to reduce the number of cycles required, but those registers are not preserved during a context switch, resulting in possible data corruption that could be tricky to track down.

by Explorer
on ‎08-05-2014 01:05 AM

@movax 

 

i don't think so,  Neon can't work with  64bits instruction , because this architecture is availbe only with 32 bits 

by Newbie tmco
on ‎08-18-2014 07:39 AM

Hey Adam. thanks for your tutorial. I tested that on my board, and  it worked very nicely. Waiting for your next post

by Explorer
on ‎09-11-2014 03:11 PM

hi Adam,

 

it's work on zedboard, thanks, just what you mean by "available over the RS-232 " ?

 

regard

by Visitor rmoss78
on ‎02-16-2015 05:06 PM

I followed along with the post exactly and still get an error:


make: *** [src/lwIP_Demo/lwIP_port/netif/xadapter.o] Error 258

 

 

by Observer taylo_ap
on ‎02-17-2015 03:08 PM

rmoss78

 

Hello have you tried cleaning the build first prior to do the a total rebuild 

 

Adam

by Contributor
on ‎09-14-2016 10:12 PM

I would bet that file locations are given in some other entry to the blog but this particular article is flawed because the location of the SDK project source and Adam's referenced BSP are not given.  Without these files the whole article falls apart.

 

Sorry, but I think it needs some help.

 

by Observer taylo_ap
on ‎09-15-2016 12:26 PM

nickh

 

The BSP used can be any developed for a baremetal application, in this case I used the one with the XADC but any BSP bare metal will do. By SDK project source I presume mean the actual application software, this is witin the Demo application above that we import. 

 

I agree I could have been clearer on the BSP however, hopefully this comment will aid those that cannot see what I have done from the images

 

Thanks for reading and commenting 

 

Adam 

 

Labels
About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.