1 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
3 \page os2Migration Migration from RTOSv1 to RTOSv2
5 This section lists all new API functions along with the differences to the RTOS v1 functionality.
7 The list is sorted alphabetically by RTOSv2 function names and is structured the following way:
9 \token{for RTOS v2} : \func{RTOS version 2 function}
10 \token{for RTOS v1} : \func{RTOS version 1 function}
12 Brief description of new function. \n
13 Description of the difference.
15 \div{new} New functions have a green background. \enddiv
16 \div{mod} Modifying or replacing functions have an amber background. \enddiv
17 \div{del} Deprecated functions without replacement have a red background. \enddiv
21 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
22 Kernel Information and Control
25 \section mig_kernel Kernel Information and Control
28 \func{osStatus_t #osKernelGetInfo (osVersion_t* version, char* id_buf, uint32_t id_size)}
30 \copybrief{osKernelGetInfo}
31 New function #osKernelGetInfo.
35 \func{osKernelState_t #osKernelGetState (void)}
36 \func{int32_t osKernelRunning (void)}
37 \copybrief{osKernelGetState}
38 - The function \b osKernelGetState replaces the RTOS v1 function \b osKernelRunning.
39 - Return type changed to \ref osKernelState_t.
44 \func{uint32_t #osKernelGetTick (void)}
45 \func{uint32_t osKernelSysTick (void)}
46 \copybrief{osKernelGetTick}
47 - The function \b osKernelGetTick replaces the RTOS v1 function \b osKernelSysTick.
52 \func{uint64_t #osKernelGetTime (void)}
54 \copybrief{osKernelGetTime}
59 \func{osStatus_t #osKernelInitialize (void)}
60 \func{osStatus osKernelInitialize (void)}
61 \copybrief{osKernelInitialize}
62 - Return type changed to \ref osStatus_t.
67 \func{uint32_t osKernelLock (void)}
69 \copybrief{osKernelLock}
74 \func{void #osKernelResume (uint32_t sleep_time)}
76 \copybrief{osKernelResume}
81 \func{osStatus_t #osKernelStart (void)}
82 \func{osStatus osKernelStart (void)}
83 \copybrief{osKernelStart}
84 - Return type changed to \ref osStatus_t.
89 \func{uint32_t osKernelSuspend (void)}
91 \copybrief{osKernelSuspend}
96 \func{uint32_t #osKernelTickMicroSec (uint32_t microsec)}
97 \func{uint32_t osKernelTickMicroSec (osKernelSysTickFrequency)}
98 \copybrief{osKernelTickMicroSec}
99 - The function \b osKernelTickMicroSec replaces the RTOS v1 macro \b osKernelTickMicroSec.
104 \func{void #osKernelUnlock (void)}
106 \copybrief{osKernelUnlock}
112 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
113 ====== Thread Management =======
116 \section mig_threadMgmt Thread Management
119 \func{osStatus_t #osThreadAbortWait (osThreadId_t thread_id)}
121 \copybrief{osThreadAbortWait}
126 \func{osStatus_t #osThreadDetach (osThreadId_t thread_id)}
128 \copybrief{osThreadDetach}
133 \func{__NO_RETURN void #osThreadExit (void * exit_ptr)}
135 \copybrief{osThreadExit}
140 \func{osThreadId_t #osThreadGetId (void)}
141 \func{osThreadId osThreadGetId (void)}
142 \copybrief{osThreadGetId}
143 - Return type changed to #osThreadId_t.
148 \func{osPriority_t #osThreadGetPriority (osThreadId_t thread_id)}
149 \func{osPriority osThreadGetPriority (osThreadId thread_id)}
150 \copybrief{osThreadGetPriority}
151 - Return type changed to #osPriority_t.
152 - Parameter type changed to #osThreadId_t.
157 \func{osThreadState_t #osThreadGetState (osThreadId_t thread_id)}
159 \copybrief{osThreadGetState}
164 \func{osStatus_t #osThreadJoin (osThreadId_t thread_id, void **exit_ptr)}
166 \copybrief{osThreadJoin}
171 \func{osThreadId_t #osThreadNew (os_thread_func_t function, void *argument, const osThreadAttr_t *attr)}
172 \func{osThreadId osThreadCreate (const osThreadDef_t *thread_def, void *argument)}
173 \copybrief{osThreadNew}
174 - The function \b osThreadNew replaces the RTOS v1 function \b osThreadCreate.
175 - Options are now passed using a \ref osThreadAttr_t struct, replacing the \b osThreadDef macro.
176 - New function prototype is <kbd>void *func (void *arg)</kbd>, before: <kbd>void func (const void *arg)</kbd>.
181 \func{osStatus_t #osThreadResume (osThreadId_t thread_id)}
183 \copybrief{osThreadResume}
188 \func{osStatus_t #osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority)}
189 \func{osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority)}
190 \copybrief{osThreadSetPriority}
191 - Return type changed to #osStatus_t.
192 - Parameter types changed to #osThreadId_t and #osPriority_t.
197 \func{osStatus_t #osThreadSuspend (osThreadId_t thread_id)}
199 \copybrief{osThreadSuspend}
204 \func{osStatus_t #osThreadTerminate (osThreadId_t thread_id)}
206 \copybrief{osThreadTerminate}
211 \func{osStatus_t #osThreadYield (void)}
212 \func{osStatus osThreadYield (void)}
213 \copybrief{osThreadYield}
214 - Return type changed to #osStatus_t.
220 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
221 ====== Generic Wait Functions =======
224 \section mig_wait Generic Wait Functions
226 Refer to \ref CMSIS_RTOS_Wait for details.
229 \func{osStatus_t #osDelay (uint32_t millisec)}
230 \func{osStatus osDelay (uint32_t millisec)}
232 - The return type changed to #osStatus_t.
237 \func{osStatus_t #osDelayUntil (uint64_t millisec)}
238 \func{osStatus osDelayUntil (uint64_t millisec)}
239 \copybrief{osDelayUntil}
240 - The return type changed to #osStatus_t.
246 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
247 ====== Timer Management =======
250 \section mig_timer Timer Management
252 Refer to \ref CMSIS_RTOS_TimerMgmt for details.
255 \func{osStatus_t #osTimerDelete (osTimerId_t timer_id)}
256 \func{osStatus osTimerDelete (osTimerId timer_id)}
257 \copybrief{osTimerDelete}
258 - The return type changed to #osStatus_t.
259 - The parameter type has changed to #osTimerId_t.
264 \func{uint32_t #osTimerIsRunning (osTimerId_t timer_id)}
266 \copybrief{osTimerIsRunning}
271 \func{osTimerId_t #osTimerNew (os_timer_func_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)}
272 \func{osTimerId osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument)}
273 \copybrief{osTimerNew}
274 - The function \b osTimerNew replaces the RTOS v1 function \b osTimerCreate.
275 - The return type changed to #osTimerId_t.
276 - The parameter list and types have changed.
281 \func{osStatus_t #osTimerStart (osTimerId_t timer_id, uint32_t millisec)}
282 \func{osStatus osTimerStart (osTimerId timer_id, uint32_t millisec)}
283 \copybrief{osTimerStart}
284 - The return type changed to #osStatus_t.
285 - The first parameter type has changed to #osTimerId_t.
290 \func{osStatus_t #osTimerStop (osTimerId_t timer_id)}
291 \func{osStatus osTimerStop (osTimerId timer_id)}
292 \copybrief{osTimerStop}
293 - The return type changed to #osStatus_t.
294 - The parameter type has changed to #osTimerId_t.
300 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
301 ====== Signal Events =======
304 \section mig_signalEvents Signal Events
306 The section RTOS v1 <b>Signal Events</b> has been deprecated.
307 Use the functions listed under \ref mig_threadFlags and \ref mig_eventFlags instead.
311 \func{int32_t osSignalClear (osThreadId thread_id, int32_t signals)}
318 \func{int32_t osSignalSet (osThreadId thread_id, int32_t signals)}
325 \func{osEvent osSignalWait (int32_t signals, uint32_t millisec)}
333 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
334 ====== Event Flags =======
337 \section mig_eventFlags Event Flags
339 New section to synchronize events using flags. Event flags and thread flags are replacing the RTOS v1 <b>Signal Events</b>.
340 All functions listed in the RTOS v1 <b>Signal Events</b> have been deprecated.
341 Refer to \ref mig_signalEvents for a list of deprecated functions.
342 Refer to \ref CMSIS_RTOS_EventFlags for details about the new function.
345 \func{int32_t #osEventFlagsClear (osEventFlagsId_t ef_id, int32_t flags)}
347 \copybrief{osEventFlagsClear}
352 \func{osStatus_t #osEventFlagsDelete (osEventFlagsId_t ef_id)}
354 \copybrief{osEventFlagsDelete}
359 \func{int32_t #osEventFlagsGet (osEventFlagsId_t ef_id)}
361 \copybrief{osEventFlagsGet}
366 \func{osEventFlagsId_t #osEventFlagsNew (const osEventFlagsAttr_t *attr)}
368 \copybrief{osEventFlagsNew}
373 \func{int32_t #osEventFlagsSet (osEventFlagsId_t ef_id, int32_t flags)}
375 \copybrief{osEventFlagsSet}
380 \func{int32_t #osEventFlagsWait (osEventFlagsId_t ef_id, int32_t flags, uint32_t options, uint32_t millisec)}
382 \copybrief{osEventFlagsWait}
388 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
389 ====== Thread Flags =======
392 \section mig_threadFlags Thread Flags
394 New section to synchronize threads using flags. Thread flags and the more flexible \ref mig_eventFlags are replacing the RTOS v1 <b>Signal Events</b>. Refer to \ref mig_signalEvents for a list of deprecated functions.
395 Refer to \ref CMSIS_RTOS_ThreadFlagsMgmt for details.
398 \func{int32_t #osThreadFlagsSet (osThreadId_t thread_id, int32_t flags)}
400 \copybrief{osThreadFlagsSet}
405 \func{int32_t #osThreadFlagsWait (int32_t flags, uint32_t options, uint32_t millisec)}
407 \copybrief{osThreadFlagsWait}
413 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
414 ====== Message Queue =======
417 \section mig_msgQueue Message Queue
418 Refer to \ref CMSIS_RTOS_Message for details.
421 \func{osStatus_t #osMessageQueueDelete (osMessageQueueId_t mq_id)}
423 \copybrief{osMessageQueueDelete}
428 \func{osStatus_t #osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t millisec)}
429 \func{osEvent osMessageGet (osMessageQId queue_id, uint32_t millisec)}
430 \copybrief{osMessageQueueGet}
431 - The function \b osMessageQueueGet replaces the RTOS v1 function \b osMessageGet.
432 - The return type changed to #osStatus_t.
433 - The parameter list and parameter types have changed.
438 \func{uint32_t #osMessageQueueGetCapacity (osMessageQueueId_t mq_id)}
440 \copybrief{osMessageQueueGetCapacity}
445 \func{uint32_t #osMessageQueueGetCount (osMessageQueueId_t mq_id)}
447 \copybrief{osMessageQueueGetCount}
452 \func{uint32_t #osMessageQueueGetMsgSize (osMessageQueueId_t mq_id)}
454 \copybrief{osMessageQueueGetMsgSize}
459 \func{uint32_t #osMessageQueueGetSpace (osMessageQueueId_t mq_id)}
461 \copybrief{osMessageQueueGetSpace}
466 \func{osMessageQueueId_t #osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr)}
467 \func{osMessageQId osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id)}
468 \copybrief{osMessageQueueNew}
469 - The function \b osMessageQueueNew replaces the RTOS v1 function \b osMessageCreate.
470 - The return type changed to #osMessageQueueId_t.
471 - The parameter list and parameter types have changed.
476 \func{osStatus_t #osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t millisec)}
477 \func{osStatus osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec)}
478 \copybrief{osMessageQueuePut}
479 - The function \b osMessageQueuePut replaces the RTOS v1 function \b osMessagePut.
480 - The return type changed to #osStatus_t.
481 - The parameter list and parameter types have changed.
486 \func{osStatus_t #osMessageQueueReset (osMessageQueueId_t mq_id)}
488 \copybrief{osMessageQueueReset}
494 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
495 ====== Memory Pool =======
498 \section mig_memPool Memory Pool
501 \func{void * #osMemoryPoolAlloc (osMemoryPoolId_t mp_id, uint32_t millisec)}
502 \func{void * osPoolAlloc (osPoolId pool_id)}
503 \func{void * osPoolCAlloc (osPoolId pool_id)}
504 \copybrief{osMemoryPoolAlloc}
505 - The function \b osMemoryPoolAlloc replaces both RTOS v1 functions \b osPoolAlloc and \b osPoolCAlloc.
506 - The parameter list and types changed.
511 \func{osStatus_t #osMemoryPoolDelete (osMemoryPoolId_t mp_id)}
513 \copybrief{osMemoryPoolDelete}
518 \func{osStatus_t #osMemoryPoolFree (osMemoryPoolId_t mp_id, void * block)}
519 \func{osStatus osPoolFree (osPoolId pool_id, void * block)}
520 \copybrief{osMemoryPoolFree}
521 - The function \b osMemoryPoolFree replaces the RTOS v1 function \b osPoolFree.
522 - The first parameter type \b osMemoryPoolId_t replaces the ROTS v1 type \b osPoolId.
527 \func{uint32_t #osMemoryPoolGetBlockSize (osMemoryPoolId_t mp_id)}
529 \copybrief{osMemoryPoolGetBlockSize}
534 \func{uint32_t #osMemoryPoolGetCapacity (osMemoryPoolId_t mp_id)}
536 \copybrief{osMemoryPoolGetCapacity}
541 \func{uint32_t #osMemoryPoolGetCount (osMemoryPoolId_t mp_id)}
543 \copybrief{osMemoryPoolGetCount}
548 \func{uint32_t #osMemoryPoolGetSpace (osMemoryPoolId_t mp_id)}
550 \copybrief{osMemoryPoolGetSpace}
555 \func{osMemoryPoolId_t #osMemoryPoolNew (uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr)}
556 \func{osPoolId osPoolCreate (const osPoolDef_t * pool_def)}
557 \copybrief{osMemoryPoolGetSpace}
558 - The function \b osMemoryPoolNew replaces the RTOS v1 function \b osPoolCreate.
559 - The return type changed to #osMemoryPoolId_t.
560 - Parameter list and parameter types have changed.
566 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
567 ====== Mail Queue =======
570 \section mig_mailQueue Mail Queue
571 The <b>Mail Queue</b> RTOS v1 functions have been deprecated.
572 Use the functionality of the \ref CMSIS_RTOS_Message instead.
573 Differences are listed under \ref mig_msgQueue.
577 \func{void * osMailAlloc (osMailQId queue_id, uint32_t millisec)}
584 \func{void * osMailCAlloc (osMailQId queue_id, uint32_t millisec)}
591 \func{osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id)}
598 \func{osStatus osMailFree (osMailQId queue_id, void *mail)}
605 \func{osEvent osMailGet (osMailQId queue_id, uint32_t millisec)}
612 \func{osStatus osMailPut (osMailQId queue_id, void *mail)}
619 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
620 ====== Mutexes =======
623 \section mig_mutex Mutexes
624 Refer to \ref CMSIS_RTOS_MutexMgmt for details.
627 \func{osStatus_t #osMutexAcquire (osMutexId_t mutex_id, uint32_t millisec)}
628 \func{osStatus osMutexWait (osMutexId mutex_id, uint32_t millisec)}
629 \copybrief{osMutexAcquire}
630 - The function \b osMutexAcquire replaces the RTOS v1 function \b osMutexWait.
631 - Return type changed to \ref osStatus_t.
632 - First parameter type changed to \ref osMutexId_t.
637 \func{osStatus_t #osMutexDelete (osMutexId_t mutex_id)}
638 \func{osStatus osMutexDelete (osMutexId mutex_id)}
639 \copybrief{osMutexDelete}
640 - The return type changed to \ref osStatus_t.
641 - The parameter type changed to \ref osMutexId_t.
646 \func{osThreadId_t #osMutexGetOwner (osMutexId_t mutex_id)}
648 \copybrief{osMutexGetOwner}
653 \func{osMutexId_t #osMutexNew (const osMutexAttr_t *attr)}
654 \func{osMutexId osMutexCreate (const osMutexDef_t *mutex_def)}
655 \copybrief{osMutexNew}
656 - The function \b osMutexNew replaces the RTOS v1 function \b osMutexCreate.
657 - The return type changed to \ref osMutexId_t.
658 - The parameter type changed to \ref osMutexAttr_t.
663 \func{osStatus_t #osMutexRelease (osMutexId_t mutex_id)}
664 \func{osStatus osMutexRelease (osMutexId mutex_id)}
665 \copybrief{osMutexRelease}
666 - The return type changed to \ref osStatus_t.
667 - The parameter type changed to \ref osMutexId_t.
673 =======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====
674 ====== SEMAPHORES =======
677 \section mig_sem Semaphores
678 Refer to \ref CMSIS_RTOS_SemaphoreMgmt for details.
681 \func{osStatus_t #osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t millisec)}
683 \copybrief{osSemaphoreAcquire}
688 \func{osStatus_t #osSemaphoreDelete (osSemaphoreId_t semaphore_id)}
689 \func{osStatus osSemaphoreDelete (osSemaphoreId semaphore_id)}
690 \copybrief{osSemaphoreDelete}
691 - The return type changed to #osStatus_t.
692 - The parameter type has changed to #osSemaphoreId_t.
697 \func{uint32_t #osSemaphoreGetCount (osSemaphoreId_t semaphore_id)}
699 \copybrief{osSemaphoreGetCount}
704 \func{osSemaphoreId_t #osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr)}
705 \func{osSemaphoreId osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count)}
706 \copybrief{osSemaphoreNew}
707 - The function \b osSemaphoreNew replaces the RTOS v1 function \b osSemaphoreCreate.
708 - The return type changed to #osSemaphoreId_t.
709 - The parameter list and types have changed.
714 \func{osStatus_t #osSemaphoreRelease (osSemaphoreId_t semaphore_id)}
715 \func{osStatus osSemaphoreRelease (osSemaphoreId semaphore_id)}
716 \copybrief{osSemaphoreRelease}
717 - The return type changed to #osStatus_t.
718 - The parameter type has changed to #osSemaphoreId_t.
724 \func{int32_t osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec)}