RTX Real-Time Operating System

RTX real-time operating system

The Keil RTX is a royalty-free, deterministic Real-Time Operating System designed for ARM and Cortex-M devices. It allows you to create programs that simultaneously perform multiple functions and helps to create applications which are better structured and more easily maintained.

Product Highlights

  • Royalty-free, deterministic RTOS with source code
  • Flexible Scheduling: round-robin, pre-emptive, and collaborative
  • High-Speed real-time operation with low interrupt latency
  • Small footprint for resource constrained systems
  • Unlimited number of tasks each with 254 priority levels
  • Unlimited number of mailboxes, semaphores, mutex, and timers
  • Support for multithreading and thread-safe operation
  • Kernel aware debug support in MDK-ARM
  • Dialog-based setup using µVision Configuration Wizard

While it is certainly possible to create real-time programs without an RTOS (by executing one or more functions in a Super-loop), there are numerous scheduling, maintenance, and timing issues that an RTOS like the Keil RTX solves for you. For a more detailed comparison between RTOS and Super-loop, take a look at the advantages of using an RTOS.


Round-Robin yes
Preemptive yes
Cooperative yes
Task Specifications
Defined Tasks (max) Unlimited
Active Tasks 250
Defined Tasks (max) Unlimited
User Priorities 1 - 254
Stack Checking yes
Context Switch Time < 300 cycles
Interrupt Lock-Out Time -
Timeouts yes
Intervals yes
User Timers Unlimited
Signals/Events 16 per task
Inter-Task Communication
Events (max) Unlimited
Signals/Events 16 per task
Semaphores (max) Unlimited
Mutexes (max) Unlimited
Mailboxes (max) Unlimited
Maillbox size Unlimited (Default 20)


  • Unlimited means that the RTX kernel does not impose any limitations on the number. However, the available system memory resources limit the number of items you can create.
  • The RTX library for Cortex™-M3/M4 does not disable interrupts. Interrupt latency is the same as without the RTX kernel. Interrupt latency for Cortex™-M0/M1 is < 20 cycles.

Task Specifications Performance (Cycles)
Interupt Latency n/a, see note
Initialize system, start task 1,147
Create task (no task switch) 403
Create task (with task switch) 461
Delete Task 218
Task Switch 192
Set event 89
Send semaphore 72
Send message 117


  • The RTX Kernel library for Cortex-M does not disable interrupts. Interrupt response time for ISRs is the same as without the RTX kernel.

Memory Requirements
Task Specifications Performance
CODE Size < 4.0 KBytes
RAM Space for Kernel < 300 Bytes + 128 Bytes User Stack
RAM Space for a Task TaskStackSize + 52 Bytes
RAM Space for a Mailbox MaxMessages*4 + 16 Bytes
RAM Space for a Semaphore 8 Bytes
RAM Space for a Mutex 12 Bytes
RAM Space for a User Timer 8 Bytes
Hardware Requirements SysTick timer


  • The RTX Kernel for this test was configured for 10 tasks, 10 user timers, and stack checking disabled.
  • RAM requirements depend on the number of concurrently running tasks.
  • The code and RAM sizes were calculated using the MicoLib runtime library.
  • Further details are available here.


The Keil RTX Real-Time Operating System offers many advanced features which are not always available in RTOS products from other vendors. When you are choosing an RTOS you should take into consideration some of the following points:

  • RTX is included in MDK-ARM - The full featured, commercial level RTX (including Source Code) is provided as part of the Keil MDK-ARM development tools. This is not an evaluation version. It is fully configurable, and has no restrictions. Therefore, if you plan to use MDK for your development, RTX is free of charge.
  • RTX is Royalty-Free - RTX is supplied Royalty-Free. Once licensed you can ship products created using RTX with no further fees or on-going costs.
  • Market Leading RTOS - RTX is consistently shown to be one of the leading RTOS used in embedded applications (TechInsights Embedded Market Study 2010). You can be confident using RTX in your application.
  • Flexible Scheduling - RTX offers three different kernel scheduling options, allowing you to use the one most suited to your application:
    • Pre-emptive - each task has a different priority and will run until a higher priority task is ready to run. This is commonly used in interactive systems where a device may be in standby or background mode until some input from a user.
    • Round-Robin - each task will run for a fixed period of CPU run-time (time slice). Data loggers/system monitors typically employ round-robin scheduling, all sensors or data-sources are sampled in turn with no prioritization.
    • Co-operative - each task will run until it is told to pass control to another task or reaches a blocking OS call. Co-operative multi-tasking can be seen in applications that require a fixed order of execution.
  • Deterministic Behavior - Not every RTOS is deterministic. RTX delivers fully deterministic behaviour meaning that events and interrupts are handled within a predefined time (deadline). Your application can rely on consistent and known process timings.
  • Designed for Embedded Systems - RTX is specifically written for embedded systems based on ARM and Cortex-M MCUs. It has not been adapted from a larger operating system or from another architecture. It runs quickly and takes the minimum of MCU resources with a memory footprint as small as 5KB (ROM).
  • Easy to Use - Short learning cycle, faster product development. RTX is well supported within the µVision IDE/Debugger, which features RTX task aware tools to enable you to quickly and easily configure and debug RTX in your applications.
  • Source Code - RTX source code is included in all MDK-ARM Editions. This can be useful where source code is needed for product certification.
  • Support - There are extensive resources including examples, User's Guide and a printed Getting Started Guide. RTX is fully supported by Keil.

RTOS Advantages

Simple embedded systems typically use a Super-Loop concept where the application executes each function in a fixed order. Interrupt Service Routines (ISR) are used for time-critical program portions. This approach is well suited for small systems but has limitations for more complex applications.

Disadvantages of the Super-Loop Concept

  • Time-critical operations must be processed within interrupts (ISR)
    • ISR functions become complex and require long execution times
    • ISR nesting may create unpredictable execution time and stack requirements
  • Data exchange between Super-Loop and ISR is via global shared variables
    • Application programmer must ensure data consistency
  • A Super-Loop can be easily synchronized with the System timer, but:
    • If a system requires several different cycle times, it is hard to implement
    • Split of time-consuming functions that exceed Super-Loop cycle
    • Creates software overhead and application program is hard to understand
  • Super-Loop applications become complex and therefore hard to extend
    • A simple change may have unpredictable side effects; such side effects are time consuming to analyze.

These disadvantages of the Super-Loop concept are solved by using a Real-Time Operating System (RTOS).

RTOS Concept

A RTOS separates the program functions into self-contained tasks and implements an on-demand scheduling of their execution. An advanced RTOS, such as the Keil RTX, delivers serious benefits:

  • Task scheduling - tasks are called when needed ensuring better program flow and event response
  • Multitasking - task scheduling gives the illusion of executing a number of tasks simultaneously
  • Deterministic behaviour - events and interrupts are handled within a defined time
  • Shorter ISRs - enables more deterministic interrupt behaviour
  • Inter-task communication - manages the sharing of data, memory, and hardware resources among multiple tasks
  • Defined stack usage - each task is allocated a defined stack space, enabling predictable memory usage
  • System management - allows you to focus on application development rather than resource management (housekeeping)

RTX functions

Tasks 1 & 2 are functions in the application. RTX provides management of the Memory Pool and Mailbox as well as the communication mechanisms used between the tasks.

RTOX resources

RTX provides a simple syntax for straightforward access to all of the RTOS resources.



We use cookies to give you the best experience on our website. By continuing to use our site you consent to our cookies.

Change Settings

Find out more about the cookies we set