RT-Thread
v5.2.2Features
-
Minimum kernel footprint requiring only 1.2KB RAM and 3KB Flash for resource-constrained systems.
-
Object-oriented programming model implemented in C for modular and structured system design.
-
Preemptive priority-based thread scheduling with support for multi-threading and synchronization primitives.
-
Dual-tier distribution offering a Nano version for MCUs and a Standard version for feature-rich IoT devices.
-
Comprehensive software package ecosystem with over 450 reusable components across various domains.
-
Standardized application interfaces including full POSIX, CMSIS, and C++ runtime environments.
-
Virtual File System (VFS) providing a unified interface for various storage and file system types.
-
Integrated FinSH command-line interface for real-time system interaction and debugging.
-
Highly scalable device framework for unified peripheral management and driver abstraction.
-
Support for multiple memory management schemes including small memory, slab, and heap allocators.
-
Native support for high-performance graphical user interfaces with touch and sliding effects.
-
Cross-compiler compatibility with GCC, Keil MDK, and IAR toolchains.
-
Integrated development environment (RT-Thread Studio) for one-stop project management and debugging.
-
Env auxiliary tool providing a TUI for Kconfig-based project configuration and generation.
-
Support for advanced scripting languages including MicroPython and JerryScript (JavaScript).
-
Real-time kernel features including semaphores, mailboxes, message queues, and software timers.
-
Hardware abstraction layer (libcpu/BSP) for rapid porting across diverse architectures.
-
Built-in simulator support via QEMU for development without physical hardware.
Architecture
RT-Thread employs a highly modular, layered architecture designed to scale from simple microcontrollers to complex IoT systems. The architecture is divided into three primary layers: the Kernel Layer, the Components and Service Layer, and the Software Package Layer. This design follows object-oriented principles implemented in C, ensuring high internal cohesion within modules and low coupling between different subsystems.
The Kernel Layer is the core of the system, providing essential multi-threading, preemptive scheduling, and inter-thread communication primitives such as semaphores, mailboxes, and message queues. It also includes the Hardware Abstraction Layer (libcpu/BSP), which isolates the kernel from specific hardware details, facilitating rapid porting to new architectures. The Components and Service Layer sits atop the kernel, offering higher-level abstractions like the Virtual File System (VFS), the FinSH shell for command-line interaction, and comprehensive device and network frameworks. Finally, the Software Package Layer provides a massive ecosystem of reusable components that can be seamlessly integrated into projects to add complex functionality such as scripting languages, multimedia support, and cloud connectivity.
Core Components
- Real-Time Kernel: Multi-threaded scheduler, memory management, and synchronization primitives.
- FinSH Shell: A powerful command-line interface for system debugging and interaction.
- Virtual File System (VFS): Unified interface for FAT, SPIFFS, and network-based file systems.
- Device Framework: Standardized I/O device management for UART, I2C, SPI, and ADC.
- Network Stack: Support for LWIP and various protocol implementations (MQTT, HTTP, TLS).
Use Cases
This RTOS is ideal for:
- Resource-Constrained MCUs: Using the Nano version to provide multi-tasking on devices with as little as 3KB Flash and 1.2KB RAM.
- IoT Gateways: Leveraging the rich network stack and protocol support (MQTT, CoAP, WebSocket) for cloud connectivity.
- Industrial Control: Utilizing the real-time preemptive kernel for deterministic task execution in automated systems.
- Smart Home Appliances: Implementing complex graphical user interfaces and touch effects using the integrated GUI components.
- Edge Computing: Running scripting languages like MicroPython or JerryScript for flexible, high-level application development on embedded hardware.
- Wearable Devices: Taking advantage of low power consumption and fast startup times for battery-operated electronics.
Getting Started
Developers can begin by choosing between the Standard and Nano versions based on their hardware requirements. The recommended development path is using RT-Thread Studio, a one-stop integrated development environment that provides graphical configuration, project management, and debugging tools. For those preferring command-line workflows, the Env tool provides a TUI for Kconfig-based system tailoring and project generation for GCC, Keil MDK, and IAR.
For initial testing without physical hardware, RT-Thread provides comprehensive QEMU BSP support, allowing developers to run and debug the OS on simulated ARM or RISC-V platforms. Detailed documentation, including the Programming Guide and Kernel Samples, is available on the official website to assist with the learning curve. Links to these resources and the software package index can be found in the repository’s README.
Related Projects (98)
BME680 Sensor Package for RT-Thread
A hardware driver package for the Bosch BME680 4-in-1 environmental sensor, designed to integrate seamlessly with the RT-Thread sensor device framework. It provides measurement capabilities for VOC, temperature, humidity, and atmospheric pressure, supporting both I2C and SPI communication interfaces.
μC/Clk for RT-Thread
A port of the Micrium uC/Clk clock and calendar management module for the RT-Thread RTOS. It provides Year 2000 compliant timekeeping with support for NTP and Unix timestamps, offering comprehensive date/time conversion utilities and automatic initialization within the RT-Thread environment.
μC/Common for RT-Thread
A port of Micrium's µC/Common module for the RT-Thread RTOS, providing a Kernel Abstraction Layer (KAL) and shared components for Micrium software stacks. It enables the integration of µC/FS, µC/USB, and µC/TCP-IP into RT-Thread environments by leveraging a uCOS-III compatibility layer.
μC/CRC for RT-Thread
A port of the uC/CRC utility library to the RT-Thread RTOS, providing comprehensive Error Detecting Code (EDC) and Error Correcting Code (ECC) calculation utilities. It supports multiple CRC-16 and CRC-32 models along with Hamming code for error correction, integrated with the RT-Thread build system.
μC/OS-II Compatibility Layer for RT-Thread
A compatibility layer that allows applications developed for the μC/OS-II RTOS to migrate seamlessly to the RT-Thread operating system. It supports μC/OS-II versions 2.00 through 2.93 and provides a 100% C-based implementation of the μC/OS-II API.
μC/OS-III Compatibility Layer for RT-Thread
A high-fidelity compatibility layer that allows applications written for Micriμm's μC/OS-III to run seamlessly on the RT-Thread RTOS. It supports μC/OS-III versions 3.00 through 3.08 and provides integration with the μC/Probe visualization tool and RT-Thread's FinSH console.
CCS811 Digital Gas Sensor Driver for RT-Thread
A comprehensive driver package for the CCS811 digital gas sensor designed for the RT-Thread RTOS. It enables monitoring of indoor air quality by measuring Total Volatile Organic Compounds (TVOC) and equivalent CO2 (eCO2) levels. The driver supports both standalone custom APIs and the standard RT-Thread sensor device framework.
Deep Analysis of RT-Thread Operating System
A technical repository dedicated to the architectural analysis of the RT-Thread RTOS, focusing on its internal data structures and design methodologies. It provides in-depth lectures on the kernel object model and the Device File System (DFS), including file descriptor management and implementation details.
DHTxx Sensor Driver for RT-Thread
A comprehensive driver package for RT-Thread that supports the DHTxx series of single-bus digital humidity and temperature sensors, including DHT11, DHT12, DHT21, and DHT22. It offers both a standalone custom API and seamless integration with the RT-Thread sensor device framework for flexible embedded development.
DS3231 RTC Driver for RT-Thread
A high-precision real-time clock driver for the DS3231 chip, specifically designed for the RT-Thread RTOS. It integrates seamlessly with the RT-Thread RTC device framework, supporting time synchronization, alarm management, and internal temperature monitoring via I2C.
get_irq_priority for RT-Thread
A diagnostic package for RT-Thread that provides MSH commands to query and manage interrupt priorities on STM32 microcontrollers. It mimics the NVIC display found in Keil MDK's debug environment, allowing developers to view enabled interrupts, their names, and priority levels directly from the console.
GP2Y10 Dust Sensor Driver for RT-Thread
A driver package for Sharp GP2Y10 series optical dust sensors, including GP2Y1010AU0F and GP2Y1014AU0F, specifically designed for the RT-Thread RTOS. It provides both a custom API and integration with the RT-Thread sensor device framework for measuring particulate matter concentration via ADC and GPIO.
IoTSharp PANDORA STM32L475 BSP
A Board Support Package (BSP) for the STM32L475 Pandora development board running RT-Thread. It enables seamless integration with the IoTSharp platform for telemetry and attribute data collection while providing comprehensive driver support for onboard peripherals.
onps (Open Net Protocol Stack)
onps is an open-source, independently developed network protocol stack designed for resource-constrained microcontrollers. It provides a complete implementation of the Ethernet, PPP, TCP, and IP protocol families, featuring a simplified Berkeley Sockets API and zero-copy data handling. The stack is optimized for integration with RTOS environments like RT-Thread, uC/OS, and FreeRTOS.
Picorv32 + RT-Thread on Lichee Tang (EG4S20)
A project demonstrating the integration of the RT-Thread RTOS with the Picorv32 RISC-V soft core on the Lichee Tang EG4S20 FPGA. It provides the necessary Verilog source for the processor and the firmware build system to run a real-time operating system on custom hardware.
PikaPython
PikaPython is an ultra-lightweight Python interpreter optimized for microcontrollers with minimal resources, requiring only 4KB of RAM and 64KB of Flash. It provides a zero-dependency C engine with a powerful pre-compiler for seamless C-module integration, supporting a wide range of hardware including STM32, ESP32, and RISC-V platforms.
PMSxx Sensor Driver for RT-Thread
A comprehensive driver for the Plantower PMS series of digital particulate matter sensors, designed specifically for the RT-Thread RTOS. It supports a wide range of models including PMS1003 through PMSA003, offering both custom APIs and standard RT-Thread sensor framework integration.
PPP Device for RT-Thread
A specialized package for RT-Thread that implements lwIP PPP functionality for various cellular modules including 2G, 3G, and 4G modems. It enables network data transmission via PPP, bypassing the need for manual AT command handling and providing seamless integration with the SAL abstraction layer.
Qfplib-M0-full Floating-Point Library
A high-performance, compact IEEE 754 floating-point library optimized for ARM Cortex-M0 microcontrollers. It provides single- and double-precision arithmetic, trigonometric, and conversion functions with correctly rounded results. Integrated as an RT-Thread package, it offers significant speed improvements over standard GCC and CMSIS-DSP implementations.
Qfplib-M0-tiny
A highly optimized IEEE 754 single-precision floating-point library designed for ARM Cortex-M0 microcontrollers. It provides arithmetic, trigonometric, and conversion functions within a 1 kbyte footprint, specifically tailored for memory-constrained embedded systems and RT-Thread environments.
Qfplib-M3 Floating-Point Library
A high-performance IEEE 754 single-precision floating-point library optimized for ARM Cortex-M3 microcontrollers. It provides fast and accurate arithmetic routines, including trigonometric and logarithmic functions, with zero stack or static memory usage. Designed for integration with RT-Thread, it offers significant speed improvements over standard compiler libraries.
rt_memcpy Cortex-M Assembly Accelerated Version
An assembly-optimized implementation of the rt_memcpy function specifically designed for ARM Cortex-M3, M4, and M7 processors. It leverages LDMIA and STMIA instructions to significantly accelerate memory copy operations while maintaining support for non-aligned memory addresses.
RT-Rosserial for RT-Thread
A rosserial implementation for the RT-Thread RTOS that enables microcontrollers to communicate with the Robot Operating System (ROS). It supports both UART and TCP communication protocols, allowing embedded devices to publish sensor data and subscribe to ROS topics.
RT-Thread BSP for MH1903X
A Board Support Package (BSP) for the Megahunt MH1903X series of security chips, enabling the RT-Thread real-time operating system. It provides drivers for essential on-chip peripherals including GPIO, UART, RTC, and PWM, along with support for the Flash Abstraction Layer (FAL) and OTA updates.
RT-Thread BSP for STM32F407VET6
A Board Support Package (BSP) for the STM32F407VET6 development board based on the RT-Thread real-time operating system. It provides driver support for essential peripherals like GPIO, UART, SPI, and I2C, enabling rapid development on ARM Cortex-M4 hardware.
RT-Thread Full-Featured vsnprintf Package
A comprehensive implementation of the rt_vsnprintf function for the RT-Thread RTOS, enabling support for floating-point printing and other standard C features. It serves as a drop-in replacement for the minimal kernel version to provide full printf-family functionality with a significantly smaller ROM footprint than the standard C library.
RT-Thread Linux CI Environment
A containerized development and continuous integration environment for the RT-Thread real-time operating system. It provides a pre-configured Linux-based Docker image equipped with essential tools like SCons, arm-none-eabi-gcc, and Cppcheck for building and testing RT-Thread projects across various CI platforms.
RT-Thread Package List
A curated collection of portable open-source libraries identified for integration with the RT-Thread RTOS. The repository tracks various C-based projects including networking stacks, GUI modules, and file parsers, providing a roadmap for community-driven porting efforts.
RT-Thread Smart Porting for RISC-V (QEMU and K210)
A project focused on porting RT-Thread Smart, a microkernel RTOS with MMU support, to RISC-V platforms including QEMU and the Kendryte K210 SoC. It implements system calls via a POSIX-compliant interface using musl libc and supports both Supervisor and User modes.
RT-Thread Thread Pool Implementation
A lightweight and efficient thread pool implementation specifically designed for the RT-Thread RTOS. It manages a collection of worker threads and a task queue to minimize the overhead associated with frequent thread creation and destruction in resource-constrained embedded environments.
Rust Support for RT-Thread
A comprehensive Rust support layer for RT-Thread, providing safe bindings for core RTOS features like thread management, synchronization, and message queues. It integrates seamlessly with the RT-Thread SCons build system and supports ARM Cortex-M and Cortex-A architectures.
SGM706 Independent Watchdog Driver for RT-Thread
A driver package for the SGM706 multi-function microprocessor monitoring circuit, specifically designed for the RT-Thread watchdog framework. It enables standard IO device interface access for watchdog operations, including feeding and timeout management via GPIO.
STM32L475 Pandora Board BSP for RT-Thread
A comprehensive Board Support Package (BSP) for the STM32L475 Pandora development board, designed for the RT-Thread RTOS. It provides drivers for a wide range of onboard sensors, WiFi connectivity, and audio components using the ARM Cortex-M4 architecture.
syswatch: System Watchdog for RT-Thread
A system watchdog component for RT-Thread designed to ensure long-term system stability by monitoring thread scheduling. It detects crashes, hardware exceptions, and thread blocking, offering recovery modes such as system reset, thread termination, or thread restart.
TCA9534 8-bit I/O Expander Driver for RT-Thread
A driver package for the Texas Instruments TCA9534 8-bit I/O expander, built specifically for the RT-Thread device framework. It enables standard I/O device interface access for I2C-based GPIO expansion on embedded systems. The package supports pin mode configuration, polarity inversion, and standard read/write operations.
Tensorflow Lite Micro for RT-Thread
A port of the Tensorflow Lite Micro inference framework for the RT-Thread real-time operating system. It enables the deployment of deep learning models on resource-constrained embedded systems, featuring optimizations for ARM Cortex-M cores via CMSIS-NN and support for multiple hardware platforms including STM32 and Raspberry Pi.
Termbox for RT-Thread
A lightweight text-based user interface (TUI) library ported to the RT-Thread RTOS. It provides a simple API for terminal drawing and input handling, supporting Unicode characters, mouse events, and double-buffered rendering optimized for low-bandwidth channels like serial ports.
TMP1075 Temperature Sensor Driver for RT-Thread
A driver package for the Texas Instruments TMP1075 digital temperature sensor, built specifically for the RT-Thread sensor framework. It provides standard sensor interface access via I2C, supporting polling and power-down modes on RT-Thread 4.0.0+ systems.
TreeCore CPU: A Series of RISC-V Processors
A collection of 64-bit RISC-V processor cores developed from scratch using Verilog and Chisel3. The project features multiple iterations ranging from simple FSM models to multi-issue pipelined cores with cache support, capable of booting RT-Thread and running on FPGA platforms.
uC/Modbus for RT-Thread
A port of the Silicon Labs uC/Modbus stack for the RT-Thread RTOS. It provides a comprehensive implementation of the Modbus industrial communication protocol, supporting both Master and Slave modes across RTU and ASCII formats. The package leverages the uC/OS-III compatibility layer to integrate seamlessly with RT-Thread environments.
ulog_easyflash: Flash Backend and Filter Storage for RT-Thread
A plugin for the RT-Thread ulog component that utilizes the EasyFlash library to provide persistent log storage and filter configuration. It features circular log replacement, historical log retrieval via the console, and automatic loading of filter parameters at startup.
W600 RT-Thread Smart Fingerprint Lock
A smart fingerprint door lock system based on the W600 WiFi SoC and RT-Thread RTOS. It features multiple unlocking methods including fingerprint recognition, NEC infrared remote control, and remote operation via the OneNET IoT platform. The project integrates hardware components like the FPC1020A sensor and MG996R servo for a complete security solution.
W601 RT-Thread Alarm Clock
An IoT-enabled alarm clock project built on the RT-Thread RTOS for the Alientek W601 development board. It features network time synchronization via NTP, environmental monitoring using AHT10 and AP3216C sensors, and a graphical interface on an LCD. The project leverages RT-Thread's ecosystem, including WiFi connectivity, EasyFlash storage, and the FAL partition management system.
ZJ-BLE: RT-Thread and NimBLE for Nordic nRF52
A comprehensive BLE 5.0 development platform for Nordic nRF52 series microcontrollers, integrating the RT-Thread RTOS with the Apache NimBLE protocol stack. It provides a fully open-source alternative to proprietary BLE stacks, utilizing Nordic SDK 15.0 drivers and supporting the Keil MDK development environment.
ZJ-SDK RT-Thread for Nordic nRF52840
A specialized software development kit for the ZJ-TEK nRF52840 development board, integrating the RT-Thread V4.0 real-time operating system with Nordic SDK 15.0. It provides a complete firmware framework for nRF52 series microcontrollers with support for LCD displays, 9-axis sensors, and QSPI flash.
ZJ-TEK RT-Thread NimBLE LittlevGL Nordic Project
An integrated application project for Nordic nRF52840 and nRF52832 platforms featuring the RT-Thread RTOS, NimBLE BLE 5.0 stack, and LittlevGL (LVGL) graphics library. It demonstrates a complete embedded system solution including heart rate monitoring (HRM) and graphical user interface components.
micro-ROS for RT-Thread
A port of the micro-ROS framework for the RT-Thread operating system, supporting the ROS 2 Galactic distribution. It enables resource-constrained microcontrollers to participate in the ROS 2 ecosystem via UDP or Serial transports. The project includes pre-compiled libraries for various ARM Cortex-M architectures and integrated examples for common ROS 2 tasks.
MicroPython port for RT-Thread
A specialized port of MicroPython to the RT-Thread operating system, primarily targeting STM32F4 microcontrollers. It provides a seamless integration between the RT-Thread shell and the MicroPython REPL, allowing developers to control hardware and inspect RTOS internals using Python scripts.
LittlevGL2RTT
A middleware integration layer that seamlessly embeds the LittlevGL (LVGL) graphics library into the RT-Thread RTOS LCD framework. It eliminates the need for manual porting by providing a ready-to-use bridge between LVGL and RT-Thread's device drivers, supporting various input devices and display resolutions.
MicroPython for Pandora IoT Board
A specialized MicroPython port for the RT-Thread Pandora IoT Board, powered by an STM32L475 microcontroller. It leverages the RT-Thread RTOS to provide a high-level Python development environment for IoT applications, featuring extensive hardware peripheral support and integrated networking.
MicroPython for Sparrow One Board
A MicroPython implementation for the Sparrow One IoT development board, built on the RT-Thread RTOS. It provides high-level Python APIs to control hardware peripherals including cameras, LCDs, WiFi, and audio components for rapid IoT application development.
FreeRTOS Wrapper for RT-Thread
A FreeRTOS application compatibility layer for the RT-Thread operating system that enables seamless migration of FreeRTOS-based applications. It maps FreeRTOS V10.4.6 APIs to RT-Thread primitives, covering task management, queues, semaphores, and event groups while handling architectural differences like priority logic and stack units.
HDC1000 Sensor Driver for RT-Thread
A universal sensor driver package for the TI HDC1000 temperature and humidity sensor, specifically designed for the RT-Thread RTOS. It utilizes the RT-Thread Sensor component framework and I2C interface to provide high-precision environmental monitoring with ultra-low power consumption.
RT-Thread Board Support Package for Kendryte K210
A Board Support Package (BSP) for the Kendryte K210 SoC, a dual-core 64-bit RISC-V processor featuring hardware accelerators for machine vision and hearing. It integrates the RT-Thread RTOS to provide a robust development environment for AIoT applications.
FCTC-ART-Pi-Code: IoT From Chip To Cloud
A collection of firmware examples for the ART-Pi development board based on RT-Thread, covering the full IoT stack from hardware peripherals to cloud connectivity. It includes implementations for LVGL graphics, Modbus communication, file systems, and MQTT integration with Alibaba Cloud.
FlexibleButton
A lightweight and flexible C library for handling button events in embedded systems. It supports various interactions including clicks, double-clicks, long presses, and combination keys, with a decoupled architecture compatible with both RTOS (like RT-Thread) and bare-metal environments.
2019 Electronic Design Competition: Paper Counting Display Device
A high-precision paper counting system developed for the 2019 Chinese Undergraduate Electronics Design Contest. It utilizes an STM32F407 microcontroller running the RT-Thread RTOS and an FDC2214 capacitive sensor to detect paper quantity with 100% accuracy up to 50 sheets.
Arduino RT-Thread Library
A comprehensive port of the RT-Thread real-time operating system for the Arduino platform, enabling advanced multitasking and system-level features. It provides a full kernel, shell interface (FinSH), FAT filesystem support, and a micro-logging system for various ARM and RISC-V architectures.
awtk-fs-adapter
AWTK File System Adapter provides a unified interface for integrating various file systems like FATFS and SPIFFS into the AWTK (Toolkit AnyWhere) framework. It bridges the gap between embedded file system implementations and AWTK's file system API, supporting both single-threaded and multi-threaded environments.
buildpkg
buildpkg is a command-line utility designed to streamline the creation and management of RT-Thread packages. It automates the generation of standardized package templates, including READMEs, SConscript files, and CI scripts, and facilitates the migration of existing open-source repositories into the RT-Thread ecosystem.
CMSIS-RTOS1 Compatibility Layer for RT-Thread
This project provides a CMSIS-RTOS API v1 compatibility layer for the RT-Thread operating system. It enables developers to migrate legacy applications or third-party middleware designed for CMSIS-RTOS1 to the RT-Thread ecosystem without modifying the application-level code.
RT-Thread ART (Arduino RT-Thread)
ART is an Arduino-compatible development platform based on the STM32F407VGT6 microcontroller running the RT-Thread RTOS. It enables the parallel execution of multiple Arduino programs by leveraging RT-Thread's application module feature while maintaining hardware and software compatibility with the Arduino ecosystem.