| CMSIS-RTOS Version 1.00 CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.

- CMSIS
- CORE
- DSP
- RTOS API
- SVD

- Main Page
- Usage and Description
- Reference

Defines | Functions
Kernel Information and Control
CMSIS-RTOS API

Provide version/system information and start the RTOS Kernel. More...

## Defines

#define | osFeature_MainThread 1
| main thread 1=main can be thread, 0=not available
#define | osCMSIS 0x00003
| API version (main [31:16] .sub [15:0])
#define | osCMSIS_KERNEL 0x10000
| RTOS identification and version (main [31:16] .sub [15:0])
#define | osKernelSystemId "KERNEL V1.00"
| RTOS identification string.

## Functions

osStatus | osKernelStart (osThreadDef_t *thread_def, void *argument)
| Start the RTOS Kernel with executing the specified thread.
int32_t | osKernelRunning (void)
| Check if the RTOS kernel is already started.

## Description

The Kernel Information and Control function group allow to:

- obtain information about the system and the underlaying kernel.
- obtain version information about the CMSIS RTOS API.
- the start of the RTOS kernel.
- checking the execution status of the RTOS kernel.

The function main is a special thread function that may be started at system initialization. In this case it has the initial priority osPriorityNormal.

## Define Documentation

#define osCMSIS 0x00003

Version information of the CMSIS RTOS API whereby major verison is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.

Note:
  MUST REMAIN UNCHANGED: osCMSIS identifies the CMSIS-RTOS API version

#define osCMSIS_KERNEL 0x10000

Identifies the underlaying RTOS kernel and version number. The actual name of that define depends on the RTOS Kernel used in the implementation. For example, osCMSIS_FreeRTOS identifies the FreeRTOS kernel and the value indicates the version number of that kernel whereby the major verison is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.

Note:
  CAN BE CHANGED: osCMSIS_KERNEL identifies the underlaying RTOS kernel and version number.

#define osFeature_MainThread 1

A CMSIS-RTOS implementation may support to start thread execution with the function 'main'. When the value osFeature_MainThread is 1 the RTOS offers to start with 'main'. The RTOS kernel is in this case already started. When the value osFeature_MainThread is 0 the RTOS requries explicit start with osKernelStart.

Note:
  MUST REMAIN UNCHANGED: osFeature_xxx shall be consistent in every CMSIS-RTOS.

#define osKernelSystemId "KERNEL V1.00"

Defines a string that identifies the underlaying RTOS Kernel and provides version information. The lenght of that string is limited to 21 bytes. A valid indenification string is for example, "FreeRTOS V1.00".

Note:
  MUST REMAIN UNCHANGED: osKernelSystemId shall be consistent in every CMSIS-RTOS.

## Function Documentation

int32_t osKernelRunning | ( | void |  | ) |

Note:
  MUST REMAIN UNCHANGED: osKernelRunning shall be consistent in every CMSIS-RTOS.

Returns:
  0 RTOS is not started, 1 RTOS is started.

Identifies if the RTOS kernel is started. For systems with the option to start the 'main' function as a thread this allows to identify that the RTOS kernel is already running.

void osKernelStart | ( | osThreadDef_t * | thread_def,
|  | void * | argument
| ) |  |

Parameters:

  [in] | thread_def | thread definition referenced with osThread.
  [in] | argument | pointer that is passed to the thread function as start argument.

Returns:
  status code that indicates the execution status of the function.

Note:
  MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.

Start the RTOS Kernel and begin execution of the thread function specified by thread_def. The argument is passed to the thread function.

When the CMSIS-RTOS starts thread execution with 'main', the function osKernelStart terminates this 'main; thread and starts execution with the specified thread function. This ensures that the code is portable regardless weather the function 'main' is started as thread or executed without control of the RTOS kernel.

Note:
  The thread ID of the started thread can be obtained with the function osThreadGetId.