DAVE Tip of the day: CMSIS RTOS API Overview

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
The following list provides a brief overview of all CMSIS-RTOS functions. Functions marked with $ are optional.

Kernel Information and Control
- osKernelStart : Start the RTOS kernel.
- osKernelRunning : Query if the RTOS kernel is running.

Thread Management
- osThreadCreate : Start execution of a thread function.
- osThreadTerminate : Stop execution of a thread function.
- osThreadYield : Pass execution to next ready thread function.
- osThreadGetId : Get the thread identifier to reference this thread.
- osThreadSetPriority : Change the execution priority of a thread function.
- osThreadGetPriority : Obtain the current execution priority of a thread function.

Generic Wait Functions
- osDelay : Wait for a specified time.
- osWait $ : Wait for any event of the type Signal, Message, or Mail.

Timer Management $
- osTimerCreate : Define attributes of the timer callback function.
- osTimerStart : Start or restart the timer with a time value.
- osTimerStop : Stop the timer.

Signal Management
- osSignalSet : Set signal flags of a thread.
- osSignalClear : Reset signal flags of a thread.
- osSignalGet : Read signal flags of a thread.
- osSignalWait : Suspend execution until specific signal flags are set.

Mutex Management $
- osMutexCreate : Define and initialize a mutex.
- osMutexWait : Obtain a mutex or Wait until it becomes available.
- osMutexRelease : Release a mutex.

Semaphore Management $
- osSemaphoreCreate : Define and initialize a semaphore.
- osSemaphoreWait : Obtain a semaphore token or Wait until it becomes available.
- osSemaphoreRelease : Release a semaphore token.

Memory Pool Management $
- osPoolCreate : Define and initialize a fix-size memory pool.
- osPoolAlloc : Allocate a memory block.
- osPoolCAlloc : Allocate a memory block and zero-set this block.
- osPoolFree : Return a memory block to the memory pool.

Message Queue Management $
- osMessageCreate : Define and initialize a message queue.
- osMessagePut : Put a message into a message queue.
- osMessageGet : Get a message or suspend thread execution until message arrives.

Mail Queue Management $
- osMailCreate : Define and initialize a mail queue with fix-size memory blocks.
- osMailAlloc : Allocate a memory block.
- osMailCAlloc : Allocate a memory block and zero-set this block.
- osMailPut : Put a memory block into a mail queue.
- osMailGet : Get a mail or suspend thread execution until mail arrives.
- osMailFree : Return a memory block to the mail queue.
0 Likes
2 Replies
Not applicable
Hello everyone,

I'm trying to use the osSemaphoreCreate as it follows:

const osSemaphoreDef_t* semaphoreApp;
osSemaphoreId semaphorID;

semaphorID = osSemaphoreCreate(semaphoreApp, 0xFFFF);


But everytime I run this code, it gets stuck in an infinity loop, is there any example of a correct implementation?

Best regards
Alan
0 Likes
Andi_H
Employee
Employee
First solution authored First like received
0 Likes