µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches

Definitions used to configure the RTOS. More...

#define OS_INTEGER_SYSTICK_FREQUENCY_HZ   (1000)
 Define the scheduler frequency, in Hz.
 
#define OS_INTEGER_RTOS_CRITICAL_SECTION_INTERRUPT_PRIORITY
 For Cortex-M[347], define the interrupt priority level.
 
#define OS_INTEGER_RTOS_DEFAULT_STACK_SIZE_BYTES
 Define the default thread stack size, in bytes.
 
#define OS_INTEGER_RTOS_MAIN_STACK_SIZE_BYTES
 Define the main thread stack size, in bytes.
 
#define OS_INTEGER_RTOS_IDLE_STACK_SIZE_BYTES
 Define the idle thread stack size.
 
#define OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES   (1)
 Include statistics to count thread CPU cycles.
 
#define OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES
 Include statistics to count thread context switches.
 
#define OS_INCLUDE_RTOS_CUSTOM_THREAD_USER_STORAGE
 Add a user defined storage to each thread.
 
#define OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS   (false)
 Extend the message size to 16 bits.
 
#define OS_BOOL_RTOS_THREAD_IDLE_PRIORITY_BELOW_IDLE   (false)
 Push down the idle thread priority.
 
#define OS_BOOL_RTOS_PORT_CONTEXT_CREATE_ZERO_LR   (false)
 Force the stack trace to start with a 0x0.
 
#define OS_BOOL_RTOS_SCHEDULER_PREEMPTIVE   (true)
 Default definition for the preemption flag.
 
#define OS_EXCLUDE_RTOS_IDLE_SLEEP
 Do not enter sleep in the idle thread.
 

Detailed Description

Definitions used to configure the RTOS.

Macro Definition Documentation

◆ OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS

#define OS_BOOL_RTOS_MESSAGE_QUEUE_SIZE_16BITS   (false)

Extend the message size to 16 bits.

For embedded applications the message queues are optimised for small messages, up to 256 bytes.

If larger messages are needed, this option extends the message size to 65536 bytes.

Default
False (short messages).

Definition at line 418 of file os-app-config.h.

◆ OS_BOOL_RTOS_PORT_CONTEXT_CREATE_ZERO_LR

#define OS_BOOL_RTOS_PORT_CONTEXT_CREATE_ZERO_LR   (false)

Force the stack trace to start with a 0x0.

This option has no functional consequences, it is only cosmetic, affecting how a debugger displays the stack trace.

If your debugger has difficulties to properly display the thread stack trace, enable this option and the stack will always start with a 0x0.

Default
False (the stack trace starts with the first function).

Definition at line 451 of file os-app-config.h.

◆ OS_BOOL_RTOS_SCHEDULER_PREEMPTIVE

#define OS_BOOL_RTOS_SCHEDULER_PREEMPTIVE   (true)

Default definition for the preemption flag.

This option sets the initial value of the scheduler::preemptive() flag. It can be changed at any time.

Default
True (preemption is enabled).

Definition at line 464 of file os-app-config.h.

◆ OS_BOOL_RTOS_THREAD_IDLE_PRIORITY_BELOW_IDLE

#define OS_BOOL_RTOS_THREAD_IDLE_PRIORITY_BELOW_IDLE   (false)

Push down the idle thread priority.

Normally the applications should not create threads with the idle priority.

However, some applications, like the ARM CMSIS RTOS validator, need to test the behaviour of idle threads. For such cases, to guarantee that the idle thread is the lowest priority thread, its priority can be lowered one additional step.

Default
False (the idle thread has the idle priority).

Definition at line 435 of file os-app-config.h.

◆ OS_EXCLUDE_RTOS_IDLE_SLEEP

#define OS_EXCLUDE_RTOS_IDLE_SLEEP

Do not enter sleep in the idle thread.

Very fast debuggers need direct access to a RAM buffer, which in turn need the clock that powers the bus where the RAM is connected to be permanently on.

Unfortunately, most devices disable this clock when entering even the shallow sleep mode, disabling the debugger access to the device.

