ARM Development Tools

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 Message Passing
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.

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