Cavli Wireless
 

James, Jr. Engineer

Hi Adam, recently I came across the operating system-FreeRTOS. Can you fill me in on what it is and how it is different from other OS?

Adam, Sr. Engineer

FreeRTOS is a lightweight, real-time operating system designed for microcontrollers with very limited resources (e.g., < 1 MB of RAM). It is an open-source project under the MIT license, available for both commercial and non-commercial purposes. Its kernel supports both preemptive and cooperative scheduling mechanisms, which reduce the overhead associated with context switching and make it suitable for small-footprint applications. Unlike monolithic OS like Linux, with features and services bundled together, regardless of whether they are used or not, FreeRTOS has a modular design that allows developers to choose the features only required by their specific use case, making FreeRTOS a tailored-fit for the exact requirements of the application.

 
 

James, Jr. Engineer

What makes FreeRTOS significant in cellular connectivity modules and in timing-sensitive tasks?

Adam, Sr. Engineer

FreeRTOS is a game-changer for cellular connectivity modules, offering real-time performance, and a low memory footprint, across different hardware platforms. FreeRTOS excels here due to its low-latency capabilities (typically < 1 ms), which enable it to execute critical tasks such as packet transmission without introducing jitter or buffer overflows. This means it can handle critical tasks like data transmission without a hitch. Plus, it seamlessly integrates with cellular connectivity networks like LTE, LTE-M, and NB-IoT. In short, it's perfect for the resource-constrained, timing-sensitive needs of embedded IoT systems.

 
 

James, Jr. Engineer

Does FreeRTOS support the integration of software stacks or other platforms for specific IoT applications?

Adam, Sr. Engineer

Yes, by supporting various platforms and stacks, FreeRTOS ensures interoperability with different hardware and software environments. FreeRTOS has been designed to be highly portable and flexible, allowing developers to integrate various software stacks, such as networking (lwIP, uIP/UDP), security (TLS/SSL, DTLS), or even custom applications. By supporting multiple hardware and software platforms, FreeRTOS ensures seamless integration with different IoT ecosystems, making it an ideal choice for building robust, scalable, and secure IoT solutions.

 

Many of us may have thought of what an operating system is and how it becomes relevant in a cellular module environment. For those curious minds like James, let's break down operating systems and introduce FreeRTOS—a real-time operating system that adds tremendous value to cellular connectivity modules.

What is an Operating System?

In the world of cell phones and other mobile devices, an operating system (OS) is like the brain that keeps everything running smoothly. It's the software that manages all the different parts of your device, from the screen and buttons to the apps and internet connection.

Think of it this way: imagine the operating system is like the USS Enterprise of the Star Trek, a powerful and sophisticated vessel that can manage its crew and navigate efficiently. Just as the Enterprise has a captain and crew that work together to achieve their mission, an operating system has a kernel and various components that work together to manage the computer's resources and provide a smooth user experience.

So, whether you're chatting with friends, streaming videos, or checking your email, the OS is always there in the background, making sure everything works just right in your cellular connectivity ecosystem.

Understanding Real-time Operating System in Embedded Systems

Microcontrollers and microprocessors, often described as the core of IoT devices, are modest, resource-limited, low-power chips. They are programmed with minimal firmware to perform specific tasks within IoT systems. An IoT network acts as a conduit, linking these microcontroller-powered devices to the internet and facilitating access to real-time cloud services for embedded systems.

A Real-Time Operating System (RTOS) is a finely tuned operating system that enables embedded controllers and processors to run large applications and execute multiple tasks concurrently on a single core. This setup ensures that all the real-time deadlines of IoT applications are met efficiently.

A Real-Time Operating System (RTOS) is designed to manage hardware resources, run applications, and execute tasks within stringent time constraints, making it crucial for embedded systems that require precise timing and predictability. Unlike general-purpose operating systems, an RTOS prioritizes high availability and reliability, ensuring that system responses occur in real-time.

This capability makes RTOS ideal for applications in automotive systems, medical devices, industrial control, and various IoT devices where delayed processing can lead to critical failures or suboptimal performance. By efficiently handling multitasking and inter-task communication, an RTOS can meet the rigorous demands of systems where timing is critical.

What is FreeRTOS?

FreeRTOS is a market-leading real-time operating system (RTOS) known for its compact size, reliability, and open source licensing for embedded devices. Developed by Richard Barry in 2003, FreeRTOS has grown from a simple task scheduler to a robust ecosystem supporting a wide array of device configurations and advanced features.

It is designed to run on a variety of microcontrollers, providing a robust foundation for building efficient, reliable, and scalable IoT applications. From consumer electronics to industrial machinery, FreeRTOS can act as an integral part in making devices smarter, more responsive, and more interconnected in our digital age.

