FreeRTOS Libraries that Empower IoT Applications

FreeRTOS Libraries that Empower IoT Applications

Real-time embedded applications are so-called as they necessitate timely response to real world events instantly. Such real world events have specific deadlines within which the embedded system must respond. This is where Real Time Operating Systems (RTOS) achieve prominence. The scheduling policy of RTOS ensures that the required deadlines are met, every time.

FreeRTOS is a leading real time operating system for microcontrollers and small microprocessors that are being increasingly used for designing Edge Devices. Such microcontrollers are usually found in IoT sensors, industrial automation apps, fitness trackers, automobiles, etc. and have limited memory and computation capabilities.

The main advantage of using FreeRTOS is that it enables you to easily program and deploy low-power real-time devices. It also eases the connectivity, security and management aspects of these devices. The OS is currently available under the MIT open source license.


What Does FreeRTOS Include?

FreeRTOS is inclusive of a kernel and a large set of software libraries that can be used to configure embedded applications suitable for various industries. After the support of FreeRTOS came under the aegis of Amazon Web Services (AWS) in 2017, the OS has seen exponential evolution and growth.

Amazon FreeRTOS has libraries that can connect low-power devices to significantly advanced edge devices running Amazon IoT Greengrass or extensive cloud services such as Amazon IoT Core. In other words, the OS is capable of securely connecting edge devices to cloud services or other edge devices effortlessly. It also supports remote updates over the air (OTA).

In this article, we will explore the FreeRTOS libraries that make it possible to craft intelligent IoT devices at the edge.


Interesting Stats on Edge Computing and FreeRTOS

A recent report from Markets and Markets indicates that edge computing is expected to see prolific growth between 2020 and 2025 at a CAGR of 34.1%. The advent of connected cars and autonomous vehicles have only reinforced the need for lightweight frameworks that promise high throughput. This has created ample opportunities for edge computing in the automotive market.

In a 2019 survey of the embedded markets conducted by Aspencore, it was found that real-time capability was a key factor that influenced the choice of a commercial operating system in embedded application development.

The report also highlighted that FreeRTOS was among the top three popular operating systems for embedded applications.

Stats on FreeRTOS 

AWS IoT Libraries

AWS IoT Libraries are responsible for establishing utility, OTA update facility and connectivity on small IoT devices powered by microcontrollers. These libraries are of the following 4 types:

  1. AWS IoT Device Defender – This library facilitates the transmission of security metrics from IoT devices to the AWS IoT Device Defender service. Administrators can, hence, continuously monitor the security metrics from the devices and identify anomalies in the data for each device (if any). In case an anomaly is detected, the AWS IoT Device Defender initiates an alert for administrators to take immediate action on.

    The library is designed to be ISO C90 and MISRA C:2012 compliant. It can also be used along with MQTT, JSON or CBOR libraries.

  2. AWS IoT Device Shadow – The shadow of an IoT device is the virtual representation of that device. It is possible to interact with the shadow of an IoT device even when it is offline. The AWS IoT Device Shadow library facilitates the storage and retrieval of the shadow of every IoT device that has been registered on a single AWS IoT account. The shadow is represented in the form of a JSON document and identified by the name of the connected device.

    This library is designed to be ISO C90 and MISRA C:2012 compliant. It can also be used along with MQTT or JSON libraries.

  3. AWS IoT Jobs – In an IoT application running on FreeRTOS, ‘Jobs’ are used to manage the connected devices. This includes managing the performance of administrative tasks such as diagnostics as well as updating firmware and security certificates on devices. The AWS IoT Jobs service is instrumental in notifying connected devices of a job that is pending.

    This library is designed to be ISO C90 and MISRA C:2012 compliant. It can also be used along with MQTT or JSON libraries.

  4. AWS IoT OTA – IoT devices are usually deployed in large numbers at remote locations that may not be easily accessible for human intervention. It is crucial that these devices are updated regularly with security fixes. It may not always be possible to disconnect these devices while the security patches are being updated. Over the Air (OTA) updates are significant in this scenario, as it facilitates the update of firmware on remote devices without direct human intervention. OTA updates also bring about tremendous savings on maintenance cost of these devices.

    It is important for OTA updates to be transmitted to the IoT devices through encrypted communication channels. Verification of the source, version and compatibility is necessary before the update is installed. It is also crucial for the devices to be able to revert back to the original version of firmware in case of invalid update or network connectivity issues.

    The AWS IoT OTA library enables the administrator to manage the OTA updates, i.e., notify about a new update, download the update, evaluate it using cryptography, etc. The OTA client library also facilitates the testing, committing and rollback of updates.

    The AWS IoT OTA library can be used along with HTTP or MQTT libraries.

FreeRTOS Libraries for IoT

There are several libraries in the FreeRTOS+ download directory that endow security and connectivity features for small IoT devices.

  1. FreeRTOS+TCP – This is a thread-safe TCP/IP stack for FreeRTOS. Ease of use is a highlight of this stack. The scalability of its features makes it suitable for small microcontrollers and large microprocessors alike. It encompasses a standards-based Berkely sockets interface and an optional callback interface (in the advanced version).
  2. coreJSON – JSON is a data serialization format that is commonly used to exchange data. It is also part of several APIs. coreJSON offers a parser that enforces the ECMA-404: The JSON Data Interchange Standard. The library is designed to be ISO C90 and MISRA C:2012 compliant.
  3. corePKCS #11 – PKCS #11 is a popular API that allows application software to manipulate (create, modify, use and delete) common cryptographic objects. These objects are also not exposed to the application’s memory. The corePKCS #11 library is a mock implementation of a subset of the PKCS #11 API. It facilitates rapid prototyping that is hardware independent.
  4. Application Protocols – These libraries enable connectivity for IoT devices based on microcontrollers. A simple transport interface definition is used by these protocols, and there is no dependency on the underlying TCP/IP stack. Some examples of these application protocols are coreMQTT, coreHTTP, coreMQTT Agent and Transport Interface.
  5. FreeRTOS+CLI – This Command Line Interface (CLI) framework offers a simple and extensible method by which a FreeRTOS app can process command line input. The steps involved in this process are as shown in the image below:
  6. FreeRTOS image

    Image Source –

  7. FreeRTOS+IO – This library provides a POSIX style peripheral driver extension for FreeRTOS. It offers a single interface to all peripherals across multiple platforms. It also caters to a wide range of data transfer modes and employs multiple techniques to read and write data. This makes it suitable for innumerable types of IoT applications.


FreeRTOS has witnessed growing popularity across industries over the years. Embitel has several years of experience in porting FreeRTOS to compilers/processors that do not currently support this OS. We are also experienced in porting the OS to niche processors and bespoke hardware frameworks. Connect with us to discover how you can leverage the advantages of FreeRTOS in your IoT applications.


to Help!