Tools > Operating System > FreeRTOS (SMP) + CMSIS-RTOS2: ARM's standard RTOS API, on FreeRTOS.
Tools > Operating System > FreeRTOS (SMP) + CMSIS-RTOS2: ARM's standard RTOS API, on FreeRTOS.
CMSIS-RTOS2 is the RTOS API of ARM's Cortex-M software standard (CMSIS), used by Keil MDK, STM32Cube and others, so code written for it on other Cortex-M boards runs here unchanged. Choosing FreeRTOS (SMP) + CMSIS-RTOS2 in Tools > Operating System builds the sketch with FreeRTOS, as FreeRTOS describes, plus ARM's CMSIS-RTOS2 layer for FreeRTOS (CMSIS-FreeRTOS; ADR 010). A sketch includes cmsis_os2.h. The functions are described in the CMSIS-RTOS2 API reference. Without the menu option, including cmsis_os2.h stops the build with a message naming the menu option.
Differences from CMSIS-RTOS2 on other systems:
Functions provided:
| Group | Functions |
|---|---|
| Kernel | osKernelInitialize(), osKernelGetInfo(), osKernelGetState(), osKernelStart(), osKernelLock(), osKernelUnlock(), osKernelRestoreLock(), osKernelGetTickCount(), osKernelGetTickFreq(), osKernelGetSysTimerCount(), osKernelGetSysTimerFreq() |
| Threads | osThreadNew(), osThreadGetName(), osThreadGetId(), osThreadGetState(), osThreadGetStackSpace(), osThreadSetPriority(), osThreadGetPriority(), osThreadYield(), osThreadSuspend(), osThreadResume(), osThreadExit(), osThreadTerminate(), osThreadGetCount(), osThreadEnumerate(), osThreadSetAffinityMask(), osThreadGetAffinityMask() |
| Thread flags | osThreadFlagsSet(), osThreadFlagsClear(), osThreadFlagsGet(), osThreadFlagsWait() |
| Waiting | osDelay(), osDelayUntil() |
| Timers | osTimerNew(), osTimerGetName(), osTimerStart(), osTimerStop(), osTimerIsRunning(), osTimerDelete() |
| Event flags | osEventFlagsNew(), osEventFlagsSet(), osEventFlagsClear(), osEventFlagsGet(), osEventFlagsWait(), osEventFlagsDelete() |
| Mutexes | osMutexNew(), osMutexAcquire(), osMutexRelease(), osMutexGetOwner(), osMutexDelete() |
| Semaphores | osSemaphoreNew(), osSemaphoreAcquire(), osSemaphoreRelease(), osSemaphoreGetCount(), osSemaphoreDelete() |
| Memory pools | osMemoryPoolNew(), osMemoryPoolGetName(), osMemoryPoolAlloc(), osMemoryPoolFree(), osMemoryPoolGetCapacity(), osMemoryPoolGetBlockSize(), osMemoryPoolGetCount(), osMemoryPoolGetSpace(), osMemoryPoolDelete() |
| Message queues | osMessageQueueNew(), osMessageQueuePut(), osMessageQueueGet(), osMessageQueueGetCapacity(), osMessageQueueGetMsgSize(), osMessageQueueGetCount(), osMessageQueueGetSpace(), osMessageQueueReset(), osMessageQueueDelete() |
Not provided by the FreeRTOS layer (the build fails with "undefined reference" if a sketch uses one): osKernelSuspend(), osKernelResume(), osThreadGetStackSize(), osThreadJoin(), osThreadDetach(), osEventFlagsGetName(), osMutexGetName(), osSemaphoreGetName(), osMessageQueueGetName(), and the CMSIS-RTOS2 2.3 safety features: osKernelProtect(), osKernelDestroyClass(), osThreadGetClass(), osThreadGetZone(), osThreadSuspendClass(), osThreadResumeClass(), osThreadTerminateZone(), osThreadFeedWatchdog(), osThreadProtectPrivileged() and osFaultResume(). The attributes osThreadJoinable and osMutexRobust make osThreadNew() and osMutexNew() return NULL.