FreeRTOS supports a broad spectrum of hardware platforms including ARM Cortex, Atmel AVR, Intel x86, and more. It’s also compatible with various development environments, making it accessible for projects ranging from simple microcontroller units to complex embedded systems. This flexibility makes FreeRTOS an ideal choice for developers looking to leverage powerful, efficient, and cost-effective RTOS features in their embedded applications.

Components of FreeRTOS

Components of FreeRTOS

FreeRTOS simplifies programming, deployment, security, connectivity, and management for compact, low-power edge devices. Central to FreeRTOS is the FreeRTOS kernel, which efficiently powers these IoT devices. Additionally, FreeRTOS includes various software libraries designed to facilitate secure connections to the cloud or between edge devices. This connectivity enables the collection and utilization of data for IoT applications, allowing for responsive and intelligent action based on real-time information. This architecture not only enhances functionality but also boosts the overall efficiency of IoT ecosystems.

  • FreeRTOS Kernel

    The FreeRTOS kernel is the core component of the FreeRTOS operating system, which is designed particularly for those requiring real-time capabilities. FreeRTOS supports task management functions like task scheduling or time-slicing, allowing tasks to be prioritized and run according to their priority levels. They also help in identifying tasks states like Running, Ready, Blocked, Suspended, or Terminated and handling transitions between these states. The kernel is also designed to be compact and efficient, requiring minimal CPU overhead and small amounts of RAM and ROM.

  • MQTT Agent

    The MQTT agent allows IoT devices running FreeRTOS to send and receive messages over a network. It handles the connection to an MQTT broker, which is a server that receives all messages from the clients and then routes these messages to the appropriate destinations. With the MQTT agent, FreeRTOS-enabled devices can perform real-time data exchange. This is essential for applications requiring immediate responses such as in home automation systems, industrial monitoring etc.

    Check out our blog on MQTT protocol to learn more about this communication protocol in IoT systems.

  • Greengrass Discovery

    AWS Greengrass is a service designed to extend AWS functionalities to edge devices, enabling them to act locally on the data they generate while still using the cloud for management, analytics, and durable storage. Edge devices running FreeRTOS initiate a discovery process by sending a discovery request. In response to the discovery request, the AWS Greengrass service provides the necessary configuration including details about the Greengrass Core’s endpoint and the required certificates for secure connection. Using the received information, the FreeRTOS device can establish a secure connection to the identified Greengrass Core. This connection often utilizes protocols like TLS (Transport Layer Security) to ensure that all communications are encrypted and secure.

  • Wi-Fi Management

    The Wi-Fi management library in FreeRTOS provides a standardized way of handling Wi-Fi functionalities. Devices can configure network settings such as SSID (Service Set Identifier), password, and security protocols directly through the library. The Wi-Fi management library can support various provisioning methods, such as using a smartphone app, web interface, or even Bluetooth to securely transfer Wi-Fi settings to the device. The Wi-Fi management library provides features for controlling the Wi-Fi module’s power usage, including sleep modes and power-saving settings to extend the battery life of the device.

  • Security

    FreeRTOS facilitates secure cloud connections by leveraging Transport Layer Security (TLS), which ensures privacy and data integrity between communicating applications. The TLS library in FreeRTOS handles the complexities of TLS, providing a set of API functions. TLS encrypts data before it is sent over a network, ensuring that any data intercepted during transmission remains confidential and unreadable to unauthorized parties. The use of TLS client certificates is a critical component for authenticating the identity of devices when connecting to services like AWS IoT Core's MQTT broker. This method ensures that only authorized devices can establish a connection, thereby protecting against unauthorized access.

  • OTA Updates

    Over-the-Air (OTA) updates in FreeRTOS allow for the remote upgrading of firmware on microcontroller-based devices. With a centralized platform to manage OTA updates, users can upload new firmware versions, select the devices to update, specify the code signing method to verify the integrity and authenticity of the firmware, and schedule when the updates should be applied. FreeRTOS also supports code signing, where each firmware update is signed using a cryptographic signature. This ensures that only verified and trusted firmware can be installed on the devices, preventing the installation of malicious or corrupted updates.

    To know more about over-the-air technology, refer our blog on DFOTA.

