An Introduction to FreeRTOS Part 2

A Closer Look at FreeRTOS

By Jeff Tranter

In this second installment of our series on FreeRTOS, we take a more detailed look at its key features, supported platforms, licensing and cost. I'll also note other variants of FreeRTOS, as well as some add-on tools and libraries.

In contrast to a full operating system, FreeRTOS is designed to be a tiny kernel with a small memory footprint, low overhead, and fast execution. It is scalable in size, as small as 9 kilobytes if only a task scheduler is needed. A single-source code base supports more than 40 MCU architectures and 15 toolchains, including the latest RISC-V and ARMv8-M microcontrollers.

As we'll see, there a number of add-on libraries available to extend it to support features used in different industry sectors. It is freely available under an MIT license, as well as commercial options, and it is backed by extensive API reference documentation and tutorials.

Supported Platforms

At the time of writing, the current list of supported platforms is the following:

  • Altera Nios II
  • ARM architecture: ARM7, ARM9, ARM Cortex-M, ARM Cortex-A
  • Atmel: Atmel AVR, AVR32, SAM3 / SAM4, SAM7 / SAM9, SAMD20 / SAML21
  • Cortus: APS1, APS3, APS3R, APS5, FPS6, FPS8
  • Cypress: PSoC
  • Energy Micro: EFM32
  • eSi-RISC: eSi-16x0, eSi-32x0
  • DSP Group: DBMD7
  • Espressif: ESP8266ex, ESP32
  • Fujitsu: FM3, MB91460, MB96340
  • Freescale: Coldfire V1/V2, HCS12, Kinetis
  • IBM: PPC404/PPC405
  • Infineon: TriCore, Infineon XMC4000
  • Intel: x86, 8052
  • Microchip Technology: PIC18/PIC24/dsPIC, PIC32
  • Microsemi: SmartFusion
  • Multiclet: Multiclet P1
  • NXP: LPC1000, LPC2000, LPC4300
  • Renesas: 78K0R, RL78, H8/S, RX600, RX200, SuperH, V850
  • RISC-V: RV32Im RV64I, PULP RI5CY
  • Silicon Labs: Gecko (ARM Cortex)
  • STMicroelectronics: STM32, STR7
  • Texas Instruments: MSP430m Stellarism Hercules (TMS570LS04 & RM42)
  • Xilinx: MicroBlaze, Zynq-7000

Licensing, Cost and Ownership

The FreeRTOS kernel and libraries are distributed under an MIT open source license, a very liberal license with few restrictions and no viral properties like the GPL or LGPL. There is no cost or run-time royalties.

Some other variants of FreeRTOS exist. For instance, a:FreeRTOS is an extension that supports Amazon Web Services (AWS). OpenRTOS is a commercially licensed version from a third party that includes indemnification and dedicated support. SAFERTOS is a version of the kernel that has been developed, documented and tested to meet some requirements of industrial, medical, automotive and other international safety standards. It includes independently audited safety lifecycle documentation artifacts.

Since version 10.0.0 in 2017, Amazon has taken stewardship of the FreeRTOS code, including updates to the kernel.

Major Features

Some of the major features of FreeRTOS are the following:

  1. Tasks
  2. Queues, Mutexes, Semaphores
  3. Direct-To-Task Notifications
  4. Stream and Message Buffers
  5. Software Timers
  6. Event Groups (or "Flags")
  7. Static vs. Dynamic Memory
  8. Heap Memory Management
  9. Stack Overflow Protection
  10. Co-Routines (deprecated)

Though greater detail into each is beyond the scope of this blog, understand that the supported features are all configurable at compile time so you can scale it down to only those features you require.

Additional libraries, add-ons, and OS variants include:

FreeRTOS+: provides connectivity and utility functionality suitable for building smart microcontroller-based devices and connecting IoT devices to the cloud.

IoT Libraries: provide connectivity and security libraries functionality for building smart microcontroller-based devices and connecting to the cloud.

FreeRTOS Labs: additional libraries that are fully functional but undergoing optimizations or refactoring to improve memory usage, modularity, documentation, demo usability, or test coverage.

FreeRTOS and Qt for Microcontrollers

Qt for MCUs (also known as Qt Quick Ultralite) is a version of the Qt framework that can run on microcontrollers. It supports a number of platforms including FreeRTOS. You can find more details here.

The Next Installment

I hope this blog post has given you some more insight into the capabilities of FreeRTOS. In the next installment, we'll look at some example code and explore ways to get started with FreeRTOS on various hardware platforms. If you missed part 1, find it here.