Overview
The Keil RTX is a royalty-free, deterministic Real-Time Operating System designed for microcontrollers based on ARM7TDMI, ARM9, and Cortex-M CPU cores. It runs quickly and takes the minimum of MCU resources with a memory footprint as small as 5KB (ROM). The RTX kernel can be used for creating applications that perform multiple functions or tasks simultaneously. It allows you to create programs that simultaneously perform multiple functions and helps to create applications which are better structured and more easily maintained. While it is certainly possible to create real-time applications without an RTOS (by executing one or more tasks in a loop), there are numerous scheduling, maintenance, and timing issues that can be solved better with an RTOS. For example, an RTOS enables flexible scheduling of system resources like CPU and memory, and offers methods to communicate between tasks. 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)
With an RTOS, all the functional blocks of your design are developed as tasks, which are then scheduled by RTX. Each of the program tasks can be developed, debugged, and tested in isolation before integration into the full system. Each RTOS task is then easier to maintain, document, and reuse. The RTX kernel provides basic functionality to start and stop concurrent tasks (processes). RTX consists of a scheduler that supports round-robin, pre-emptive, and cooperative multitasking of program tasks, as well as time and memory management services. Additional RTOS services include time and memory management and interrupt support. The RTX kernel provides several ways for inter-process communication. These are:
- Event flags: Event flags are the primary instrument for implementing task synchronization. Each task has 16 event flags assigned to it. Hence, task can selectively wait for 16 different events at the same time. In this case, the task can wait for all the selected flags (AND-connection), or wait for any one of the selected flags (OR-connection).
- Semaphores: If more than one task needs to access a common resource, special means are required in a real time multitasking system. Otherwise, accesses by different tasks might interfere and lead to inconsistent data, or a peripheral element might function incorrectly. Semaphores are the primary means of avoiding such access problems. Semaphores (binary semaphores) are software objects containing a virtual token. The kernel gives the token to the first task that requests it. No other task can obtain the token until it is released back into the semaphore. Since only the task that has the token can access the common resource, it prevents other tasks from accessing and interfering with the common resource.
- Mutexes: Mutual exclusion locks (mutexs) are an alternative to avoid synchronization and memory access problems. Mutexes are software objects that a task can use to lock the common resource. Only the task that locks the mutex can access the common resource. The kernel blocks all other tasks that request the mutex until the task that locked the mutex unlocks it.
- Mailboxes: Tasks can pass messages between each other using mailboxes. This is usually the case when implementing various high level protocols like TCP-IP, UDP, and ISDN.
To use RTX Kernel for ARM7/ARM9 or Cortex-M based applications, you must be able to successfully create RTX applications, compile and link them. 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. µVision also provides kernel aware debug for RTX which makes it easy to view kernel status and details together with information about the event timeline and resource loading.
Key Features
The Keil RTX Real-Time Operating System offers many advanced features. When you are choosing an RTOS you should take into consideration some of the following points:
- RTX is included in MDK-ARM - No additional cost to use a commercial level RTOS. 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 - No on-going costs. RTX is supplied Royalty-Free. Once licensed you can ship products created using RTX with no further fees or on-going costs.
- Flexible Scheduling - Choose the best scheduling for your application. 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 - Known behaviour for time critical tasks. 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 - Uses the minimum amount of system memory. 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 - Use it for certification. RTX source code is included in all MDK-ARM Editions. This can be useful where source code is needed for product certification.
Technical Specifications
Description | ARM7/ARM9 | Cortex-M |
---|---|---|
Defined Tasks | Unlimited | Unlimited |
Active Tasks | 250 max | 250 max |
Mailboxes | Unlimited | Unlimited |
Semaphores | Unlimited | Unlimited |
Mutexes | Unlimited | Unlimited |
Signals / Events | 16 per task | 16 per task |
User Timers | Unlimited | Unlimited |
Code Space | <4.2 Kbytes | <4.0 Kbytes |
RAM Space for Kernel | 300 bytes + 80 bytes User Stack | 300 bytes + 128 bytes Main Stack |
RAM Space for a Task | TaskStackSize + 52 bytes | TaskStackSize + 52 bytes |
RAM Space for a Mailbox | MaxMessages * 4 + 16 bytes | MaxMessages * 4 + 16 bytes |
RAM Space for a Semaphore | 8 bytes | 8 bytes |
RAM Space for a Mutex | 12 bytes | 12 bytes |
RAM Space for a User Timer | 8 bytes | 8 bytes |
Hardware Requirements | One on-chip timer | SysTick timer |
User task priorities | 1 - 254 | 1 - 254 |
Task switch time | <5.3 µsec @ 60 MHz | <2.6 µsec @ 72 MHz |
Interrupt lockout time | <2.7 µsec @ 60 MHz | Not disabled by RTX |
Licensing Options
RTX is included in MDK-ARM - No additional cost to use a commercial level RTOS. 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. Full source code for RTX is included in all MDK-ARM Editions. This allows you to rebuild libraries or extend their feature set and is useful where source code is needed for product certification. RTX may only be included in your final product in object form. The license does not grant you the right to distribute the source code.
Supported CPU
RTX Kernel Library can be used with devices based on:
Manufacturer | Core Architecture |
---|---|
Actel | Cortex-M1, Cortex-M3, ARM7TDMI-S |
Analog Devices | ARM7TDMI |
Atmel | ARM7TDMI, ARM920T, ARM926EJ-S, Cortex-M3 |
Cirrus Logic | ARM7TDMI |
Cypress | Cortex-M3 |
Freescale | ARM7TDMI, ARM926EJ-S |
Fujitsu | Cortex-M3 |
NXP | ARM7TDMI-S, ARM720T, ARM922T, ARM968E-S, Cortex-M0, Cortex-M3 |
STMicroelectronics | ARM7TDMI, ARM966E-S, Cortex-M3 |
Texas Instruments | ARM7TDMI, Cortex-M3 |
Toshiba | ARM926EJ-S, Cortex-M3 |
Zilog | ARM922T |
Video
Technical Documents
Learning Center
Type | Description |
---|---|
User Guide | ARM: Getting Started For ARM Processor-Based Microcontrollers Building Applications with RL-ARM |
User Guide | ARM: User Guide for KEIL MDK ARM Development Tool |
Design Element
Type | Description |
---|---|
Aplication Library | ARM: SWI with RTX Kernel and RealView Compiler |