Why FreeRTOS Stands Out from the Pack: Key Features Unveiled!

  • Task Management

    FreeRTOS allows the creation, management, and deletion of tasks, which means your applications can multitask like a pro. This capability translates to increased productivity and efficiency in your embedded systems, allowing your devices to handle complex operations at the same time. The result? Faster development and lower costs.

  • Inter Communication

    Inter-task communication ensures seamless operation and robust performance of your devices, which is key for maintaining data integrity and delivering a great user experience. Tools such as queues, semaphores, and event groups (managing the interaction between multiple tasks or threads) facilitate communication between tasks without compromising data integrity or system performance.

  • Synchronization

    FreeRTOS supports mutex (mutual exclusion), which stops multiple tasks or threads from trying to use the same resource—like a data structure or hardware—at the same time. This avoids resource conflicts and keeps your data structures safe from corruption. By avoiding resource conflicts, your system runs smoother and more predictably, ensuring consistent and reliable performance.

  • Scalability

    You can easily integrate FreeRTOS into their systems without worrying about licensing fees or royalties. Plus, there’s FreeRTOS+, a suite of optional add-ons that take the core FreeRTOS to the next level. FreeRTOS+ offers advanced security features, reliable connectivity options like FreeRTOS+TCP, and file management like FreeRTOS+FA, for scaling up your projects without the hassle.

FreeRTOS vs. VxWorks vs. ThreadX vs. Linux- Engage in the Face-off of Embedded Titans

Strap in! We're diving into the ultimate showdown of operating systems: FreeRTOS, VxWorks, ThreadX, and Linux! From the speed demons to the budget-friendly champs, these contenders will bring their A-game in this final showdown.

Comparison Aspectfreertosvx worksthreadxlinux
Performance and CostOpen-source, lightweight, minimal resource usage, cost-effectiveHigh-performance, used in demanding applications (aerospace, defense), higher cost due to licensing, requires robust hardwareSmall, optimized API set, deterministic scheduler, suitable for high-throughput applicationsRequires more resources, broader general-purpose capabilities
Application Areas and Use CasesIndustrial systems, smart water and gas meters, smart grid management.High stake applications like robotic surgery systems, life support machines, ADAS and telematics.High throughput usecses like fitness trackers, infotainment system, IoT gateways, routers and switches.Complex and high-level processes like autonomous robots, smart kiosks, medical imaging systems such as MRI machines and CT scanners.
ArchitectureModular approach, easy integration into various architectures (ARM Cortex, MIPS, etc.)Microkernel-based architecture, designed for high-performance and reliabilityHighly optimized, deterministic schedulerMonolithic architecture, designed for general-purpose computing
Hybrid SystemsCan work with Linux for real-time tasksNot typically used in hybrid systems, but can be used in conjunction with other RTOSNot typically used in hybrid systems, but can be used in conjunction with other RTOSCan work with FreeRTOS for real-time tasks in dual-core/multi-core or task partitioning setups
Data SpeedsUp to 100 Mbps (Ethernet), up to 1 Gbps (Wi-Fi)Up to 1 Gbps (Ethernet), up to 10 Gbps (Fibre Channel)Up to 100 Mbps (Ethernet), up to 1 Gbps (Wi-Fi)Up to 10 Gbps (Ethernet), up to 100 Gbps (Fibre Channel)

FreeRTOS Applications in Action: The Real-World OS Behind Everyday Innovations

From the unexpected to the essential, FreeRTOS finds its place in more places than you might think. Let’s explore the whimsical world of FreeRTOS!

  • Consumer Electronics

    FreeRTOS is the go-to for consumer electronics because it's super light and efficient. That means fast boot times and less drain on your battery. Plus, it's a celebrity in the world of gadgets like smart TVs, set-top boxes, and gaming consoles. It enables sophisticated features like touch interfaces, network connectivity, and multimedia processing.

  • Industrial Automation

    FreeRTOS is designed to meet the stringent requirements of industrial automation. Picture this: lightning-fast processing, minimal wait times, and rock-solid reliability—FreeRTOS is the pick. It is used in industrial automation applications such as robotics, CNC machines, and industrial control systems, making it a popular choice for industrial automation systems.

  • Medical Devices

    FreeRTOS is your trusted ally for purpose-built IoT medical devices that require real-time processing, low latency, and high reliability. FreeRTOS is used in medical devices such as pacemakers, insulin pumps, and patient monitoring systems, making it the most dependable grab for building reliable medical devices. 
    To know more about the Internet of Medical Things, check out our blog on IoT in Healthcare.

  • Aerospace and Defense

    FreeRTOS is your wingman for confidential and high-security sectors like aerospace and defense. It can serve in military communication systems, navigation, and those spy-worthy surveillance setups that require fast processing and minimal downtimes.

Closing Notes

FreeRTOS stands out as a versatile and reliable real-time operating system designed for embedded systems and IoT applications. Its core features, including efficient task management, robust scheduling, and comprehensive inter-task communication, make it an essential tool for developers.

Looking ahead, the future of FreeRTOS is bright. As the IoT ecosystem continues to expand, the demand for reliable, real-time operating systems will significantly grow. FreeRTOS is not just a tool; it's a gateway to innovation in embedded systems and IoT, driving the next wave of technological advancements.

Amusing Tech Chronicles

Facts and Anecdotes related to this edition of Wireless By Design


 

marvel.webp

Tony Stark of Embedded Systems

