| CMSIS-Core (Cortex-M) CMSIS-Core support for Cortex-M processor-based devices |

Loading...
Searching...
No Matches
Macros
Version Control

Version #define symbols for CMSIS release specific C/C++ source code. More...

## Macros
#define | __CM_CMSIS_VERSION
| Contains the CMSIS version.
#define | __CM_CMSIS_VERSION_MAIN
| Contains the CMSIS major version.
#define | __CM_CMSIS_VERSION_SUB
| Contains the CMSIS minor version.
#define | __CORTEX_M
| Contains the core version for a Cortex-M class controller.
#define | __CORTEX_SC
| Contains the core version for a Cortex Secure Core controller.
#define | __STAR_MC
| Contains the core version for a STAR-MC controller.

## Description

Version #define symbols for CMSIS release specific C/C++ source code.

CMSIS-Core Processor Files contain macros __CORTEX_M , __CORTEX_SC or __STAR_MC that identify the processor core variant described in the file.

Additionally each processor header file includes the cmsis_version.h file with __CM_CMSIS_VERSION define that identifies the CMSIS version used.

This allows application code and middleware components to verify the target processor and the CMSIS version that CMSIS-Core component implies.

## Macro Definition Documentation

## ◆ __CM_CMSIS_VERSION

#define __CM_CMSIS_VERSION

Contains the CMSIS version.

The CMSIS version is a combination of the __CM_CMSIS_VERSION_MAIN (bits 31..16) and __CM_CMSIS_VERSION_SUB (bits 15..0).

Code Example:

#if defined(__CM_CMSIS_VERSION) && \
(__CM_CMSIS_VERSION >= 0x00060000)
#error Yes, we have CMSIS 6.0 or later
#else
#error We need CMSIS 6.0 or later!
#endif

## ◆ __CM_CMSIS_VERSION_MAIN

#define __CM_CMSIS_VERSION_MAIN

Contains the CMSIS major version.

The CMSIS major version can be used to differentiate between CMSIS major releases.

## ◆ __CM_CMSIS_VERSION_SUB

#define __CM_CMSIS_VERSION_SUB

Contains the CMSIS minor version.

The CMSIS minor version can be used to query a CMSIS release update level.

## ◆ __CORTEX_M

#define __CORTEX_M

Contains the core version for a Cortex-M class controller.

This define can be used to differentiate between the various available Cortex-M controllers. Possible values are:

- 0 for a Cortex-M0 or Cortex-M0+
- 1 for a Cortex-M1
- 3 for a Cortex-M3
- 4 for a Cortex-M4
- 7 for a Cortex-M7
- 23 for a Cortex-M23
- 33 for a Cortex-M33
- 35 for a Cortex-M35P
- 55 for a Cortex-M55
- 85 for a Cortex-M85
- 2 for a Armv8-M Base Line device
- 80 for a Armv8-M Main Line device
- 81 for a Armv8.1-M Main Line device

This define is only available for Cortex-M class controllers. Code Example:

#if defined(__CORTEX_M) && (__CORTEX_M == 4)
#error Yes, we have an Cortex-M4 controller.
#else
#error We need a Cortex-M4 controller!
#endif

## ◆ __CORTEX_SC

#define __CORTEX_SC

Contains the core version for a Cortex Secure Core controller.

This define can be used to differentiate between the various available Cortex Secure Core controllers. Possible values are:

- 000 for a Cortex-SC000
- 300 for a Cortex-SC300

This define is only available for Cortex Secure Core controllers. Code Example:

#if defined(__CORTEX_SC) && (__CORTEX_SC == 300U)
#error Yes, we have an Cortex SC300 controller.
#else
#error We need a Cortex SC300 controller!
#endif

## ◆ __STAR_MC

#define __STAR_MC

Contains the core version for a STAR-MC controller.

This define can be used to differentiate between the various available STAR-MC controllers. Possible values are:

- 1 for a STAR-MC1

This define is only available for STAR-MC controllers. Code Example:

#if defined(__STAR_MC) && (__STAR_MC == 1U)
#error Yes, we have a STAR-MC1 controller.
#else
#error We need a STAR-MC1 controller!
#endif