]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/RTOS2/src/cmsis_os2.txt
Merge branch 'develop' of https://github.com/ARM-software/CMSIS_5 into develop
[cmsis] / CMSIS / DoxyGen / RTOS2 / src / cmsis_os2.txt
1 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
2 /**
3 \mainpage
4
5 The CMSIS-RTOS2 manages the resources of the microcontroller system and implements the concept of parallel threads that run concurrently. 
6 There are many advantages of using an CMSIS-RTOS2 compliant kernel as it provides a standardized interface.
7
8 Applications frequently require several concurrent activities. CMSIS-RTOS2 can manage multiple concurrent activities at the time when 
9 they are needed. Each activity gets a separate thread which executes a specific task and this simplifies the overall program structure.
10 The CMSIS-RTOS2 system is scalable and additional threads can be added easily at a later time. Threads have a priority allowing faster 
11 execution of time-critical parts of an user application.
12
13 The CMSIS-RTOS2 offers services needed in many real-time applications, for example, periodical activation of timer functions, 
14 memory management, and message exchange between threads with time limits.
15
16 The <b>CMSIS-RTOS API v2</b> addresses the following new requirements:
17  - Dynamic object creation no longer requires static memory, static memory buffers are now optional.
18  - Support for ARMv8-M architecture that provides a Secure and Non-Secure state of code execution.
19  - Provisions for message passing in multi-core systems.
20  - Full support of C++ run-time environments.
21  - C interface which is binary compatible across <a class="el" href="http://infocenter.arm.com/help/topic/com.arm.doc.subset.swdev.abi/index.html">ABI compatible compilers</a>.
22
23 As a consequence of these requirements the CMSIS-RTOS API v2 has the following fundamental modifications:
24  - The functions osXxxxNew replace osXxxxCreate functions; osXxxxNew and osXxxxDelete create and destroy objects.
25  - The C function main is not longer started as a thread (this was an optional feature in CMSIS-RTOS v1).
26  - Functions that return osEvent have been replaced.
27
28 CMSIS-RTOS API v2 provides an translation layer for the
29 <a class="el" href="../../RTOS/html/index.html">CMSIS-RTOS API v1</a>. 
30 It is possible to intermix CMSIS-RTOS API v2 and CMSIS-RTOS API v1 within the same application.
31 You may migrate overtime to the new API as explained in \ref os2Migration.
32
33 CMSIS-RTOS API v2 is not POSIX compliant, but has provisions to enable a C++11/C++14 interface.
34
35 The following sections provide further details about CMSIS-RTOS2 and the RTX reference implementation.
36  - \subpage rtos_revisionHistory documents changes made in each version for CMSIS-RTOS2 and RTX version 5.
37  - \subpage rtx5_impl provides general information about the operation of RTX version 5.
38  - \subpage config_rtx explains the configuration options of RTX version 5.
39  - \subpage cre_rtx_proj describes how to create projects using RTX version 5.
40  - \subpage os2Migration shows how to use CMSIS-RTOS2 in existing projects and lists function differences to CMSIS-RTOS v1.
41  - \subpage rtosValidation describes the validation suite that is public available.
42  - \subpage functionOverview lists the CMSIS-RTOS2 API functions and the header file cmsis_os2.h.
43
44 <hr>
45
46 CMSIS-RTOS2 in ARM::CMSIS Pack
47 -----------------------------
48
49 The following files relevant to CMSIS-RTOS2 are present in the <b>ARM::CMSIS</b> Pack directories:
50 File/Folder                  | Content                                                                
51 -----------------------------|------------------------------------------------------------------------
52 \b CMSIS/Documentation/RTOS2 | This documentation                                                     
53 \b CMSIS/RTOS2/Include       | \ref cmsis_os2_h                                                 
54 \b CMSIS/RTOS2/RTX           | CMSIS-RTOS v2 reference implementation based on RTX version 5
55 \b CMSIS/RTOS2/Template      | compatiblity layer to CMSIS-RTOS v1
56 */
57
58
59 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
60 /**
61 \page rtos_revisionHistory Revision History
62
63 <table class="cmtable" summary="Revision History">
64     <tr>
65       <th>Version</th>
66       <th>Description</th>
67     </tr>
68     <tr>
69       <td>V2.0.0</td>
70       <td>
71         - Kernel:\n
72          -- added: osKernelGetInfo, osKernelGetState.\n
73          -- added: osKernelLock, osKernelUnlock.\n
74          -- added: osKernelSuspend, osKernelResume.\n
75          -- added: osKernelGetTime.\n
76          -- renamed osKernelSysTick to osKernelGetSysTick.\n
77         - Thread:\n
78          -- extended number of thread priorities.\n
79          -- changed thread return value.\n
80          -- replaced osThreadCreate with osThreadNew.\n
81          -- added: osThreadGetState.\n
82          -- added: osThreadSuspend, osThreadResume.\n
83          -- added: osThreadJoin, osThreadDetach, osThreadExit.\n
84         - Signals:\n
85          -- renamed osSignals to osThreadFlags.\n
86          -- changed return value of Set/Clear/Wait functions.\n
87          -- Clear function limited to current running thread.\n
88          -- extended Wait function (options).\n
89          -- added: osThreadFlagsGet.\n        
90         - Event Flags: added new independent object for handling Event Flags.\n
91         - Delay and Wait functions:\n
92          -- added: osDelayUntil.\n
93          -- deprecated: osWait.\n
94         - Timer:\n
95          -- replaced osTimerCreate with osTimerNew.\n
96          -- added: osTimerIsRunning.\n
97         - Mutex:\n
98          -- extended: attributes (Recursive, Priority Inherit, Robust).\n
99          -- replaced osMutexCreate with osMutexNew.\n
100          -- renamed osMutexWait to osMutexAcquire.\n
101          -- added: osMutexGetOwner.\n
102         - Semaphore:\n
103          -- extended: maximum and initial token count.\n
104          -- replaced osSemaphoreCreate with osSemaphoreNew.\n
105          -- renamed osSemaphoreWait to osSemaphoreAcquire (changed return value).\n
106          -- added: osSemaphoreGetCount.\n
107         - Memory Pool:\n
108          -- using osMemoryPool prefix instead of osPool.\n
109          -- replaced osPoolCreate with osMemoryPoolNew.\n
110          -- extended: osMemoryPoolAlloc (timeout).\n
111          -- added: osMemoryPoolGetCapacity, osMemoryPoolGetBlockSize.\n
112          -- added: osMemoryPoolGetCount, osMemoryPoolGetSpace.\n
113          -- added: osMemoryPoolDelete.\n
114          -- deprecated: osPoolCAlloc.\n
115         - Message Queue:\n
116          -- fixed size messages instead of a single 32-bit values.\n
117          -- using osMessageQueue prefix instead of osMessage.\n
118          -- replaced osMessageCreate with osMessageQueueNew.\n
119          -- updated: osMessageQueuePut, osMessageQueueGet.\n 
120          -- added: osMessageQueueGetCapacity, osMessageQueueGetMsgSize.\n
121          -- added: osMessageQueueGetCount, osMessageQueueGetSpace.\n
122          -- added: osMessageQueueReset, osMessageQueueDelete.\n
123         - Mail Queue: deprecated (superseded by extended Message Queue functionality).\n
124      </td>
125     </tr>
126     <tr>
127       <td>V1.02 - only documentation changes</td>
128       <td>
129       Added: Overview of the \ref rtosValidation "CMSIS-RTOS Validation" Software Pack.\n
130           Clarified: Behavior of \ref CMSIS_RTOS_TimeOutValue.
131      </td>
132     </tr>
133     <tr>
134       <td>V1.02</td>
135       <td>Added: New control functions for short timeouts in microsecond resolution \b osKernelSysTick,
136       \b osKernelSysTickFrequency, \b osKernelSysTickMicroSec.\n
137       Removed: osSignalGet.
138      </td>
139     </tr>
140     <tr>
141       <td>V1.01</td>
142       <td>Added capabilities for C++, kernel initialization and object deletion.\n
143       Prepared for C++ class interface. In this context to \em const attribute has been moved from osXxxxDef_t typedefs to
144       the osXxxxDef macros.\n
145       Added: \ref osTimerDelete, \ref osMutexDelete, \ref osSemaphoreDelete.\n
146       Added: \ref osKernelInitialize that prepares the Kernel for object creation.\n
147       </td>
148     </tr>
149     <tr>
150       <td>
151       V1.00</td>
152       <td>First official Release.\n
153       Added: \ref osKernelStart; starting 'main' as a thread is now an optional feature.\n
154       Semaphores have now the standard behavior.\n
155       \b osTimerCreate does no longer start the timer. Added: \ref osTimerStart (replaces osTimerRestart).\n
156       Changed: osThreadPass is renamed to \ref osThreadYield.
157       </td>
158     </tr>
159     <tr>
160       <td>V0.02</td>
161       <td>Preview Release.</td>
162     </tr>
163 </table>
164 */
165
166
167 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
168 /**
169 \page rtx5_impl RTX v5 Implementation
170
171 The RTX version 5 implements the CMSIS-RTOS API v2 as native RTOS interface for Cortex-M processor-based devices.
172 A translation layer to CMSIS-RTOS API v1 is provided and with minimal effort RTX version 5 can be used in applications that 
173 where previously based on RTX version 4 and CMSIS-RTOS v1.
174
175 <b>Theory of Operation</b>
176
177 This section describes the internal operations of RTX version 5:
178  - \subpage SystemStartup describes the C/C++ library initialization process.
179  - \subpage MemoryAllocation describes the resource management in the target system.
180  - \subpage ThreadStack explains how RTX manages the stack memory for threads.
181  - \subpage lowPower explains how to utilize power saving modes of Cortex-M devices.
182  - \subpage KernelTimer explains the options for time delays and timeouts.
183  - \subpage CMSIS_RTOS_TimeOutValue explains behaviour of timeouts including \token{0}=no wait and \ref osWaitForever.
184  - \subpage TickLess enables ultra-low power operation with custom timer.
185  - \subpage CMSIS_RTOS_ISR_Calls lists the functions calls that are supported from interrupt context.
186
187 Many aspects of the kernel are configurable and the configuration options are mentioned where applicable.
188
189 \page SystemStartup System Startup
190
191 todo
192
193 \page MemoryAllocation Memory Allocation 
194
195 The RTX objects (thread, mutex, semaphore, timer, message, event and memory pool) require dedicated RAM memory.
196 Objects can be created using os<i>object</i>New() calls and deleted using os<i>object</i>Delete() calls. The related
197 object memory needs to be available during the life-time of the object.
198
199 RTX5 offers three different memory allocation methods for objects:
200
201   - \ref GlobalMemoryPool uses a single global memory pool for all objects. It is easy to configure, but may have 
202     the disadvantage for memory fragmentation when objects with different sizes are created and destroyed.
203
204   - \ref ObjectMemoryPool uses a fixed-size memory pool for each object type. The method is time deterministic
205      and avoids memory fragmentation.
206
207   - \ref StaticObjectMemory reserves memory during compile time and completely avoids that a system can be out of memory.
208     This is typically a required for some safety critical systems.
209         
210 It possible to intermix all the memory allocation methods in the same application.
211
212 \section GlobalMemoryPool Global Memory Pool
213
214 The global memory pool allocates all objects from a one memory area.
215 This method of memory allocation is the default configuration setting of RTX5.
216
217 \image html MemAllocGlob.png "Global Memory Pool for all objects"
218
219 When pool does not provide sufficient memory the creation of the object fails and the related os<i>object</i>New() function returns \token{NULL}.
220
221 \todo refer to object counters once available
222
223 Enabled in \ref systemConfig.
224
225 \section ObjectMemoryPool Object-specific Memory Pools
226
227 Object-specific Memory Pools avoids memory fragmentation with a dedicated fixed-size memory management for each object type.
228 This type of memory pools are fully time deterministic, which means object creation and destruction takes always the same fixed amount of time.
229 As a fixed-size memory pool is specific to an object type the handling of out-of-memory situations is simplified.
230
231 \image html MemAllocSpec.png "One memory pool per object type"
232
233 Object-specific memory pools are selectively enabled for each object type, e.g: mutex or thread using the RTX configuration file:
234  - Enabled in \ref threadConfig for thread objects.
235  - Enabled in \ref timerConfig for timer objects.
236  - Enabled in \ref eventFlagsConfig for event objects.
237  - Enabled in \ref mutexConfig for mutex objects.
238  - Enabled in \ref semaphoreConfig for semaphore.
239  - Enabled in \ref memPoolConfig for memory pools.
240  - Enabled in \ref msgQueueConfig for message objects.
241
242 When memory pool does not provide sufficient memory the creation of the object fails and the related os<i>object</i>New() function returns \token{NULL}.
243
244 \todo explain how to Map pools to different memory spaces (e.g. for systems with different speed grades of RAM memory)
245
246 \section StaticObjectMemory Static Object Memory
247 In contrast to the dynamic memory allocations the static memory allocation requires compile-time allocation of object memory. 
248
249 \image html MemAllocStat.png "Statically allocated memory for all objects"
250
251 The following code example shows how to create an OS object using static memory.
252
253 <b> Code Example: </b> 
254 \code{.c}
255 /*----------------------------------------------------------------------------
256  * CMSIS-RTOS 'main' function template
257  *---------------------------------------------------------------------------*/
258
259 #include "RTE_Components.h"
260 #include  CMSIS_device_header
261 #include "cmsis_os2.h"
262  
263 //include rtx_os.h for types of RTX objects
264 #include "rtx_os.h"
265  
266 //The thread function instanced in this example
267 void worker(void *arg)
268 {
269   while(1) 
270   {
271     //work
272         osDelay(10000);
273   }  
274 }
275  
276 // Define objects that are statically allocated for worker threads 1 and 2
277 os_thread_t worker_thread_tcb_1;
278  
279 // Reserve two areas for the stacks of worker threads 1 and 2
280 // uint64_t makes sure the memory alignment is 8
281 uint64_t worker_thread_stk_1[64];
282  
283 // Define the attributes which are used for thread creation
284 // Optional const saves RAM memory and includes the values in periodic ROM tests 
285 const osThreadAttr_t worker_attr_1 = { 
286         "wrk1", 
287         osThreadJoinable, 
288         &worker_thread_tcb_1, 
289         sizeof(worker_thread_tcb_1),
290         &worker_thread_stk_1[0],  
291         sizeof(worker_thread_stk_1),
292         osPriorityAboveNormal,
293         0
294 };
295  
296
297 // Define ID object for thread
298 osThreadId_t th1;
299  
300 /*----------------------------------------------------------------------------
301  * Application main thread
302  *---------------------------------------------------------------------------*/
303 void app_main (void *argument) {
304   uint32_t param = NULL;
305  
306   // Create an instance of the worker thread with static resources (TCB and stack)
307   th1 = osThreadNew(worker, &param, &worker_attr_1);
308  
309   for (;;) {}
310 }
311  
312 int main (void) {
313   // System Initialization
314   SystemCoreClockUpdate();
315   // ...
316
317   osKernelInitialize();                 // Initialize CMSIS-RTOS
318   osThreadNew(app_main, NULL, NULL);    // Create application main thread
319   osKernelStart();                      // Start thread execution
320   for (;;) {}
321 }
322 \endcode
323
324 */
325
326 /* ========================================================================================================================== */
327 /**
328 \page ThreadStack Thread Stack Management
329
330
331
332 For Cortex-M processors without floating point unit the thread context requires 64 bytes on the local stack.
333 \note
334 For Cortex-M4 FPU and Cortex-M7 FPU the thread context requires 200 bytes on the local stack. For devices with Cortex-M4 FPU and Cortex-M7 FPU the default stack space should be increased to a minimum of 300 bytes.
335
336 Each thread is provided with an separate stack that holds the thread context and stack space for automatic variables and return addresses for function call nesting. The stack sizes of the RTX threads are flexible configurable as explained in the section \ref threadConfig. RTX even offers a configurable checking for stack overflows and stack utilization. 
337
338
339 */
340
341 /* ========================================================================================================================== */
342 /**
343 \page lowPower Low-Power Operation
344
345 The system thread \b os_IdleThread can be use to switch the system into a low-power mode.  The easiest form to enter a
346 low-power mode is the execution of the \c __WFE function that puts the processor into a sleep mode where it waits for an
347 event.
348
349 <b>Configuration Example:</b>
350
351 \code
352 #include "RTE_Components.h"
353 #include CMSIS_device_header            /* Device definitions                 */
354  
355 void os_IdleThread (void) {
356   /* The idle demon is a system thread, running when no other thread is       */
357   /* ready to run.                                                            */
358  
359   for (;;) {
360     __WFE();                            /* Enter sleep mode                   */
361   }
362 }
363 \endcode
364
365 \note
366 \c __WFE() is not available at every Cortex-M implementation. Check device manuals for availability.
367
368 */
369
370 /* ========================================================================================================================== */
371 /**
372 \page KernelTimer RTX Kernel Timer Tick
373
374 By default, CMSIS-RTOS RTX5 uses the Cortex-M
375 <a href="http://www.keil.com/support/man/docs/gsac/GSAC_SYSTICKtimer.htm" target="_blank">SysTick</a> timer to generate
376 periodic interrupts for the RTX kernel timer tick. CMSIS-RTOS provides \ref CMSIS_RTOS_TimerMgmt functions and several
377 CMSIS-RTOS functions have a timeout parameter. This periodic RTX kernel timer tick interrupt is used to derive the required
378 time interval. CMSIS-RTOS RTX also provides configuration options for a alternative timer and tick-less operation. 
379
380 To handle timeout and time delays for threads, the CMSIS-RTOS RTX thread management is controlled by the RTX kernel timer
381 tick interrupt. The thread context contains all CPU registers (R0 - R12), the return address (LR), the program counter (PC), and the processor
382 status register (xPSR). For the Cortex-M4 FPU and Cortex-M7 FPU the floating point status and registers (S0 - S32, FPSCR) are
383 also part of the thread context.
384
385 When a thread switch occurs:
386  - the thread context of the current running thread is stored on the local stack of this thread.
387  - the stack pointer is switched to the next running thread.
388  - the thread context of this next running thread is restored and this thread starts to run.
389
390
391 \page CMSIS_RTOS_TimeOutValue Timeout Value   
392
393 Timeout values are an argument to several \b osXxx functions to allow time for resolving a request.
394 A timeout value of \b 0 means that the RTOS does not wait and returns instantly, even when no resource is available.   
395 A timeout value of \ref osWaitForever means that the RTOS waits infinite until a resource becomes available.
396  
397 The timeout value specifies the number of timer ticks until the time delay elapses. The value is an upper bound and 
398 depends on the actual time elapsed since the last timer tick. 
399
400 Examples:
401   - timeout value \b 0 : the system does not wait, even when no resource is available the RTOS function returns instantly. 
402   - timeout value \b 1 : the system waits until the next timer tick occurs; depending on the previous timer tick, it may be a very short wait time.
403   - timeout value \b 2 : actual wait time is between 1 and 2 timer ticks.
404   - timeout value \ref osWaitForever : system waits infinite until a resource becomes available. 
405   
406 \todo B: remove first '|' to make the picture clearer, make ... before first tick, add word 'time' after the arrow. 
407
408 \image html TimerValues.png "Timer Values"
409
410 \page CMSIS_RTOS_ISR_Calls Calls from Interrupt Service Routines 
411
412 The following CMSIS-RTOS2 functions can be called from threads and Interrupt Service Routines (ISR):
413   - \ref osThreadFlagsSet
414   - \ref osEventFlagsSet, \ref osEventFlagsClear, \ref osEventFlagsGet, \ref osEventFlagsWait
415   - \ref osSemaphoreAcquire, \ref osSemaphoreRelease, \ref osSemaphoreGetCount
416   - \ref osMemoryPoolAlloc, \ref osMemoryPoolFree, \ref osMemoryPoolGetCapacity, \ref osMemoryPoolGetBlockSize, \ref osMemoryPoolGetCount, \ref osMemoryPoolGetSpace
417   - \ref osMessageQueuePut, \ref osMessageQueueGet, \ref osMessageQueueGetCapacity, \ref osMessageQueueGetMsgSize, \ref osMessageQueueGetCount, \ref osMessageQueueGetSpace
418
419 Functions that cannot be called from an ISR are verifying the interrupt status and return, in case they are called
420 from an ISR context, the status code \b osErrorISR. In some implementations, this condition might be caught using the HARD
421 FAULT vector.
422
423 */
424
425 /* ========================================================================================================================== */
426 /**
427 \page TickLess Tick-less Low-Power Operation
428
429 RTX5 provides extension for tick-less operation which is useful for applications that use extensively low-power
430 modes where the SysTick timer is also disabled. To provide a time-tick in such power-saving modes a wake-up timer is used to
431 derive timer intervals. The CMSIS-RTOS2 functions \ref osKernelSuspend and \ref osKernelResume control the tick-less operation.
432
433 Using this functions allows the RTX5 thread scheduler to stop the periodic kernel tick interrupt. When all active threads
434 are suspended, the system enters power-down and calculates how long it can stay in this power-down mode. In the power-down
435 mode the processor and potentially peripherals can be switched off. Only a wake-up timer must remain powered, because this
436 timer is responsible to wake-up the system after the power-down period expires.
437
438 The tick-less operation is controlled from the \b os_IdleThread thread. The wake-up timeout value is set before the system
439 enters the power-down mode. The function \ref osKernelSuspend calculates the wake-up timeout measured in RTX Timer Ticks; this
440 value is used to setup the wake-up timer that runs during the power-down mode of the system.
441
442 Once the system resumes operation (either by a wake-up time out or other interrupts) the RTX5 thread scheduler is started with
443 the function \ref osKernelResume. The parameter \a sleep_time specifies the time (in RTX Timer Ticks) that the system was in
444 power-down mode.
445
446 <b>Code Example:</b>
447 \code
448 #include "msp.h"                        // Device header
449
450 /*----------------------------------------------------------------------------
451  *      MSP432 Low-Power Extension Functions
452  *---------------------------------------------------------------------------*/
453 static void MSP432_LP_Entry(void) {
454   /* Enable PCM rude mode, which allows to device to enter LPM3 without waiting for peripherals */
455   PCM->CTL1 = PCM_CTL1_KEY_VAL | PCM_CTL1_FORCE_LPM_ENTRY;       
456   /* Enable all SRAM bank retentions prior to going to LPM3  */
457   SYSCTL->SRAM_BANKRET |= SYSCTL_SRAM_BANKRET_BNK7_RET;
458   __enable_interrupt();         
459   NVIC_EnableIRQ(RTC_C_IRQn);
460   /* Do not wake up on exit from ISR */ 
461   SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk;    
462   /* Setting the sleep deep bit */
463   SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk);  
464 }
465  
466 static volatile unsigned int tc;
467 static volatile unsigned int tc_wakeup;
468  
469 void RTC_C_IRQHandler(void)
470 {
471   if (tc++ > tc_wakeup) 
472   {
473     SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk;    
474     NVIC_DisableIRQ(RTC_C_IRQn);
475     NVIC_ClearPendingIRQ(RTC_C_IRQn);
476     return;
477   }
478   if (RTC_C->PS0CTL & RTC_C_PS0CTL_RT0PSIFG)
479   {
480     RTC_C->CTL0 = RTC_C_KEY_VAL;                 // Unlock RTC key protected registers
481     RTC_C->PS0CTL &= ~RTC_C_PS0CTL_RT0PSIFG;
482     RTC_C->CTL0 = 0;
483     SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk);
484   }
485 }
486  
487 uint32_t g_enable_sleep = 0;
488   
489 void os_IdleThread (void) {
490  
491   for (;;) {      
492         tc_wakeup = osKernelSuspend();
493         /* Is there some time to sleep? */
494     if (tc_wakeup > 0) {
495       tc = 0;
496           /* Enter the low power state */
497       MSP432_LP_Entry();
498           __WFI();
499         } 
500     /* Adjust the kernel ticks with the amount of ticks slept */        
501         osKernelResume (tc);            
502   }
503 }
504 \endcode
505
506 \note
507 \c __WFI() is not available at every Cortex-M implementation. Check device manuals for availability.
508 */
509
510
511 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
512 /**
513 \page cre_rtx_proj Create an RTX Project
514
515 Example projects using CMSIS-RTOS RTX are available for various development boards. To make use of these examples, you need
516 to install a Device Family Pack in µVision and use Pack Installer to open a CMSIS-RTOS2 Blinky project. If you wish to start a CMSIS-RTOS RTX5 from scratch, follow these steps:
517 - Create a new project and select a device.
518 - In the Manage Run-Time Environment window that opens, select <b>CMSIS\::CORE</b> and <b>CMSIS\::RTOS2 (API)\::Keil RTX5</b>.
519   If the <b>Validation Output</b> requires other components to be present, try to use the \b Resolve button:
520
521    \image html manage_rte_output.png
522
523 - Click \b OK. In the \b Project window, you will see the files that have been automatically added to you project, such as
524   \b %RTX_Config.c and the system and startup files:
525
526    \image html project_window.png
527    
528 - You can add template files to the project by right-clicking on <b>Source Group 1</b> and selecting
529   <b>Add New Item to 'Source Group 1'</b>. In the new window, click on <b>User Code Template</b>. On the right-hand side
530   you will see all available template files for CMSIS-RTOS RTX:
531   
532    \image html add_item.png
533
534 - Finally, \ref config_rtx "configure" RTX to the application's needs using the \b %RTX_Config.c file.
535 */
536
537 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
538 /**
539 \page config_rtx Configure RTX v5
540
541 The file "RTX_Config.c" defines the configuration parameters of CMSIS-RTOS RTX and must be part of every project that is using the CMSIS-RTOS RTX kernel.
542
543 The configuration file uses
544 <a class="el" href="http://www.keil.com/pack/doc/CMSIS/Pack/html/_config_wizard.html" target="_blank">Configuration Wizard Annotations</a>.
545 Depending on the development tool, the annotations might lead to a more user-friendly graphical representation of the settings. 
546 The screenshot below shows the configuration file represented by the µVision Configuration Wizard:
547
548 \image html config_wizard.png "RTX_Conf_CM.c in Configuration Wizard View"
549
550 The configuration options are explained on these pages:
551 - \subpage systemConfig
552 - \subpage threadConfig
553 - \subpage timerConfig
554 - \subpage eventFlagsConfig
555 - \subpage mutexConfig
556 - \subpage semaphoreConfig
557 - \subpage memPoolConfig
558 - \subpage msgQueueConfig
559 */
560
561
562 /* ========================================================================================================================== */
563 /**
564 \page systemConfig System Configuration
565
566 \image html config_wizard_system.png "RTX_Conf_CM.c: System Configuration"
567
568
569 Name                                   | \#define                 | Description
570 ---------------------------------------|--------------------------|----------------------------------------------------------------
571 Global Dynamic Memory size [bytes]     | \c OS_DYNAMIC_MEM_SIZE   | Defines the combined global dynamic memory size for the \ref GlobalMemoryPool. Default value is \token{4096}. Value range is \token{[0-1073741824]} bytes, in multiples of \token{8} bytes.
572 Round-Robin Thread switching           | \c OS_ROBIN_ENABLE       | Enables Round-Robin Thread switching.
573 Round-Robin Timeout [ms]               | \c OS_ROBIN_TIMEOUT      | Defines how long a thread will execute before a thread switch. Default value is \token{5}. Value range is \token{[1-1000]}.
574 ISR FIFO Queue                         | \c OS_ISR_FIFO_QUEUE     | RTOS Functions called from ISR store requests to this buffer. Default value is \token{16 entries}. Value range is \token{[4-256]} entries in multiples of \token{4}.
575 */
576
577 /* ========================================================================================================================== */
578 /**
579 \page threadConfig Thread Configuration
580
581 The CMSIS-RTOS RTX provides several parameters to configure threads.
582
583 \section stackConfig Configuration of Thread Count and Stack Space
584
585 \ref osThreadAttr_t is passed to osThreadNew to set the options of a thread.
586
587 CMSIS-RTOS RTX defines two methods for defining the stack requirements:
588  - when \a *stack_mem in osThreadAttr_t is NULL, a fixed-size memory pool is used for the thread stack.  In this case, \b OS_STKSIZE specifies the stack size for the thread function.
589  - when \a *stack_mem specifies a memory location, the thread stack provided there. The size of this user space is specified with \b stack_size. 
590  
591 Stack memory for threads is configured either statically by Static Resources - Number of Threads (total). Static memory in the size of Number of Threads * Default Thread Stack size is reserved.
592 Alternatively the memory is allocated on demand from the Dynamic Resources pool (configured by System Configuration - Dynamic Resources - Memory size [bytes] for Stack).
593
594 The CMSIS-RTOS RTX kernel uses a separate stack for each thread it creates. However, before the kernel is started by the \ref osKernelInitialize() function, the main stack size that is configured in the file startup_<i>device</i>.s is used.
595
596 \image html config_wizard_threads.png "RTX_Conf_CM.c: Thread Configuration"
597
598 Main stack is also used when:
599 - the user application calls the majority of RTX functions from Thread mode (ending up in an SVC call)
600 - running from handlers (user interrupt of exception handlers like SVCm PendSV, Faults, etc.)
601
602 Name                                                     | \#define               | Description
603 ---------------------------------------------------------|------------------------|----------------------------------------------------------------
604 Object specific Memory allocation                        | \c OS_THREAD_OBJ_MEM   | Enables object specific memory allocation. See /ref ObjectMemoryPool.
605 Number of user Threads (total)               | \c 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 \token{6}. Value range is \token{[1-1000]}.
606 Number of user Threads with user-provided Stack size | \c OS_THREAD_USER_STACK_NUM     | Defines maximum number of user threads with user-provided stack size. Default value is \token{0}. Value range is \token{[0-1000]}.
607 Total Stack size [bytes] for user Threads with user-provided Stack size    | \c OS_THREAD_USER_STACK_SIZE | Defines the combined stack size for user threads with user-provided stack size. Default value is \token{0}. Value range is \token{[0-1073741824]} bits, sepping \token{8} bits. 
608 Default Thread Stack size [bytes]                        | \c OS_STACK_SIZE    | Defines stack size for threads with zero stack size specified. Default value is \token{200}. Value range is \token{[96-1073741824]} bits, sepping \token{8} bits. 
609 Idle Thread Stack size [bytes]                           | \c OS_IDLE_THREAD_STACK_SIZE              | Defines stack size for Idle thread. Default value is \token{200}. Value range is \token{[72-1073741824]} bits, sepping \token{8} bits. 
610 Stack overrun checking                                   | \c OS_STACK_CHECK   | Enable stack overrun checks at thread switch. Enabling this option increases slightly the execution time of a thread switch. If a stack overflow is detected at a thread switch, the function \b os_error with error code = 1 is called.  By default, this function is implemented as endless loop and will practically stop code execution.
611 Stack usage watermark                                    | \c OS_STACK_WATERMARK    | Initialize thread stack with watermark pattern for analyzing stack usage. Enabling this option increases significantly the execution time of thread creation.
612 Processor mode for Thread execution                      | \c OS_PRIVILEGE_MODE     | Controls the processor mode. Default value is \token{Privileged} mode. Value range is \token{[0=Unprivileged; 1=Privileged]} mode.
613 */
614
615
616 /* ========================================================================================================================== */
617 /**
618 \page timerConfig Timer Configuration
619
620 \image html config_wizard_timer.png "RTX_Conf_CM.c: Timer Configuration"
621
622
623 Name                                   | \#define                 | Description
624 ---------------------------------------|--------------------------|----------------------------------------------------------------
625 Object specific Memory allocation      | \c OS_TIMER_OBJ_MEM      | Enables object specific memory allocation. See /ref ObjectMemoryPool.
626 Number of Timer objects                | \c 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 \token{[1-1000]}.
627 Timer Thread Priority                  | \c OS_TIMER_THREAD_PRIO        | Defines priority for timer thread. Default value is \token{40}. Value range is \token{[8-48]}, stepping \token{8}. The numbers have the following priority correlation: \token{8=Low}; \token{16=Below Normal}; \token{24=Normal}; \token{32=Above Normal}; \token{40=High}; \token{48=Realtime} 
628 Timer Thread Stack size [bytes]        | \c OS_TIMER_THREAD_STACK_SIZE  | Defines stack size for Timer thread. May be set to 0 when timers are not used. Default value is \token{200}. Value range is \token{[0-1073741824]}, stepping \token{8}.
629 Timer Callback Queue entries           | \c OS_TIMER_CB_QUEUE           | Number of concurrent active timer callback functions. May be set to 0 when timers are not used. Default value is \token{4}. Value range is \token{[0-256]}.
630 */
631
632 /* ========================================================================================================================== */
633 /**
634 \page eventFlagsConfig Event Flags Configuration
635
636 \image html config_wizard_eventFlags.png "RTX_Conf_CM.c: Event Flags Configuration"
637
638
639 Name                                   | \#define                 | Description
640 ---------------------------------------|--------------------------|----------------------------------------------------------------
641 Object specific Memory allocation      | \c OS_EVFLAGS_OBJ_MEM    | Enables object specific memory allocation. See /ref ObjectMemoryPool.
642 Number of Event Flags objects          | \c 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 \token{[0-1000]}.
643 */
644
645
646 /* ========================================================================================================================== */
647 /**
648 \page mutexConfig Mutex Configuration
649
650 \image html config_wizard_mutex.png "RTX_Conf_CM.c: Mutex Configuration"
651
652
653 Name                                   | \#define                 | Description
654 ---------------------------------------|--------------------------|----------------------------------------------------------------
655 Object specific Memory allocation      | \c OS_MUTEX_OBJ_MEM      | Enables object specific memory allocation. See /ref ObjectMemoryPool.
656 Number of Mutex objects                | \c 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 \token{[0-1000]}.
657 */
658
659
660 /* ========================================================================================================================== */
661 /**
662 \page semaphoreConfig Semaphore Configuration
663
664 \image html config_wizard_semaphore.png "RTX_Conf_CM.c: Semaphore Configuration"
665
666
667 Name                                   | \#define                 | Description
668 ---------------------------------------|--------------------------|----------------------------------------------------------------
669 Object specific Memory allocation      | \c OS_SEMAPHORE_OBJ_MEM  | Enables object specific memory allocation. See /ref ObjectMemoryPool.
670 Number of Semaphore objects            | \c 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 \token{[0-1000]}.
671 */
672
673
674 /* ========================================================================================================================== */
675 /**
676 \page memPoolConfig Memory Pool Configuration
677
678 \image html config_wizard_memPool.png "RTX_Conf_CM.c: Memory Pool Configuration"
679
680
681 Name                                   | \#define                 | Description
682 ---------------------------------------|--------------------------|----------------------------------------------------------------
683 Object specific Memory allocation      | \c OS_MEMPOOL_OBJ_MEM    | Enables object specific memory allocation. See /ref ObjectMemoryPool.
684 Number of Memory Pool objects          | \c 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 \token{[0-1000]}.
685 Data Storage Memory size [bytes]       | \c OS_MEMPOOL_DATA_SIZE  | Defines the combined data storage memory size. Applies to objects with system provided memory for data storage. Default value is \token{0}. Value range is \token{[0-1073741824]}, stepping \token{4}.
686
687 */
688
689
690 /* ========================================================================================================================== */
691 /**
692 \page msgQueueConfig Message Queue Configuration
693
694 \image html config_wizard_msgQueue.png "RTX_Conf_CM.c: Message Queue Configuration"
695
696
697 Name                                   | \#define                 | Description
698 ---------------------------------------|--------------------------|----------------------------------------------------------------
699 Object specific Memory allocation      | \c OS_MSGQUEUE_OBJ_MEM   | Enables object specific memory allocation. See /ref ObjectMemoryPool.
700 Number of Message Queue objects        | \c 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 \token{[0-1000]}.
701 Data Storage Memory size [bytes]       | \c OS_MSGQUEUE_DATA_SIZE | Defines the combined data storage memory size. Applies to objects with system provided memory for data storage. Default value is \token{0}. Value range is \token{[0-1073741824]}, stepping \token{4}.
702
703 */
704
705 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
706 /**
707 \page rtosValidation RTOS Validation
708
709 ARM offers a <a class=el href="http://www.keil.com/pack" target="_blank">Software Pack</a> for the CMSIS-RTOS Validation.
710 The <b>ARM::CMSIS-RTOS_Validation</b> Pack contains the following:
711
712  - Source code of a CMSIS-RTOS Validation Suite along with configuration file.
713  - Documentation of the CMSIS-RTOS Validation Suite.
714  - Example that shows the usage of the CMSIS-RTOS Validation Suite using simulation.
715
716 \note
717 A public version of the test suite is available only for CMSIS-RTOS v1 API.
718
719 The CMSIS-RTOS Validation Suite performs generic validation of various RTOS features. The test cases verify the 
720 functional behavior, test invalid parameters and call management functions from ISR.
721
722 The following CMSIS-RTOS features can be tested with the current release:
723  - Thread : Create multiple threads, terminate, restart, yield, change priority 
724  - Timer : Create periodic and one-shot timers
725  - GenWait : Call generic wait functions (osDelay and osWait)
726  - WaitFunc : Measure wait ticks (delay, mail, message, mutex, semaphore, signal)
727  
728 Moreover the following inter-thread communication functions can be tested: 
729  - Signal : Verify signal events
730  - Memory Pool : Verify memory allocation
731  - Message Queue : Exchange messages between threads
732  - Mail Queue : Exchange data between threads
733  - Mutex : Synchronize resource access 
734  - Semaphore : Access shared resources 
735  
736 The RTOS Validation output can be printed to a console, output via ITM printf, or output to a memory buffer.
737  
738 \section test_output Sample Test Output
739 \verbatim
740 CMSIS-RTOS Test Suite   Oct 21 2015   16:39:16 
741
742 TEST 01: TC_ThreadCreate                  PASSED
743 TEST 02: TC_ThreadMultiInstance           PASSED
744 TEST 03: TC_ThreadTerminate               PASSED
745   :
746   :
747 TEST 08: TC_ThreadChainedCreate           PASSED
748 TEST 09: TC_ThreadYield                   NOT EXECUTED
749 TEST 10: TC_ThreadParam                   PASSED
750   :
751   :
752 TEST 60: TC_MailFromISRToThread           PASSED
753
754 Test Summary: 60 Tests, 59 Executed, 59 Passed, 0 Failed, 0 Warnings.
755 Test Result: PASSED
756 \endverbatim
757 */
758
759
760 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
761 /**
762 \page functionOverview Function Overview
763
764 CMSIS-RTOS v2 provides multiple API interfaces:
765   - \subpage rtos_api2 is the new C function API that supports dynamic object creation, ARMv8-M, and multi-processor communication.
766   - <a class="el" href="../../RTOS/html/functionOverview.html">CMSIS-RTOS C API v1</a> is a C function API the is backward compatible with CMSIS-RTOS v1.
767   - \subpage rtos_apicpp is a C++ class function API.
768
769 It is possible to intermix the different API variants in the same application and even in the same C/C++ source module.
770 However, the functions of the <b>C API Version 1</b> may be deprecated in future versions of CMSIS-RTOS.
771
772 \section rtos_api2 CMSIS-RTOS2
773
774 Overview of all CMSIS-RTOS C API v2 functions that are implemented in the \subpage cmsis_os2_h. 
775
776  - \ref CMSIS_RTOS_KernelCtrl
777    - \ref osKernelGetInfo : \copybrief osKernelGetInfo
778    - \ref osKernelGetState : \copybrief osKernelGetState
779    - \ref osKernelGetSysTimerCount : \copybrief osKernelGetSysTimerCount
780    - \ref osKernelGetSysTimerFreq : \copybrief osKernelGetSysTimerFreq
781    - \ref osKernelInitialize : \copybrief osKernelInitialize
782    - \ref osKernelLock : \copybrief osKernelLock
783    - \ref osKernelResume : \copybrief osKernelResume
784    - \ref osKernelStart : \copybrief osKernelStart
785    - \ref osKernelSuspend : \copybrief osKernelSuspend
786    - \ref osKernelGetTickCount : \copybrief osKernelGetTickCount
787    - \ref osKernelGetTickFreq : \copybrief osKernelGetTickFreq
788    - \ref osKernelUnlock : \copybrief osKernelUnlock
789
790  - \ref CMSIS_RTOS_ThreadMgmt
791    - \ref osThreadDetach : \copybrief osThreadDetach
792    - \ref osThreadExit : \copybrief osThreadExit
793    - \ref osThreadGetName : \copybrief osThreadGetName
794    - \ref osThreadGetId : \copybrief osThreadGetId
795    - \ref osThreadGetPriority : \copybrief osThreadGetPriority
796    - \ref osThreadGetState : \copybrief osThreadGetState
797    - \ref osThreadJoin : \copybrief osThreadJoin
798    - \ref osThreadNew : \copybrief osThreadNew
799    - \ref osThreadResume : \copybrief osThreadResume
800    - \ref osThreadSetPriority : \copybrief osThreadSetPriority
801    - \ref osThreadSuspend : \copybrief osThreadSuspend
802    - \ref osThreadTerminate : \copybrief osThreadTerminate
803    - \ref osThreadYield : \copybrief osThreadYield
804
805  - \ref CMSIS_RTOS_Wait
806    - \ref osDelay : \copybrief osDelay
807    - \ref osDelayUntil : \copybrief osDelayUntil
808
809  - \ref CMSIS_RTOS_TimerMgmt
810    - \ref osTimerDelete : \copybrief osTimerDelete
811    - \ref osTimerIsRunning : \copybrief osTimerIsRunning
812    - \ref osTimerNew : \copybrief osTimerNew
813    - \ref osTimerStart : \copybrief osTimerStart
814    - \ref osTimerStop : \copybrief osTimerStop
815
816  - \ref CMSIS_RTOS_EventFlags
817    - \ref osEventFlagsNew : \copybrief osEventFlagsNew
818    - \ref osEventFlagsDelete : \copybrief osEventFlagsDelete
819    - \ref osEventFlagsSet : \copybrief osEventFlagsSet
820    - \ref osEventFlagsClear : \copybrief osEventFlagsClear
821    - \ref osEventFlagsGet : \copybrief osEventFlagsGet
822    - \ref osEventFlagsWait : \copybrief osEventFlagsWait
823
824  - \ref CMSIS_RTOS_ThreadFlagsMgmt
825    - \ref osThreadFlagsSet : \copybrief osThreadFlagsSet
826    - \ref osThreadFlagsClear : \copybrief osThreadFlagsClear
827    - \ref osThreadFlagsGet : \copybrief osThreadFlagsGet
828    - \ref osThreadFlagsWait : \copybrief osThreadFlagsWait
829
830  - \ref CMSIS_RTOS_Message
831    - \ref osMessageQueueDelete : \copybrief osMessageQueueDelete
832    - \ref osMessageQueueGet : \copybrief osMessageQueueGet
833    - \ref osMessageQueueGetCapacity : \copybrief osMessageQueueGetCapacity
834    - \ref osMessageQueueGetCount : \copybrief osMessageQueueGetCount
835    - \ref osMessageQueueGetMsgSize : \copybrief osMessageQueueGetMsgSize
836    - \ref osMessageQueueGetSpace : \copybrief osMessageQueueGetSpace
837    - \ref osMessageQueueNew : \copybrief osMessageQueueNew
838    - \ref osMessageQueuePut : \copybrief osMessageQueuePut
839    - \ref osMessageQueueReset : \copybrief osMessageQueueReset
840
841  - \ref CMSIS_RTOS_PoolMgmt
842    - \ref osMemoryPoolAlloc : \copybrief osMemoryPoolAlloc
843    - \ref osMemoryPoolDelete : \copybrief osMemoryPoolDelete
844    - \ref osMemoryPoolFree : \copybrief osMemoryPoolFree
845    - \ref osMemoryPoolGetBlockSize : \copybrief osMemoryPoolGetBlockSize
846    - \ref osMemoryPoolGetCapacity : \copybrief osMemoryPoolGetCapacity
847    - \ref osMemoryPoolGetCount : \copybrief osMemoryPoolGetCount
848    - \ref osMemoryPoolGetSpace : \copybrief osMemoryPoolGetSpace
849    - \ref osMemoryPoolNew : \copybrief osMemoryPoolNew
850
851  - \ref CMSIS_RTOS_MutexMgmt
852    - \ref osMutexAcquire : \copybrief osMutexAcquire
853    - \ref osMutexDelete : \copybrief osMutexDelete
854    - \ref osMutexGetOwner : \copybrief osMutexGetOwner
855    - \ref osMutexNew : \copybrief osMutexNew
856    - \ref osMutexRelease : \copybrief osMutexRelease
857
858  - \ref CMSIS_RTOS_SemaphoreMgmt
859    - \ref osSemaphoreAcquire : \copybrief osSemaphoreAcquire
860    - \ref osSemaphoreDelete : \copybrief osSemaphoreDelete
861    - \ref osSemaphoreGetCount : \copybrief osSemaphoreGetCount
862    - \ref osSemaphoreNew : \copybrief osSemaphoreNew
863    - \ref osSemaphoreRelease : \copybrief osSemaphoreRelease
864
865 The following CMSIS-RTOS2 functions can be called from threads and Interrupt Service Routines (ISR):
866   - \ref osThreadFlagsSet
867   - \ref osEventFlagsSet, \ref osEventFlagsClear, \ref osEventFlagsGet, \ref osEventFlagsWait
868   - \ref osSemaphoreAcquire, \ref osSemaphoreRelease, \ref osSemaphoreGetCount
869   - \ref osMemoryPoolAlloc, \ref osMemoryPoolFree, \ref osMemoryPoolGetCapacity, \ref osMemoryPoolGetBlockSize, \ref osMemoryPoolGetCount, \ref osMemoryPoolGetSpace
870   - \ref osMessageQueuePut, \ref osMessageQueueGet, \ref osMessageQueueGetCapacity, \ref osMessageQueueGetMsgSize, \ref osMessageQueueGetCount, \ref osMessageQueueGetSpace
871
872 */
873
874
875 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
876 /**
877 \page rtos_apicpp CMSIS-RTOS C++ API
878
879 The C++11/C++14 interface is planned to be released in January 2017.
880 */
881
882
883 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
884 /**
885 \page cmsis_os2_h cmsis_os2.h header file
886
887 The file \b cmsis_os2.h is a standard header file that interfaces to every CMSIS-RTOS API v2 compliant Real-Time Operating Systems (RTOS).
888 Each implementation is provided the same cmsis_os2.h which defines the interface to the \ref rtos_api2.
889
890 Using the \b cmsis_os2.h along with dynamic object allocation allows to create source code or libraries that require no modifications
891 when using on a different CMSIS-RTOS v2 implementation.
892
893 <b>Header file %cmsis_os2.h</b>
894
895 \include cmsis_os2.h
896 */
897
898 /* ========================================================================================================================== */
899 // Group creation for Reference 
900 /* 
901 \addtogroup CMSIS_RTOS1 CMSIS-RTOS API v1
902 \brief This section describes the CMSIS-RTOS API v1. 
903 \details 
904 The CMSIS-RTOS is a generic API layer that interfaces to an existing RTOS kernel.
905
906 CMSIS-RTOS API v2 provides an translation layer for the
907 <a class="el" href="../../RTOS/html/index.html">CMSIS-RTOS API v1</a> that simplifies migration.
908
909 Refer to the <a class="el" href="../../RTOS/html/modules.html">Reference</a> guide of the CMSIS-RTOS API v1 for details.
910 */
911
912 // Group creation for Reference 
913 /** 
914 \addtogroup CMSIS_RTOS CMSIS-RTOS2 API
915 \brief Describes the C function interface of CMSIS-RTOS API v2. 
916 \details 
917 The CMSIS-RTOS2 is a generic API layer that interfaces to an RTOS kernel.
918
919 The complete API interface is defined in the \ref cmsis_os2_h. When using dynamic memory allocation for objects, source code or libraries require no modifications
920 when using on a different CMSIS-RTOS2 implementation.
921
922 */
923