There is a plethora of embedded operating systems software developers can choose from when starting a new project from scratch. In this blog post, I will review some aspects to consider when selecting such an operating system. I will also describe the features of one that I think suits many different systems.
Selecting embedded operating systems can be a pickle – Why FreeRTOS should be your go-to option
Why is it so difficult?
An embedded system is usually developed to perform application-specific tasks, including a processor to execute program code and different memories where that program code and variables are stored. Usually, these resources are very limited, and hardware architectures vary significantly, making it difficult to develop a generic operating system for all these different kinds of embedded systems. A software developer needs to select a suitable Real-Time Operating System (RTOS) that best supports developing application software for that specific system and is scalable for future needs.
What to consider when selecting RTOS?
There are many different criteria that you should consider when selecting the RTOS. If you already have hardware for the system you are developing, the first thing to check is the existing hardware architecture support. That allows you to get started without putting extra effort into porting the RTOS to a new architecture. Of course, hardware can also change later, so it might be worth checking how easy it would be to port that RTOS to a new architecture.
Depending on your project requirements and system specifications, other important selection criteria might include: cost or licensing options, different support options, how configurable the RTOS is, development tool integration support, existing driver or networking support, or the learning curve needed to start using the RTOS. You may also need some certifications that might prevent you from selecting the RTOS freely. However, which aspects you should consider more carefully will depend heavily on the project specifications.
FreeRTOS – open-source, diverse, and developer-friendly RTOS for microcontrollers
From the sea of embedded operating systems, you can find many suitable for different purposes, but the most diverse is FreeRTOS. It is an open-source RTOS designed for embedded systems and microcontrollers. FreeRTOS is a perfect choice for any microcontroller-based embedded system that needs to do multiple tasks simultaneously, requires real-time capabilities, and has enough system resources to run the RTOS, which is the case with the most modern microcontrollers.
The small learning curve makes FreeRTOS easy to learn for anyone familiar with the RTOS concepts and provides extensive documentation and active community support for those who are not. The demo applications and examples make it easy to start with any hardware architecture. I think it is also quite trivial to port it to new architectures. And, for modern cloud connectivity, there are AWS cloud integration examples that help you start building your IoT devices.
If you value using open-source, simple but diverse RTOS designed for microcontrollers, FreeRTOS is your number one choice.
FreeRTOS features in more detail
For you to be able to evaluate if FreeRTOS is suitable for your project, it is important to dive deeper into its features.
FreeRTOS is MIT-licensed, i.e., free to use without any restrictions. It has been used in many kinds of projects, including consumer electronics, Internet of Things (IoT), robotics, and being open source; it is often used also in education, hobby, and research projects.
The FreeRTOS kernel provides a rich set of features that are still being actively developed. It has a kernel with real-time capabilities, a small memory footprint, and power-saving modes. Kernel provides tasks with different scheduling options and task synchronization features. Typical kernel image size varies from 6 to 12 Kbytes depending on the configuration, and necessary Random Access Memory (RAM) depends on the number of tasks and other objects being used, starting from a couple of kilobytes.
FreeRTOS offers different methods for stack overflow detection and heap management if dynamic memory management is used. FreeRTOS also supports more complex concepts like Symmetric Multiprocessing (SMP) or memory protection unit (MPU).
FreeRTOS is highly customizable, providing customization options using one header file. These options include but are not limited to clock frequencies, memory sizes, scheduler options, or an option to select between static and dynamic memory management. Static memory management might be used when the size of RAM is small to know the memory usage during development time or to link RTOS objects to a certain memory location.
Modular and MIT-licensed libraries enable the extension of the RTOS features. FreeRTOS Core libraries implement features for connectivity and security (e.g., coreMQTT and corePKCS #11) and have no dependencies on the FreeRTOS kernel but only on standard C libraries. FreeRTOS Plus libraries offer different add-on functionalities for the kernel, like TCP/IP stack or Command Line Interpreter (CLI).
Partners also offer commercial licenses and provide warranty (OpenRTOS) and safety certifications (SafeRTOS) if needed. Some partners also offer development tool support and hardware development kits. For example, there is a trace tool support to be used for trace analysis, which will help with the debugging.
Extensive documentation will help get started and find solutions to possible problems. In addition, there are also books and Frequently Asked Questions to extend that documentation.
Conlusion
After delving into FreeRTOS’s features, it is evident that it serves almost any microcontroller-based project well. Using FreeRTOS with the feature-rich kernel and with those modular libraries to extend that kernel, software developers can build scalable RTOS-based modern embedded systems with reliable and secure connectivity and remote update support for almost any application and for free.
Looking for an embedded developer? We’re happy to help!
Head of Sales +358 50 554 3652 mikko.luukkonen@softability.fi
Key Account Manager +358504402729 katariina.sorkkila@softability.fi