1 FreeRTOS
Since RTOS requires a certain amount of system resources (especially RAM), only a few real-time operating systems such as μC/OS-II, embOS, salvo, and FreeRTOS can run on small RAM microcontrollers.
Compared to commercial operating systems like μC/OS-II and embOS, FreeRTOS is a completely free operating system, featuring open source code, portability, scalability, and flexible scheduling policies. It can be easily ported to various microcontrollers, with its latest version being 6.0.
As a lightweight operating system, FreeRTOS provides functionalities including task management, time management, semaphores, message queues, memory management, and logging, which can basically meet the needs of smaller systems.
The FreeRTOS kernel supports priority scheduling algorithms, where each task can be assigned a certain priority based on its importance, and the CPU always allows the highest priority ready task to run first.
The FreeRTOS kernel also supports round-robin scheduling, allowing different tasks to share CPU time when there are no higher priority tasks ready.
Disadvantages of FreeRTOS: Compared to the common μC/OS-II operating system, FreeRTOS has both advantages and disadvantages. Its shortcomings are reflected in the system service functions; for instance, FreeRTOS only provides implementations for message queues and semaphores and cannot send messages to the message queue in a first-in-first-out order. Furthermore, FreeRTOS is just an operating system kernel and requires third-party GUI (Graphical User Interface), TCP/IP stacks, FS (File System), etc., to implement a more complex system, unlike μC/OS-II, which can seamlessly integrate with μC/GUI, μC/FS, μC/TCP-IP, etc.
In STM32CubeIDE, FreeRTOS can be configured directly, as shown in the image above. For related articles on using FreeRTOS with STM32, please visit here: Use STM32CubeMx tool to write FreeRTOS demo programs.
FreeRTOS has abundant resources and an active ecosystem, and it can be easily learned through the configuration interface in Cube, making it recommended for beginners.
Based on different needs, the following will introduce other RTOS.
2 μClinux
μClinux is an excellent version of embedded Linux, whose full name is micro-control Linux, literally meaning micro-control Linux.
Compared to standard Linux, μClinux has a very small kernel, yet it inherits the main features of the Linux operating system, including good stability and portability, powerful networking capabilities, excellent file system support, a rich set of APIs, and TCP/IP network protocols. Due to the absence of an MMU (Memory Management Unit), its multitasking implementation requires certain skills.
Structurally, μClinux inherits the multitasking implementation method of standard Linux, dividing processes into real-time processes and ordinary processes, using first-come-first-served and time-slice scheduling, respectively, and is improved for the characteristics of mid-to-low-end embedded CPUs, without supporting kernel preemption, resulting in general real-time performance.
In summary, μClinux’s biggest feature is its design for processors without MMU, which is suitable for the STM32F103 that lacks MMU functionality. However, porting this system requires at least 512KB of RAM space and 1MB of ROM/FLASH space, while the STM32F103 has 256K of FLASH, necessitating external memory, thus increasing hardware design costs.
μClinux has a complex structure, making it relatively difficult to port, and its kernel is larger, with poorer real-time performance. If the embedded product being developed emphasizes file systems and network applications, μClinux is a good choice.

3 μC/OS-II
μC/OS-II is developed based on μC/OS and is a compact, preemptive multitasking real-time kernel written in C. μC/OS-II can manage 64 tasks and provides task scheduling and management, memory management, task synchronization and communication, time management, and interrupt servicing functions, featuring high execution efficiency, small footprint, excellent real-time performance, and strong scalability.
In terms of file system support, since μC/OS-II is aimed at small and medium-sized embedded systems, even with all functions included, the compiled kernel is less than 10 KB, so the system itself does not provide support for file systems. However, μC/OS-II has good extensibility, and file system content can be added if needed.
Regarding hardware support, μC/OS-II can support most popular CPUs, and due to its small kernel, the trimmed-down code can be as small as 2KB, with a minimum required data RAM space of 4KB. Porting μC/OS-II is relatively simple, requiring only modifications to processor-related code.
In summary, μC/OS-II is a simple structure, fully functional, and highly real-time embedded operating system kernel, making it very suitable for CPUs without MMU functionality. It requires very little kernel code space and data storage space, possesses good real-time performance, good scalability, and is open-source, with abundant resources and examples available online, making it very suitable for porting to the STM32F103 CPU.

