RT-Thread University Program

Link: https://www.rt-thread.org/document/site

As a beginner of RTOS, you may be unfamiliar with RT-Thread. However, as you get to know it better, you will gradually discover the charm of RT-Thread and its advantages over other similar RTOS. RT-Thread is an embedded real-time operating system (RTOS) developed and maintained entirely by a domestic team, with complete independent intellectual property rights. After 16 years of development, along with the rise of the Internet of Things, it is evolving into a powerful and component-rich IoT operating system.

RT-Thread, the full name is Real Time-Thread. As the name implies, it is an embedded real-time multi-threaded operating system. One of its basic properties is to support multi-tasking. Allowing multiple tasks to run simultaneously does not mean that the processor really executes multiple tasks at the same time. In fact, a processor core can only run one task at a time. Since the execution time of each task is very short and the tasks are switched very quickly through the task scheduler (the scheduler determines the task to be executed at the moment based on the priority), it gives people the illusion that multiple tasks are running at the same time. In the RT-Thread system, tasks are implemented through threads, and the thread scheduler in RT-Thread is the task scheduler mentioned above.

RT-Thread is mainly written in C language, which is easy to understand and easy to port. It applies object-oriented design methods to real-time system design, making the code style elegant, the architecture clear, the system modular and very easy to tailor. For resource-constrained microcontroller (MCU) systems, easy-to-use tools can be used to tailor a NANO version that only requires 3KB Flash and 1.2KB RAM memory resources (NANO is a minimalist kernel officially released by RT-Thread in July 2017); and for resource-rich IoT devices, RT-Thread can use online software package management tools and system configuration tools to achieve intuitive and fast modular tailoring, seamlessly import rich software function packages, and realize complex functions such as Android-like graphical interfaces, touch sliding effects, and intelligent voice interaction effects.

Compared with the Linux operating system, RT-Thread is small in size, low in cost, low in power consumption, and fast in startup. In addition, RT-Thread has the characteristics of high real-time performance and small resource usage, making it very suitable for various resource-constrained occasions (such as cost and power consumption restrictions). Although 32-bit MCU is its main operating platform, in fact, many application processors with MMU, based on ARM9, ARM11, and even Cortex-A series-level CPUs are also suitable for using RT-Thread in specific applications.

The RT-Thread system is completely open source and complies with the Apache License 2.0 open source license agreement. It can be used in commercial products for free, does not require the disclosure of private code, and has no potential commercial risks.

In recent years, the concept of Internet of Things (IoT) has become widely popular, the IoT market has developed rapidly, and the networking of embedded devices has become a general trend. The networking of terminals has greatly increased the complexity of software, and the traditional RTOS kernel has become increasingly difficult to meet the needs of the market. In this case, the concept of IoT operating system (IoT OS) came into being. IoT operating system refers to a software platform based on the operating system kernel (which can be RTOS, Linux, etc.), including relatively complete middleware components such as file system and graphics library, with low power consumption, security, communication protocol support and cloud connection capabilities . RT-Thread is an IoT OS.

One of the main differences between RT-Thread and many other RTOS such as FreeRTOS and uC/OS is that it is not only a real-time kernel, but also has a rich middle-layer components , as shown in the figure below.

It specifically includes the following parts:

  • Kernel layer: RT-Thread kernel is the core part of RT-Thread, including the implementation of objects in the kernel system, such as multi-threading and its scheduling, semaphores, mailboxes, message queues, memory management, timers, etc.; libcpu/BSP (chip transplantation related files/board support package) is closely related to hardware and consists of peripheral drivers and CPU transplantation.

  • Component and service layer: Components are upper-layer software based on the RT-Thread kernel, such as virtual file system, FinSH command line interface, network framework, device framework, etc. A modular design is adopted to achieve high cohesion within the components and low coupling between components.

  • RT-Thread software package: A general software component for different application fields that runs on the RT-Thread IoT operating system platform and consists of description information, source code or library files. RT-Thread provides an open software package platform, which stores official or developer-provided software packages. The platform provides developers with a wide range of reusable software packages to choose from, which is also an important part of the RT-Thread ecosystem. The software package ecosystem is crucial to the choice of an operating system because these software packages are highly reusable and highly modular, which greatly facilitates application developers to build the system they want in the shortest time. The number of software packages that RT-Thread already supports has reached 400+, as shown below:

  • IoT related packages: Paho MQTT, WebClient, mongoose, WebTerminal, etc.

  • Scripting language related software packages: currently support Lua, JerryScript, MicroPython, and PikaScript.

  • Multimedia-related software packages: Openmv, mupdf.

  • Tool software packages: CmBacktrace, EasyFlash, EasyLogger, SystemView.

  • System-related packages: RTGUI, Persimmon UI, lwext4, partition, SQLite, etc.

  • Peripheral library and driver software package: RealTek RTL8710BN SDK.

  • other.

Last updated

Assoc. Prof. Wiroon Sriborrirux, Founder of Advance Innovation Center (AIC) and Bangsaen Design House (BDH), Electrical Engineering Department, Faculty of Engineering, Burapha University