CMSIS-RTOS2  Version 2.0.0
Real-Time Operating System: API and RTX Reference Implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
System Configuration

The system configuration covers system-wide settings for the global memory pool, tick frequency, ISR event buffer and round-robin thread switching.

Global Dynamic Memory

See Global Memory Pool.

Round-Robin Thread Switching

RTX5 may be configured to use Round-Robin Multitasking thread switching. Round-Robin allows quasi-parallel execution of several threads. Threads are not really executed concurrently but are time-sliced where the available CPU time is divided into time slices and RTX5 assigns a time slice to each thread. Because the time slice is typically short (only a few milliseconds) it appears as though threads execute simultaneously.

Threads execute for the duration of their time-slice (unless the thread's time slice is given up). Then RTX switches to the next thread that is ready to run and has the same priority. If no other task with the same priority is ready to run, the current running task resumes it execution.

ISR FIFO Queue

The RTX functions (Calls from Interrupt Service Routines), when called from and interrupt handler, store the request type and optional parameter to the ISR FIFO Queue buffer to be processed later, after the interrupt handler exits.

The scheduler is activated immediately after the IRQ handler has finished its execution to process the requests stored to the FIFO Queue buffer. The size of this buffer needed, depends on the number of functions, that are called within the interrupt handler. And insufficient queue size will be caught by os_Error, triggering the os_ErrorISRQueueOverflow case.

System Configuration Options

config_wizard_system.png
RTX_Config.c: System Configuration
Name #define Description
Global Dynamic Memory size [bytes] OS_DYNAMIC_MEM_SIZE Defines the combined global dynamic memory size for the Global Memory Pool. Default value is 4096. Value range is [0-1073741824] bytes, in multiples of 8 bytes.
Kernel Tick Frequency (Hz) OS_TICK_FREQ Defines base time unit for delays and timeouts in Hz. Default: 1000Hz = 1ms period.
Round-Robin Thread switching OS_ROBIN_ENABLE Enables Round-Robin Thread switching.
Round-Robin Timeout OS_ROBIN_TIMEOUT Defines how long a thread will execute before a thread switch. Default value is 5. Value range is [1-1000].
ISR FIFO Queue OS_ISR_FIFO_QUEUE RTOS Functions called from ISR store requests to this buffer. Default value is 16 entries. Value range is [4-256] entries in multiples of 4.