4 eCos
Its biggest feature is flexible configuration, adopting a modular design, with the core part composed of small components, including kernel, C language library, and lower-level runtime packages.
Each component can provide numerous configuration options (the real-time kernel can also be configured as an option), and using the configuration tool provided by eCos, it can be easily configured to meet different embedded application requirements.
The configurability of the eCos operating system is very powerful, allowing users to add the required file systems. The eCos operating system also supports most popular embedded CPUs and can be ported across different architectures such as 16-bit, 32-bit, and 64-bit.
Due to its small kernel, the trimmed code can be as small as 10 KB, with a minimum required data RAM space of 10 KB.
In terms of system portability, the eCos operating system is very portable, easier than μC/OS-II and μClinux.
In summary, the biggest feature of eCos is its flexible configuration and support for porting to CPUs without MMU, being open-source and having good portability, making it suitable for porting to STM32 platform CPUs. However, eCos is not as widely used as μC/OS-II and lacks as many resources as μC/OS-II. eCos is suitable for some commercial or industrial embedded systems that are sensitive to cost, such as certain applications in the consumer electronics field.
5 mbed OS
An open-source embedded operating system, ARM provides mbed OS for free to all manufacturers, offering a relatively comprehensive smart hardware development environment.
Main functions:
Provides a general operating system foundation for developing IoT devices to solve the fragmentation problem in embedded design. Supports all important connectivity and device management open standards for future-oriented designs. Enables secure, upgradable edge devices to support new processing capabilities and functionalities. Addresses complex power consumption issues through automatic power management.
Main features:
Fast development speed, powerful functionality, high security, designed for mass production, allows offline development, and can also be edited on the web.

6 RTX
RTX is an embedded real-time operating system from ARM, written using standard C structure and compiled using the RealView compiler. It is not just a real-time kernel but also contains rich middleware components, is free, and has open code.
Main functions:
Start and stop tasks (processes), and additionally supports process communication, such as task synchronization, management of shared resources (peripherals or memory), and message passing between tasks. Developers can use basic functions to start real-time executors, begin and terminate tasks, and pass control between tasks (round-robin scheduling). Developers can assign priorities to tasks.
Main features:
Supports time-slice, preemptive, and cooperative scheduling. There is no limit on the number of tasks, each task can have 254 priorities. There is no limit on the number of semaphores, mutexes, message queues, and software timers. Supports multithreading and thread-safe operations. Using the MDK dialog-based configuration wizard, MDK configuration can be easily completed.
7 Dujiangyan
The Dujiangyan operating system, abbreviated as djyos, is named after a great water conservancy project: Dujiangyan.
Unlike traditional operating systems, djyos is centered around events rather than threads for scheduling. This scheduling algorithm allows programmers to write applications in a way that aligns with human cognitive processes rather than simulating computer execution processes, introducing a VC-like approach to embedded programming.
The scheduling algorithm of djyos allows programmers to break free from the constraints of threads and processes; djyos has no APIs related to threads, allowing a programmer without any knowledge of threads to successfully write applications under djyos.
The djyos operating system is scheduled around events, allowing programmers to program according to human cognitive habits rather than computer habits.

8 RT-Thread
The embedded operating system RTOS introduction, RT-Thread is a technology platform that integrates a real-time operating system (RTOS) kernel, middleware components, and a developer community, developed by Mr. Xiong Pu Xiang and the open-source community. RT-Thread is also a complete and rich component, highly scalable, easy to develop, ultra-low power consumption, and high-security IoT operating system.
RT-Thread has all the key components required for an IoT OS platform, such as GUI, network protocol stack, secure transmission, low-power components, etc. After 11 years of cumulative development, RT-Thread has the largest embedded open-source community in China and is widely used in various industries such as energy, automotive, medical, and consumer electronics, with a cumulative installed base of over 20 million units, becoming the most mature and stable open-source RTOS developed independently by Chinese people.
It is most likely to become the Top 1 in China, with advantages in rich components and a neutral stance! It has caught up with the timing, receiving support from many chip manufacturers, and is well-liked by developers. The downside is that its documentation and tutorials are still weaker compared to FreeRTOS and similar systems.
More exciting:
Yan Shi│Reflections and Suggestions on the “Predicament” of Young Teachers in Universities
Academician Zheng Weimin: Why Computer Majors Have Become Popular Choices for Students
【Directory】”Computer Education” Issue 6, 2022
【Directory】”Computer Education” Issue 5, 2022
【Directory】”Computer Education” Issue 4, 2022
【Directory】”Computer Education” Issue 3, 2022
【Directory】”Computer Education” Issue 2, 2022
【Directory】”Computer Education” Issue 1, 2022
【Editorial Board Message】Professor Li Xiaoming from Peking University: Thoughts on the “Year of Improvement in Classroom Teaching”…
Professor Chen Daoxu from Nanjing University: Teaching students to ask questions and teaching students to answer questions, which is more important?
【Yan Shi Series】: Trends in Computer Science Development and Their Impact on Computer Education
Professor Li Xiaoming from Peking University: From Interesting Mathematics to Interesting Algorithms to Interesting Programming—A Path for Non-Majors to Experience Computational Thinking?
Several Reflections on the Construction of First-Class Computer Disciplines
Professor Liu Yunhao from Tsinghua University Answers 2000 Questions about AI
Professor Zhan Dechen from Harbin Institute of Technology: A New Model to Ensure Teaching Quality in Universities—Synchronous and Asynchronous Blended Teaching
【Principal Interview】Accelerating the Advancement of Computer Science Education—Interview with Professor Zhou Aoying, Vice President of East China Normal University
New Engineering and Big Data Major Construction
Learning from Others—Compilation of Research Articles on Computer Education at Home and Abroad