CMSIS-Core (Cortex-M)  
CMSIS-Core support for Cortex-M processor-based devices
 
Loading...
Searching...
No Matches
CMSIS-Core Files

CMSIS-Core files can be differentiated in two main groups:

  1. CMSIS-Core Standard Files are provided by Arm for supported CPU cores as part of the CMSIS-Core software component. These files typically do not require any modifications and are expected to be included via CMSIS-Core device files.
  2. CMSIS-Core Device Files are specified in CMSIS-Core methodology, and are typically provided by CPU device vendors to correctly cover their specific functionalities. Some of them may expect additional application-specific changes.

The detailed file structure of the CMSIS-Core files is shown in the following picture.

CMSIS-Core File Structure

Delivery in CMSIS-Packs explains how CMSIS-Core Files can be distributed in CMSIS-Pack format.

CMSIS-Core Standard Files

The CMSIS-Core Standard file implement all attributes specific to Arm processor cores and generally do not need any modifications.

The files are provided by Arm as CMSIS-Core software component that is part of the CMSIS Software pack. The CMSIS-Core standard files can be split into following categories explained below:

CMSIS-Core Processor Files

The CMSIS-Core processor files define the core peripherals and provide helper functions for their access.

The files have naming convention core_<cpu>.h, with one file available for each supported processor <cpu> as listed in the table below.

Header File Target Processor Core
📂 CMSIS/Core/Include CMSIS-Core include folder (See on GitHub)
┣ 📄 core_cm0.h Cortex-M0 processor
┣ 📄 core_cm0plus.h Cortex-M0+ processor
┣ 📄 core_cm1.h Cortex-M1 processor
┣ 📄 core_cm3.h Cortex-M3 processor
┣ 📄 core_cm4.h Cortex-M4 processor
┣ 📄 core_cm7.h Cortex-M7 processor
┣ 📄 core_cm23.h Cortex-M23 processor
┣ 📄 core_cm33.h Cortex-M33 processor
┣ 📄 core_cm35p.h Cortex-M35P processor
┣ 📄 core_cm52.h Cortex-M52 processor
┣ 📄 core_cm55.h Cortex-M55 processor
┣ 📄 core_cm85.h Cortex-M85 processor
┣ 📄 core_starmc1.h STAR-MC1 processor
┣ 📄 core_sc000.h SC000 processor
┗ 📄 core_sc300.h SC300 processor

The files also include the CMSIS-Core Compiler Files and depending on the features supported by the core also correponding CMSIS-Core Architecture Feature Files.

CMSIS-Core Compiler Files

The CMSIS-Core compiler files provide consistent implementations of #define symbols that allow toolchain-agnostic usage of CMSIS-Core. CMSIS-Core Processor Files rely on such toolchain-agnostic abstractions by including cmsis_compiler.h file that then selects the target compiler-specific implementatation depending on the toolchain used in the project.

CMSIS-Core compiler files are provided in CMSIS/Core/Include/ directory, and define the supported compilers as listed in Tested and Verified Toolchains. Compiler Control documents the functionalities provided by the CMSIS compliant toolchains.

Header File Description
📂 CMSIS/Core/Include CMSIS-Core include folder (See on GitHub)
┣ 📄 cmsis_compiler.h Main CMSIS-Core compiler header file
┗ 📂 m-profile Directory for M-Profile specific files
   ┣ 📄 cmsis_armclang_m.h CMSIS-Core Arm Clang compiler file for Cortex-M
   ┣ 📄 cmsis_clang_m.h CMSIS-Core Clang compiler file for Cortex-M
   ┣ 📄 cmsis_gcc_m.h CMSIS-Core GCC compiler file for Cortex-M
   ┣ 📄 cmsis_iccarm_m.h CMSIS-Core IAR compiler file for Cortex-M
   â”— 📄 cmsis_tiarmclang_m.h CMSIS-Core TI Clang compiler file

CMSIS-Core Architecture Feature Files

Several architecture-specific features are implemented in separate header files that then gets included by CMSIS-Core Processor Files if corresponding feature is supported.

For Cortex-M cores following architecture feature files are provided in the CMSIS/Core/Include/m-profile/ folder:

Header File Feature
📂 CMSIS/Core/Include CMSIS-Core include folder (See on GitHub)
┣ 📂 m-profile Directory for M-Profile specific files
   ┣ 📄 armv7m_cache1.h Cache Functions (Level-1)
   ┣ 📄 armv7m_mpu.h MPU Functions for Armv6-M/v7-M
   ┣ 📄 armv8m_mpu.h MPU Functions for Armv8-M
   ┣ 📄 armv8m_pmu.h PMU Functions for Armv8.1-M
   â”— 📄 armv81m_pac.h PAC functions
┗ 📄 tz_context.h API header file for RTOS Context Management

CMSIS Version and Processor Information

__CM_CMSIS_VERSION is defined in the cmsis_version.h file and provides the version of the CMSIS-Core (Cortex-M). It is constructed as follows:

#define __CM_CMSIS_VERSION_MAIN ( 5U) /* [31:16] CMSIS Core(M) main version */
#define __CM_CMSIS_VERSION_SUB ( 7U) /* [15:0] CMSIS Core(M) sub version */
#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
__CM_CMSIS_VERSION_SUB ) /* CMSIS Core(M) version number */

The cmsis_version.h is included by each cpu_<core>.h so the CMSIS version defines are available via them already.

The cpu_<core>.h files use specific defines (such as __CORTEX_M) that provide identification of the target processor core.

These defines can be used in the Device Header File <Device.h> to verify a minimum CMSIS-Core version as well as the target processor. Read more at Version Control.