CMSIS-CORE: Template Files

| CMSIS-CORE Version 4.30 CMSIS-CORE support for Cortex-M processor-based devices

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Enumerations Enumerator Groups Pages
Template Files

ARM supplies CMSIS-CORE template files for the all supported Cortex-M processors and various compiler vendors. Refer to the list of Tested and Verified Toolchains for compliance. These template files include the following:

- Register names of the Core Peripherals and names of the Core Exception Vectors.
- Functions to access core peripherals, special CPU instructions and SIMD instructions (for Cortex-M4 and Cortex-M7)
- Generic startup code and system configuration code.

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

CMSIS-CORE File Structure

# Template Files

The CMSIS-CORE template files should be extended by the silicon vendor to reflect the actual device and device peripherals. Silicon vendors add in this context the:

- Device Peripheral Access Layer that provides definitions for device-specific peripherals.
- Access Functions for Peripherals (optional) that provides additional helper functions to access device-specific peripherals.
- Interrupt vectors in the startup file that are device specific.

Template File | Description
--- | ---
.\Device\_Template_Vendor\Vendor\Device\Source\ARM\startup_Device.s | Startup file template for ARM C/C++ Compiler.
.\Device\_Template_Vendor\Vendor\Device\Source\GCC\startup_Device.s | Startup file template for GNU GCC ARM Embedded Compiler.
.\Device\_Template_Vendor\Vendor\Device\Source\IAR\startup_Device.s | Startup file template for IAR C/C++ Compiler.
.\Device\_Template_Vendor\Vendor\Device\Source\system_Device.c | Generic system_Device.c file for system configuration (i.e. processor clock and memory bus system).
.\Device\_Template_Vendor\Vendor\Device\Include\Device.h | Generic device header file. Needs to be extended with the device-specific peripheral registers. Optionally functions that access the peripherals can be part of that file.
.\Device\_Template_Vendor\Vendor\Device\Include\system_Device.h | Generic system device configuration include file.

In addition ARM provides the following core header files that do not need any modifications.

Core Header Files | Description
--- | ---
core_<cpu>.h | Defines the core peripherals and provides helper functions that access the core registers. This file is available for all supported processors:

- core_cm0.h: for the Cortex-M0 processor
- core_cm0plus.h: for the Cortex-M0+ processor
- core_cm3.h: for the Cortex-M3 processor
- core_cm4.h: for the Cortex-M4 processor
- core_cm7.h: for the Cortex-M7 processor
- core_sc000.h: for the SecurCore SC000 processor
- core_sc300.h: for the SecurCore SC300 processor

core_cmInstr.h | Defines intrinsic functions to access special Cortex-M instructions.
core_cmFunc.h | Defines functions to access the Cortex-M core peripherals.
core_cm4_simd.h | Defines intrinsic functions to access the SIMD instructions for Cortex-M4 and Cortex-M7.

# Adaption of Template Files to Devices

Copy the complete folder including files and replace:

- folder name 'Vendor' with the abbreviation for the device vendor e.g.: NXP.
- folder name 'Device' with the specific device name e.g.: LPC17xx.
- in the filenames 'Device' with the specific device name e.g.: LPC17xx.

Each template file contains comments that start with ToDo: that describe a required modification. The template files contain placeholders:

Placeholder | Replaced with
--- | ---
<Device> | the specific device name or device family name; i.e. LPC17xx.
<DeviceInterrupt> | a specific interrupt name of the device; i.e. TIM1 for Timer 1.
<DeviceAbbreviation> | short name or abbreviation of the device family; i.e. LPC.
Cortex-M# | the specific Cortex-M processor name; i.e. Cortex-M3.

The adaption of the template files is described in detail on the following pages:

- Startup File startup_<device>.s
- System Configuration Files system_<device>.c and system_<device>.h
- Device Header File <device.h>