CMSIS-RTOS2
Version 2.1.2
Real-Time Operating System: API and RTX Reference Implementation
|
The file "RTX_Config.h" defines the configuration parameters of CMSIS-RTOS RTX and must be part of every project that is using the CMSIS-RTOS RTX kernel. The configuration options are explained in detail in the following sections:
The file "RTX_Config.c" contains default implementations of the functions osRtxIdleThread and osRtxErrorNotify. Both functions can simply be overwritten with a custimized behavior by redefining them as part of the user code.
The configuration file uses Configuration Wizard Annotations. Refer to Pack - Configuration Wizard Annotations for details. Depending on the development tool, the annotations might lead to a more user-friendly graphical representation of the settings. The screenshot below is a screenshot from the µVision Configuration Wizard view:
Alternatively one can provide configuration options using the compiler command line.
For example one can customize the used tick frequency to 100us by (overwriting) the configuration using
The system configuration covers system-wide settings for the global memory pool, tick frequency, ISR event buffer and round-robin thread switching.
System Configuration Options
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. |
Memory Management | OS_EVR_MEMORY | Enables Memory Management events recording. |
Kernel | OS_EVR_KERNEL | Enables Kernel events recording. |
Thread | OS_EVR_THREAD | Enables Thread events recording. |
Timer | OS_EVR_TIMER | Enables Timer events recording. |
Event Flags | OS_EVR_EVFLAGS | Enables Event Flags events recording. |
Mutex | OS_EVR_MUTEX | Enables Mutex events recording. |
Semaphore | OS_EVR_SEMAPHORE | Enables Semaphore events recording. |
Memory Pool | OS_EVR_MEMPOOL | Enables Memory Pool events recording. |
Message Queue | OS_EVR_MSGQUEUE | Enables Message Queue events recording. |
Object Memory usage counters | OS_OBJ_MEM_USAGE | Enables object memory usage counters to evaluate the maximum memory pool requirements individually for each RTOS object type. |
Refer to Global Memory Pool.
RTX5 may be configured to use round-robin multitasking thread switching. Round-robin allows quasi-parallel execution of several threads of the same priority. Threads are not really executed concurrently, but are scheduled 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.
Round-robin thread switching functions as follows:
In other words, threads execute for the duration of their time slice (unless a thread's time slice is given up). Then, RTX switches to the next thread that is in READY state and has the same priority. If no other thread with the same priority is ready to run, the current running thread resumes it execution.
Round-Robin multitasking is controlled with the #define OS_ROBIN_ENABLE. The time slice period is configured (in RTX timer ticks) with the #define OS_ROBIN_TIMEOUT.
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 required size of this buffer depends on the number of functions that are called within the interrupt handler. An insufficient queue size will be caught by osRtxErrorNotify with error code osRtxErrorISRQueueOverflow.
RTX5 fully supports Event Recorder annotations. In this section, you can enable or disable the recording of events for the different elements of RTX5. This leads to reduced data traffic on the debug connection.
This setting should be used to disable the generation of messages for a complete family of events. To disable events only for a certain API call, use the #defines that are available from the rtx_evrt.h header file by adding them manually to the RTX_Config.h file:
Memory events
EVR_RTX_MEMORY_INIT_DISABLE
, EVR_RTX_MEMORY_ALLOC_DISABLE
, EVR_RTX_MEMORY_FREE_DISABLE
, EVR_RTX_MEMORY_BLOCK_INIT_DISABLE
, EVR_RTX_MEMORY_BLOCK_ALLOC_DISABLE
, EVR_RTX_MEMORY_BLOCK_FREE_DISABLE
Kernel events
EVR_RTX_KERNEL_ERROR_DISABLE
, EVR_RTX_KERNEL_INITIALIZE_DISABLE
, EVR_RTX_KERNEL_INITIALIZE_COMPLETED_DISABLE
, EVR_RTX_KERNEL_GET_INFO_DISABLE
, EVR_RTX_KERNEL_INFO_RETRIEVED_DISABLE
, EVR_RTX_KERNEL_GET_STATE_DISABLE
, EVR_RTX_KERNEL_START_DISABLE
, EVR_RTX_KERNEL_STARTED_DISABLE
, EVR_RTX_KERNEL_LOCK_DISABLE
, EVR_RTX_KERNEL_LOCKED_DISABLE
, EVR_RTX_KERNEL_UNLOCK_DISABLE
, EVR_RTX_KERNEL_UNLOCKED_DISABLE
, EVR_RTX_KERNEL_RESTORE_LOCK_DISABLE
, EVR_RTX_KERNEL_LOCK_RESTORED_DISABLE
, EVR_RTX_KERNEL_SUSPEND_DISABLE
, EVR_RTX_KERNEL_SUSPENDED_DISABLE
, EVR_RTX_KERNEL_RESUME_DISABLE
, EVR_RTX_KERNEL_RESUMED_DISABLE
, EVR_RTX_KERNEL_GET_TICK_COUNT_DISABLE
, EVR_RTX_KERNEL_GET_TICK_FREQ_DISABLE
, EVR_RTX_KERNEL_GET_SYS_TIMER_COUNT_DISABLE
, EVR_RTX_KERNEL_GET_SYS_TIMER_FREQ_DISABLE
Thread events
EVR_RTX_THREAD_ERROR_DISABLE
, EVR_RTX_THREAD_NEW_DISABLE
, EVR_RTX_THREAD_CREATED_DISABLE
, EVR_RTX_THREAD_GET_NAME_DISABLE
, EVR_RTX_THREAD_GET_ID_DISABLE
, EVR_RTX_THREAD_GET_STATE_DISABLE
, EVR_RTX_THREAD_GET_STACK_SIZE_DISABLE
, EVR_RTX_THREAD_GET_STACK_SPACE_DISABLE
, EVR_RTX_THREAD_SET_PRIORITY_DISABLE
, EVR_RTX_THREAD_GET_PRIORITY_DISABLE
, EVR_RTX_THREAD_YIELD_DISABLE
, EVR_RTX_THREAD_SUSPEND_DISABLE
, EVR_RTX_THREAD_SUSPENDED_DISABLE
, EVR_RTX_THREAD_RESUME_DISABLE
, EVR_RTX_THREAD_RESUMED_DISABLE
, EVR_RTX_THREAD_DETACH_DISABLE
, EVR_RTX_THREAD_DETACHED_DISABLE
, EVR_RTX_THREAD_JOIN_DISABLE
, EVR_RTX_THREAD_JOIN_PENDING_DISABLE
, EVR_RTX_THREAD_JOINED_DISABLE
, EVR_RTX_THREAD_BLOCKED_DISABLE
, EVR_RTX_THREAD_UNBLOCKED_DISABLE
, EVR_RTX_THREAD_PREEMPTED_DISABLE
, EVR_RTX_THREAD_SWITCHED_DISABLE
, EVR_RTX_THREAD_EXIT_DISABLE
, EVR_RTX_THREAD_TERMINATE_DISABLE
, EVR_RTX_THREAD_DESTROYED_DISABLE
, EVR_RTX_THREAD_GET_COUNT_DISABLE
, EVR_RTX_THREAD_ENUMERATE_DISABLE
Thread flag events
EVR_RTX_THREAD_FLAGS_SET_DISABLE
, EVR_RTX_THREAD_FLAGS_SET_DONE_DISABLE
, EVR_RTX_THREAD_FLAGS_CLEAR_DISABLE
, EVR_RTX_THREAD_FLAGS_CLEAR_DONE_DISABLE
, EVR_RTX_THREAD_FLAGS_GET_DISABLE
, EVR_RTX_THREAD_FLAGS_WAIT_DISABLE
, EVR_RTX_THREAD_FLAGS_WAIT_PENDING_DISABLE
, EVR_RTX_THREAD_FLAGS_WAIT_TIMEOUT_DISABLE
, EVR_RTX_THREAD_FLAGS_WAIT_COMPLETED_DISABLE
, EVR_RTX_THREAD_FLAGS_WAIT_NOT_COMPLETED_DISABLE
Generic wait events
EVR_RTX_THREAD_DELAY_DISABLE
, EVR_RTX_THREAD_DELAY_UNTIL_DISABLE
, EVR_RTX_THREAD_DELAY_COMPLETED_DISABLE
Timer events
EVR_RTX_TIMER_ERROR_DISABLE
, EVR_RTX_TIMER_CALLBACK_DISABLE
, EVR_RTX_TIMER_NEW_DISABLE
, EVR_RTX_TIMER_CREATED_DISABLE
, EVR_RTX_TIMER_GET_NAME_DISABLE
, EVR_RTX_TIMER_START_DISABLE
, EVR_RTX_TIMER_STARTED_DISABLE
, EVR_RTX_TIMER_STOP_DISABLE
, EVR_RTX_TIMER_STOPPED_DISABLE
, EVR_RTX_TIMER_IS_RUNNING_DISABLE
, EVR_RTX_TIMER_DELETE_DISABLE
, EVR_RTX_TIMER_DESTROYED_DISABLE
Event flag events
EVR_RTX_EVENT_FLAGS_ERROR_DISABLE
, EVR_RTX_EVENT_FLAGS_NEW_DISABLE
, EVR_RTX_EVENT_FLAGS_CREATED_DISABLE
, EVR_RTX_EVENT_FLAGS_GET_NAME_DISABLE
, EVR_RTX_EVENT_FLAGS_SET_DISABLE
, EVR_RTX_EVENT_FLAGS_SET_DONE_DISABLE
, EVR_RTX_EVENT_FLAGS_CLEAR_DISABLE
, EVR_RTX_EVENT_FLAGS_CLEAR_DONE_DISABLE
, EVR_RTX_EVENT_FLAGS_GET_DISABLE
, EVR_RTX_EVENT_FLAGS_WAIT_DISABLE
, EVR_RTX_EVENT_FLAGS_WAIT_PENDING_DISABLE
, EVR_RTX_EVENT_FLAGS_WAIT_TIMEOUT_DISABLE
, EVR_RTX_EVENT_FLAGS_WAIT_COMPLETED_DISABLE
, EVR_RTX_EVENT_FLAGS_WAIT_NOT_COMPLETED_DISABLE
, EVR_RTX_EVENT_FLAGS_DELETE_DISABLE
, EVR_RTX_EVENT_FLAGS_DESTROYED_DISABLE
Mutex events
EVR_RTX_MUTEX_ERROR_DISABLE
, EVR_RTX_MUTEX_NEW_DISABLE
, EVR_RTX_MUTEX_CREATED_DISABLE
, EVR_RTX_MUTEX_GET_NAME_DISABLE
, EVR_RTX_MUTEX_ACQUIRE_DISABLE
, EVR_RTX_MUTEX_ACQUIRE_PENDING_DISABLE
, EVR_RTX_MUTEX_ACQUIRE_TIMEOUT_DISABLE
, EVR_RTX_MUTEX_ACQUIRED_DISABLE
, EVR_RTX_MUTEX_NOT_ACQUIRED_DISABLE
, EVR_RTX_MUTEX_RELEASE_DISABLE
, EVR_RTX_MUTEX_RELEASED_DISABLE
, EVR_RTX_MUTEX_GET_OWNER_DISABLE
, EVR_RTX_MUTEX_DELETE_DISABLE
, EVR_RTX_MUTEX_DESTROYED_DISABLE
Semaphore events
EVR_RTX_SEMAPHORE_ERROR_DISABLE
, EVR_RTX_SEMAPHORE_NEW_DISABLE
, EVR_RTX_SEMAPHORE_CREATED_DISABLE
, EVR_RTX_SEMAPHORE_GET_NAME_DISABLE
, EVR_RTX_SEMAPHORE_ACQUIRE_DISABLE
, EVR_RTX_SEMAPHORE_ACQUIRE_PENDING_DISABLE
, EVR_RTX_SEMAPHORE_ACQUIRE_TIMEOUT_DISABLE
, EVR_RTX_SEMAPHORE_ACQUIRED_DISABLE
, EVR_RTX_SEMAPHORE_NOT_ACQUIRED_DISABLE
, EVR_RTX_SEMAPHORE_RELEASE_DISABLE
, EVR_RTX_SEMAPHORE_RELEASED_DISABLE
, EVR_RTX_SEMAPHORE_GET_COUNT_DISABLE
, EVR_RTX_SEMAPHORE_DELETE_DISABLE
, EVR_RTX_SEMAPHORE_DESTROYED_DISABLE
Memory pool events
EVR_RTX_MEMORY_POOL_ERROR_DISABLE
, EVR_RTX_MEMORY_POOL_NEW_DISABLE
, EVR_RTX_MEMORY_POOL_CREATED_DISABLE
, EVR_RTX_MEMORY_POOL_GET_NAME_DISABLE
, EVR_RTX_MEMORY_POOL_ALLOC_DISABLE
, EVR_RTX_MEMORY_POOL_ALLOC_PENDING_DISABLE
, EVR_RTX_MEMORY_POOL_ALLOC_TIMEOUT_DISABLE
, EVR_RTX_MEMORY_POOL_ALLOCATED_DISABLE
, EVR_RTX_MEMORY_POOL_ALLOC_FAILED_DISABLE
, EVR_RTX_MEMORY_POOL_FREE_DISABLE
, EVR_RTX_MEMORY_POOL_DEALLOCATED_DISABLE
, EVR_RTX_MEMORY_POOL_FREE_FAILED_DISABLE
, EVR_RTX_MEMORY_POOL_GET_CAPACITY_DISABLE
, EVR_RTX_MEMORY_POOL_GET_BLOCK_SZIE_DISABLE
, EVR_RTX_MEMORY_POOL_GET_COUNT_DISABLE
, EVR_RTX_MEMORY_POOL_GET_SPACE_DISABLE
, EVR_RTX_MEMORY_POOL_DELETE_DISABLE
, EVR_RTX_MEMORY_POOL_DESTROYED_DISABLE
Message queue events
EVR_RTX_MESSAGE_QUEUE_ERROR_DISABLE
, EVR_RTX_MESSAGE_QUEUE_NEW_DISABLE
, EVR_RTX_MESSAGE_QUEUE_CREATED_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_NAME_DISABLE
, EVR_RTX_MESSAGE_QUEUE_PUT_DISABLE
, EVR_RTX_MESSAGE_QUEUE_PUT_PENDING_DISABLE
, EVR_RTX_MESSAGE_QUEUE_PUT_TIMEOUT_DISABLE
, EVR_RTX_MESSAGE_QUEUE_INSERT_PENDING_DISABLE
, EVR_RTX_MESSAGE_QUEUE_INSERTED_DISABLE
, EVR_RTX_MESSAGE_QUEUE_NOT_INSERTED_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_PENDING_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_TIMEOUT_DISABLE
, EVR_RTX_MESSAGE_QUEUE_RETRIEVED_DISABLE
, EVR_RTX_MESSAGE_QUEUE_NOT_RETRIEVED_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_CAPACITY_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_MSG_SIZE_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_COUNT_DISABLE
, EVR_RTX_MESSAGE_QUEUE_GET_SPACE_DISABLE
, EVR_RTX_MESSAGE_QUEUE_RESET_DISABLE
, EVR_RTX_MESSAGE_QUEUE_RESET_DONE_DISABLE
, EVR_RTX_MESSAGE_QUEUE_DELETE_DISABLE
, EVR_RTX_MESSAGE_QUEUE_DESTROYED_DISABLE
Object memory usage counters help to evaluate the maximum memory pool requirements for each object type, just like stack watermarking does for threads. The initial setup starts with a global memory pool for all object types. Consecutive runs of the application with object memory usage counters enabled, help to introduce object specific memory pools for each object type. Normally, this is required for applications that require a functional safety certification as global memory pools are not allowed in this case.
The RTX5 provides several parameters to configure the Thread Management functions.
Thread Configuration Options
Option | #define | Description |
---|---|---|
Object specific Memory allocation | OS_THREAD_OBJ_MEM | Enables object specific memory allocation. See Object-specific Memory Pools. |
Number of user Threads | OS_THREAD_NUM | Defines maximum number of user threads that can be active at the same time. Applies to user threads with system provided memory for control blocks. Default value is 1. Value range is [1-1000]. |
Number of user Threads with default Stack size | OS_THREAD_DEF_STACK_NUM | Defines maximum number of user threads with default stack size and applies to user threads with 0 stack size specified. Value range is [0-1000]. |
Total Stack size [bytes] for user Threads with user-provided Stack size | OS_THREAD_USER_STACK_SIZE | Defines the combined stack size for user threads with user-provided stack size. Default value is 0. Value range is [0-1073741824] Bytes, in multiples of 8. |
Default Thread Stack size [bytes] | OS_STACK_SIZE | Defines stack size for threads with zero stack size specified. Default value is 200. Value range is [96-1073741824] Bytes, in multiples of 8. |
Idle Thread Stack size [bytes] | OS_IDLE_THREAD_STACK_SIZE | Defines stack size for Idle thread. Default value is 200. Value range is [72-1073741824] bytes, in multiples of 8. |
Idle Thread TrustZone Module ID | OS_IDLE_THREAD_TZ_MOD_ID | Defines the TrustZone Module ID the Idle Thread shall use. This needs to be set to a non-zero value if the Idle Thread need to call secure functions. Default value is 0. |
Stack overrun checking | OS_STACK_CHECK | Enable stack overrun checks at thread switch. |
Stack usage watermark | OS_STACK_WATERMARK | Initialize thread stack with watermark pattern for analyzing stack usage. Enabling this option increases significantly the execution time of thread creation. |
Processor mode for Thread execution | OS_PRIVILEGE_MODE | Controls the processor mode. Default value is Privileged mode. Value range is [0=Unprivileged; 1=Privileged] mode. |
The RTX5 kernel uses a separate stack space for each thread and provides two methods for defining the stack requirements:
osThreadAttr_t is a parameter of the function osThreadNew.
RTX5 implements a software stack overflow checking that traps stack overruns. Stack is used for return addresses and automatic variables. Extensive usage or incorrect stack configuration may cause a stack overflow. Software stack overflow checking is controlled with the define OS_STACK_CHECK
.
If a stack overflow is detected, the function osRtxErrorNotify with error code osRtxErrorStackUnderflow is called. By default, this function is implemented as an endless loop and will practically stop code execution.
RTX5 initializes thread stack with a watermark pattern (0xCC) when a thread is created. This allows the debugger to determine the maximum stack usage for each thread. It is typically used during development but removed from the final application. Stack usage watermark is controlled with the define OS_STACK_WATERMARK
.
Enabling this option significantly increases the execution time of osThreadNew (depends on thread stack size).
RTX5 allows to execute threads in unprivileged or privileged processor mode. The processor mode is controlled with the define OS_PRIVILEGE_MODE
.
In unprivileged processor mode, the application software:
In privileged processor mode, the application software can use all the instructions and has access to all resources.
RTX5 provides several parameters to configure the Timer Management functions.
Timer Configuration Options
Name | #define | Description |
---|---|---|
Object specific Memory allocation | OS_TIMER_OBJ_MEM | Enables object specific memory allocation. |
Number of Timer objects | OS_TIMER_NUM | Defines maximum number of objects that can be active at the same time. Applies to objects with system provided memory for control blocks. Value range is [1-1000]. |
Timer Thread Priority | OS_TIMER_THREAD_PRIO | Defines priority for timer thread. Default value is 40. Value range is [8-48], in multiples of 8. The numbers have the following priority correlation: 8=Low; 16=Below Normal; 24=Normal; 32=Above Normal; 40=High; 48=Realtime |
Timer Thread Stack size [bytes] | OS_TIMER_THREAD_STACK_SIZE | Defines stack size for Timer thread. May be set to 0 when timers are not used. Default value is 200. Value range is [0-1073741824], in multiples of 8. |
Timer Thread TrustZone Module ID | OS_TIMER_THREAD_TZ_MOD_ID | Defines the TrustZone Module ID the Timer Thread shall use. This needs to be set to a non-zero value if any Timer Callbacks need to call secure functions. Default value is 0. |
Timer Callback Queue entries | OS_TIMER_CB_QUEUE | Number of concurrent active timer callback functions. May be set to 0 when timers are not used. Default value is 4. Value range is [0-256]. |
See Object-specific Memory Pools.
The RTX5 function osRtxTimerThread executes callback functions when a time period expires. The priority of the timer subsystem within the complete RTOS system is inherited from the priority of the osRtxTimerThread. This is configured by OS_TIMER_THREAD_PRIO
. Stack for callback functions is supplied by osRtxTimerThread. OS_TIMER_THREAD_STACK_SIZE
must satisfy the stack requirements of the callback function with the highest stack usage.
RTX5 provides several parameters to configure the Event Flags functions.
Event Configuration Options
Name | #define | Description |
---|---|---|
Object specific Memory allocation | OS_EVFLAGS_OBJ_MEM | Enables object specific memory allocation. See Object-specific Memory Pools. |
Number of Event Flags objects | OS_EVFLAGS_NUM | Defines maximum number of objects that can be active at the same time. Applies to objects with system provided memory for control blocks. Value range is [1-1000]. |
When object-specific memory is used, the pool size for all Event objects is specified by OS_EVFLAGS_NUM
. Refer to Object-specific Memory Pools.
RTX5 provides several parameters to configure the Mutex Management functions.
Mutex Configuration Options
Name | #define | Description |
---|---|---|
Object specific Memory allocation | OS_MUTEX_OBJ_MEM | Enables object specific memory allocation. See Object-specific Memory Pools. |
Number of Mutex objects | OS_MUTEX_NUM | Defines maximum number of objects that can be active at the same time. Applies to objects with system provided memory for control blocks. Value range is [1-1000]. |
When object-specific memory is used, the pool size for all Mutex objects is specified by OS_MUTEX_NUM
. Refer to Object-specific Memory Pools.
RTX5 provides several parameters to configure the Semaphores functions.
Semaphore Configuration Options
Name | #define | Description |
---|---|---|
Object specific Memory allocation | OS_SEMAPHORE_OBJ_MEM | Enables object specific memory allocation. See Object-specific Memory Pools. |
Number of Semaphore objects | OS_SEMAPHORE_NUM | Defines maximum number of objects that can be active at the same time. Applies to objects with system provided memory for control blocks. Value range is [1-1000]. |
When Object-specific Memory is used, the pool size for all Semaphore objects is specified by OS_SEMAPHORE_NUM
. Refer to Object-specific Memory Pools.
RTX5 provides several parameters to configure the Memory Pool functions.
Memory Pool Configuration Options
Name | #define | Description |
---|---|---|
Object specific Memory allocation | OS_MEMPOOL_OBJ_MEM | Enables object specific memory allocation. See Object-specific Memory Pools. |
Number of Memory Pool objects | OS_MEMPOOL_NUM | Defines maximum number of objects that can be active at the same time. Applies to objects with system provided memory for control blocks. Value range is [1-1000]. |
Data Storage Memory size [bytes] | OS_MEMPOOL_DATA_SIZE | Defines the combined data storage memory size. Applies to objects with system provided memory for data storage. Default value is 0. Value range is [0-1073741824], in multiples of 8. |
When object-specific memory is used, the number of pools for all MemoryPool objects is specified by OS_MEMPOOL_NUM
. The total storage size reserved for all pools is configured in OS_MEMPOOL_DATA_SIZE
. Refer to Object-specific Memory Pools.
RTX5 provides several parameters to configure the Message Queue functions.
MessageQueue Configuration Options
Name | #define | Description |
---|---|---|
Object specific Memory allocation | OS_MSGQUEUE_OBJ_MEM | Enables object specific memory allocation. See Object-specific Memory Pools. |
Number of Message Queue objects | OS_MSGQUEUE_NUM | Defines maximum number of objects that can be active at the same time. Applies to objects with system provided memory for control blocks. Value range is [1-1000]. |
Data Storage Memory size [bytes] | OS_MSGQUEUE_DATA_SIZE | Defines the combined data storage memory size. Applies to objects with system provided memory for data storage. Default value is 0. Value range is [0-1073741824], in multiples of 8. |
When Object-specific Memory is used, the number of queues for all Message Queue objects is specified by OS_MSGQUEUE_NUM
. The total storage size reserved for all queues is configured in OS_MSGQUEUE_DATA_SIZE
. Refer to Object-specific Memory Pools.