Just as Iron Man's suit adapts to any challenge, FreeRTOS powers devices with agility and precision. From smartwatches to industrial sensors, it's the tech superhero ensuring seamless operation, leaving businesses feeling as confident as Tony Stark.

human-body.webp

Central Nervous System of the Human Body

FreeRTOS is comparable to the central nervous system of the human body. Just as the nervous system coordinates various bodily functions and responses, FreeRTOS manages tasks and resources in embedded systems, ensuring devices like medical monitors and industrial robots operate with precision and efficiency.

embedded-magic.webp

Dumbledore of Embedded Magic

Just as Hogwarts' headmaster orchestrates every spell and potion, FreeRTOS manages hardware and software resources with ultimate precision, navigating the complexities of embedded systems, ensuring all devices interact and operate efficiently.

Go Beyond and Explore

1.

What is the difference between FreeRTOS and FreeRTOS+?

FreeRTOS and FreeRTOS+ are both part of the FreeRTOS family of real-time operating systems (RTOS) designed for microcontrollers and small embedded systems. FreeRTOS+ extends the capabilities of the core FreeRTOS kernel, offering a suite of additional components that cater to advanced application needs. These components enhance the functionality, security, and connectivity of embedded systems, making FreeRTOS+ a powerful tool for developers.

For example:

  • FreeRTOS+TCP: A scalable, open-source TCP/IP stack for FreeRTOS. It provides reliable network communication, supporting both IPv4 and IPv6. FreeRTOS+TCP is designed to be lightweight and efficient, making it suitable for a wide range of embedded applications that require internet connectivity.
  • FreeRTOS+FAT: A file system component that offers a FAT-compatible file system implementation for FreeRTOS. It supports multiple storage media, including SD cards and USB drives, enabling applications to manage files and directories effectively.
  • FreeRTOS+CLI: The Command Line Interface (CLI) component that allows developers to interact with their systems through a text-based interface. This is particularly useful for debugging and configuration purposes, providing an intuitive way to control and monitor embedded devices.
  • FreeRTOS+IO: Standardizes the input/output operations for various peripherals, simplifying the integration of sensors, actuators, and other hardware components into FreeRTOS applications.
2.

What types of hardware platforms and devices are compatible with FreeRTOS?

  • Microcontrollers (MCUs):
    • ARM Cortex-M: FreeRTOS is widely used on ARM Cortex-M microcontrollers, which are popular in many embedded applications due to their efficiency and performance.
    • STM32: STMicroelectronics' STM32 family of microcontrollers is commonly used with FreeRTOS.
    • ESP32/ESP8266: These popular Wi-Fi and Bluetooth-enabled microcontrollers from Espressif are compatible with FreeRTOS.
  • Microprocessors (MPUs):
    • ARM Cortex-A: Some versions of FreeRTOS can be used on ARM Cortex-A microprocessors, which are more powerful and typically run in more complex embedded systems.
  • Development Boards:
    • Arduino: FreeRTOS can be used on Arduino boards, particularly those with more powerful microcontrollers like the Arduino Due (ARM Cortex-M3).
    • Raspberry Pi Pico: This board, based on the RP2040 microcontroller, supports FreeRTOS.
  • Specialized Platforms:
    • IoT Devices: Many IoT devices, which often use low-power microcontrollers, utilize FreeRTOS due to its small footprint and real-time capabilities.
    • Wearables: Wearable devices with constrained resources can benefit from FreeRTOS.
3.

What are the disadvantages of FreeRTOS?

  • Limited Functionality: FreeRTOS is not suitable for running complex applications that require extensive system services, multi-user environments, or advanced memory management features like virtual memory.
  • Scalability Issues: FreeRTOS is designed for microcontrollers and small embedded systems, making it less suitable for large, complex systems with extensive hardware resources. As the complexity of the system increases, managing multiple tasks, memory, and inter-process communication can become challenging.
  • Real-time Limitations: While FreeRTOS is a real-time operating system, it can still suffer from issues like priority inversion, where a lower-priority task holds a resource needed by a higher-priority task, potentially causing delays.

Author

Author

Drishya Manohar

Sr. Associate - Content Marketing

Abhinand Dinesh

Abhinand Dinesh

Associate - Corporate Marketing Cavli Wireless

Share

Related Blogs

image

The Ultimate Guide to LTE Cat 1bis Technology

View Blog
NB-IoT Explained: Benefits, Applications, and Future Trends in 2024

what is narrowband iot

View Blog

Featured Videos

Image

Use case

Experience Real-Time Driving Intelligence

Scaling IoT with Cavli Hubble

Design with Cavli

Scaling IoT with Cavli Hubble | Design with Cavli [...]

Cavli AQ20  Automotive IoT module

Onboarding Video Automotive

Unveiling Cavli AQ20: Powering the Future of Autom [...]

View All