To prevent this, usually for the debug configurations, it is possible to exclude the code that puts the device to sleep.

Definition at line 481 of file os-app-config.h.

◆ OS_INCLUDE_RTOS_CUSTOM_THREAD_USER_STORAGE

#define OS_INCLUDE_RTOS_CUSTOM_THREAD_USER_STORAGE

Add a user defined storage to each thread.

Definition at line 403 of file os-app-config.h.

◆ OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES

#define OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES

Include statistics to count thread context switches.

Add support to count the number of times each thread was scheduled to run.

At each context switch, the thread counter is incremented. At the same time a global counter is also incremented.

The RAM overhead of enabling this option is a uint64_t variable for each thread and one global variable.

The time overhead is low, incrementing two 64-bit variables.

See also
os::rtos::scheduler::statistics::context_switches()
os::rtos::thread::statistics::context_switches()
Default
Disable. Do not include context switches statistics.

Definition at line 398 of file os-app-config.h.

◆ OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES

#define OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES   (1)

Include statistics to count thread CPU cycles.

Add support to measure and accumulate accurate thread duration statistics.

At each context switch, the high resolution clock is sampled and the difference is added to the current thread statistics variables. At the same time the value is added to a global variable.

The RAM overhead of enabling this option is a uint64_t variable for each thread and one global variable.

The time overhead is a clock sampling (reading timer registers and possibly adjusting for timer recycle) plus some subtractions/additions on 64-bits.

See also
os::rtos::scheduler::statistics::cpu_cycles()
os::rtos::thread::statistics::cpu_cycles()
Default
Disable. Do not include CPU cycles statistics.

Definition at line 376 of file os-app-config.h.

◆ OS_INTEGER_RTOS_CRITICAL_SECTION_INTERRUPT_PRIORITY

#define OS_INTEGER_RTOS_CRITICAL_SECTION_INTERRUPT_PRIORITY

For Cortex-M[347], define the interrupt priority level.

Simple devices implement critical sections by disabling/enabling all interrupts. Cortex-M[347] devices can selectively disable interrupts up to a given priority (by using the BASEPRI register).

When used, this option configures the critical sections to disable all interrupts with priorities up to the given value and keep enabled interrupts with higher priorities.

Note
Considering the confusing ARM priority scheme, this means priorities with a numeric value higher or equal the given value will be disabled and priorities with a numeric value lower thant he given value will remain enabled.
Warning
The number of different priority levels is vendor dependent. For example ST devices use 4 bits (0-15, with 15=lowest), but others may use 3 bits (0-7, with 7=lowest).

If the application does not use high priority interrupts, it is recommend to do not use this option, and allow the system to implement the critical sections by completely disabling/enabling interrupts.

If used, the recommended value is 3-4.

Default
Use of interrupts priorities is disabled.

Definition at line 332 of file os-app-config.h.

◆ OS_INTEGER_RTOS_DEFAULT_STACK_SIZE_BYTES

#define OS_INTEGER_RTOS_DEFAULT_STACK_SIZE_BYTES

Define the default thread stack size, in bytes.

Definition at line 337 of file os-app-config.h.

◆ OS_INTEGER_RTOS_IDLE_STACK_SIZE_BYTES

#define OS_INTEGER_RTOS_IDLE_STACK_SIZE_BYTES

Define the idle thread stack size.

Note
Ignored for synthetic platforms.

Definition at line 351 of file os-app-config.h.

◆ OS_INTEGER_RTOS_MAIN_STACK_SIZE_BYTES

#define OS_INTEGER_RTOS_MAIN_STACK_SIZE_BYTES

Define the main thread stack size, in bytes.

Note
Ignored for synthetic platforms.

Definition at line 344 of file os-app-config.h.

◆ OS_INTEGER_SYSTICK_FREQUENCY_HZ

#define OS_INTEGER_SYSTICK_FREQUENCY_HZ   (1000)

Define the scheduler frequency, in Hz.

Default
1000.

Definition at line 297 of file os-app-config.h.