Lines Matching +full:created +full:- +full:for
1 # Using CMSIS-RTOS2 Interface {#usingOS2}
3 This sections explains concepts for using CMSIS-RTOS2 interface. They are recommeded to follow for …
5 - \ref rtos2_functionalities lists the OS services supported by CMSIS-RTOS2 API.
6 …- \ref cmsis_os2_h explains how CMSIS-RTOS2 interface is defined and can be used along with the RT…
7 - \ref SystemStartup shows the flow for kernel initialization.
8 - \ref rtos_objects explains the approach to creating and using RTOS Objects.
9 …- \ref CMSIS_RTOS_MemoryMgmt provides information about options for memory management with CMSIS-R…
10 …- \subpage CMSIS_RTOS_ProcessIsolation describes the CMSIS-RTOS2 concepts for protecting execution…
13 > - For the guidance on migration from CMSIS-RTOS API v1 to CMSIS-RTOS2, see section [Detailed API …
17 The CMSIS-RTOS2 defines APIs for common RTOS services as listed below:
19 - \ref CMSIS_RTOS_KernelCtrl provides system information and controls the RTOS Kernel.
20 - \ref CMSIS_RTOS_ThreadMgmt allows you to define, create, and control RTOS threads (tasks).
21 - \ref CMSIS_RTOS_Wait for controlling time delays. Also see \ref CMSIS_RTOS_TimeOutValue.
22 - \ref CMSIS_RTOS_TimerMgmt functions are used to trigger the execution of functions.
23 - Three different event types support communication between multiple threads and/or ISR:
24 …- \ref CMSIS_RTOS_ThreadFlagsMgmt "Thread Flags": may be used to indicate specific conditions to a…
25 - \ref CMSIS_RTOS_EventFlags "Event Flags": may be used to indicate events to a thread or ISR.
26 …- \ref CMSIS_RTOS_Message "Messages": can be sent to a thread or an ISR. Messages are buffered in …
27 - \ref CMSIS_RTOS_MutexMgmt and \ref CMSIS_RTOS_SemaphoreMgmt are incorporated.
29 The referenced pages contain theory of operation for corresponding services as well as detailed API…
33 …-RTOS2** interface is provided in **cmsis_os2.h** file - a standard C header file that user applic…
35 …de or libraries that require no modifications when using on a different CMSIS-RTOS2 implementation.
37 
39 Once the files are added to a project, the user can start working with the CMSIS-RTOS functions.
41 …-RTOS2 is especially easy use to integrate in projects that support [CMSIS-Pack format](https://op…
45 …MSIS-RTOS2 follows [the general CMSIS coding rules](../General/index.html#coding_rules). Additiona…
47 …- `os` for all definitions and function names. Examples: \ref osThreadPrivileged, \ref osKernelSta…
48 - `os` with postfix `_t` for all typedefs. Examples: \ref osStatus_t, \ref osThreadAttr_t.
57 …lock using the respective [CMSIS-Core (Cortex-M)](../Core/group__system__init__gr.html) \if ARMCA …
59 …for example `app_main`) using \ref osThreadNew, which will be used as a main thread . This thread …
63 > - Modifying priorities and groupings in the NVIC by the application after the above sequence is n…
64 > - Before executing \ref osKernelStart, only the functions \ref osKernelGetInfo, \ref osKernelGetS…
69 /*----------------------------------------------------------------------------
70 * CMSIS-RTOS 'main' function template
71 *---------------------------------------------------------------------------*/
77 /*----------------------------------------------------------------------------
79 *---------------------------------------------------------------------------*/
83 for (;;) {}
92 osKernelInitialize(); // Initialize CMSIS-RTOS
95 for (;;) {}
101 …hare a common design concept. The overall life-cycle of an object can be summarized as created -> …
105 …n RTOS object (thread, timer, flags, mutex, etc.) is created by calling its `osXxxNew` function (f…
107 …d in an object specific control block. The memory layout (and size needed) for the control block i…
111 - `name` to attach a human readable name to the object for identification,
112 - `attr_bits` to control object-specific options,
113 - `cb_mem` to provide memory for the control block manually, and
114 - `cb_size` to quantify the memory size provided for the control block.
116 …name` attribute is only used for object identification, e.g. using RTOS-aware debugging. The attac…
118 …for the control block manually instead of relying on the implementation internal memory allocation…
122 After an object has been created successfully it can be used until it is destroyed. The actions
123 defined for an object depends on its type. Commonly all the `osXxxDoSomething` access function
128 …ation specific. Thus one should always check action function return values for `osErrorParameter` …
130 …-blocking access function can be used from \ref CMSIS_RTOS_ISR_Calls "Interrupt Service Routines" …
140 Timeout value is an argument in many API functions that allows to set the maximum time delay for re…
144 …- timeout value **0** : the system does not wait, even when no resource is available the RTOS func…
145 …- timeout value **1** : the system waits until the next timer tick occurs; depending on the previo…
146 - timeout value **2** : actual wait time is between 1 and 2 timer ticks.
147 …- timeout value \ref osWaitForever : system waits infinite until a resource becomes available. Or …
151 - CPU time can be scheduled with the following functionalities:
152 …- A \a timeout parameter is incorporated in many CMSIS-RTOS2 functions to avoid system lockup. Whe…
153 …- The \ref osDelay and \ref osDelayUntil functions put a thread into the **WAITING** state for a s…
154 …- The \ref osThreadYield provides co-operative thread switching and passes execution to another th…
159 The following CMSIS-RTOS2 functions can be called from threads and Interrupt Service Routines (ISR):
161 …- \ref osKernelGetInfo, \ref osKernelGetState, \ref osKernelGetTickCount, \ref osKernelGetTickFreq…
162 - \ref osThreadGetName, \ref osThreadGetId, \ref osThreadFlagsSet
163 - \ref osTimerGetName
164 …- \ref osEventFlagsGetName, \ref osEventFlagsSet, \ref osEventFlagsClear, \ref osEventFlagsGet, \r…
165 - \ref osMutexGetName
166 …- \ref osSemaphoreGetName, \ref osSemaphoreAcquire, \ref osSemaphoreRelease, \ref osSemaphoreGetCo…
167 …- \ref osMemoryPoolGetName, \ref osMemoryPoolAlloc, \ref osMemoryPoolFree, \ref osMemoryPoolGetCap…
168 …- \ref osMessageQueueGetName, \ref osMessageQueuePut, \ref osMessageQueueGet, \ref osMessageQueueG…
174 The \ref CMSIS_RTOS offers two options for memory management the user can choose. For object storag…
176 - \ref CMSIS_RTOS_MemoryMgmt_Automatic (fully portable), or
177 - \ref CMSIS_RTOS_MemoryMgmt_Manual (implementation specific).
179 In order to affect the memory allocation scheme all RTOS objects that can be created on request, i.…
184 …for many use-cases. Moreover it is fully portable across different implementations of the \ref CMS…
191 #include "cmsis_os2.h" // CMSIS-RTOS2 API header
199 NULL, // memory for control block (default)
200 0U // size for control block (default)
204 mutex_id = osMutexNew(NULL); // use default values for all attributes
210 The Mutexes in this example are created using automatic memory allocation.
212 ### Manual User-defined Allocation {#CMSIS_RTOS_MemoryMgmt_Manual}
214 …er memory allocation by providing user-defined memory. The actual requirements such user-defined m…
219 #include "cmsis_os2.h" // CMSIS-RTOS2 API header
224 …e__((section(".bss.os.mutex.cb"))); // Placed on .bss.os.mutex.cb section for RTX5 aware debugging
229 &mutex_cb, // memory for control block (user-defined)
230 sizeof(mutex_cb) // size for control block (user-defined)
239 …-defined memory for the mutex control block. For this `mutex_cb` is defined with the control block…