/** \page Templates_pg Template Files \details ARM supplies CMSIS-CORE template files for the all supported Cortex-M processors and various compiler vendors. Refer to the list of \ref tested_tools_sec 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. \image html "CMSIS_CORE_Files.png" "CMSIS-CORE File Structure" \section template_files_sec 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. |
| 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_armv8mbl.h: for the ARMv8-M Baseline processor - core_armv8mml.h: for the ARMv8-M Mainline processor |
| core_cminstr.h | Defines intrinsic functions to access special Cortex-M instructions. |
| core_cmiunc.h | Defines functions to access the Cortex-M core peripherals. |
| core_cmsimd.h | Defines intrinsic functions to access the SIMD instructions for Cortex-M4, Cortex-M7 and ARMv8MML. |
| 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. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __CM0_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __CM0PLUS_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __CM3_REV | 0x0101 | 0x0200 | 0x0200 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __CM4_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __FPU_PRESENT | 0 .. 1 | 0 | Defines if a FPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| __CM7_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) | ||||||||||||
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not | ||||||||||||
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) | ||||||||||||
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. | ||||||||||||
| __FPU_PRESENT | 0 .. 1 | 0 | Defines if a FPU is present or not. See __FPU_DP description below. | ||||||||||||
| __FPU_DP | 0 .. 1 | 0 | The combination of the defines __FPU_PRESENT and __FPU_DP
determine the whether the FPU is with single or double precision as shown in the table below.
\n\n
|
||||||||||||
| __ICACHE_PRESENT | 0 .. 1 | 1 | Instruction Chache present or not | ||||||||||||
| __DCACHE_PRESENT | 0 .. 1 | 1 | Data Chache present or not | ||||||||||||
| __DTCM_PRESENT | 0 .. 1 | 1 | Data Tightly Coupled Memory is present or not |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __SC000_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __SC300_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __ARMv8MBL_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __SAU_PRESENT | 0 .. 1 | 0 | Defines if a SAU is present or not |
| __VTOR_PRESENT | 0 .. 1 | 0 | Defines if a VTOR register is present or not |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| __ARMv8MML_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __SAU_PRESENT | 0 .. 1 | 0 | Defines if a SAU is present or not |
| __FPU_PRESENT | 0 .. 1 | 0 | Defines if a FPU is present or not |
| __NVIC_PRIO_BITS | 2 .. 8 | 3 | Number of priority bits implemented in the NVIC (device specific) |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| SAU_INIT_CTRL | 0 .. 1 | 0 | Initialize SAU CTRL register or not - 0: do not initialize SAU CTRL register - 1: initialize SAU CTRL register |
| SAU_INIT_CTRL_ENABLE | 0 .. 1 | 0 | enable/disable the SAU - 0: disable SAU - 1: enable SAU |
| SAU_INIT_CTRL_ALLNS | 0 .. 1 | 0 | value for SAU_CTRL register bit ALLNS - 0: all Memory is Secure - 1: all Memory is Non-Secure |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| SAU_NO_REGIONS | 0 .. tbd | 4 | maximum number of SAU regions |
| SAU_INIT_REGION |
0 .. 1 | 0 | initialize SAU region or not - 0: do not initialize SAU region - 1: initialize SAU region |
| SAU_INIT_START |
0x00000000 .. 0xFFFFFFE0\n [in steps of 32] | 0x00000000 | region start address |
| SAU_INIT_END |
0x00000000 .. 0xFFFFFFE0\n [in steps of 32] | 0x00000000 | region start address |
| SAU_INIT_NSC |
0 .. 1 | 0 | SAU region attribute - 0: Non-Secure - 1: Secure, Non-Secure callable |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| CSR_INIT_DEEPSLEEPS | 0 .. 1 | 0 | value for SCB_CSR register bit DEEPSLEEPS - 0: Deep Sleep can be enabled by Secure and Non-Secure state - 1: Deep Sleep can be enabled by Secure state only |
| AIRCR_INIT_SYSRESETREQS | 0 .. 1 | 0 | value for SCB_AIRCR register bit SYSRESETREQS - 0: System reset request accessible from Secure and Non-Secure state - 1: System reset request accessible from Secure state only |
| AIRCR_INIT_PRIS | 0 .. 1 | 0 | value for SCB_AIRCR register bit PRIS - 0: Priority of Non-Secure exceptions is Not altered - 1: Priority of Non-Secure exceptions is Lowered to 0x80-0xFF |
| AIRCR_INIT_BFHFNMINS | 0 .. 1 | 0 | value for SCB_AIRCR register bit BFHFNMINS - 0: BusFault, HardFault, and NMI target are Secure state - 1: BusFault, HardFault, and NMI target are Non-Secure state |
| \#define | Value Range | Default | Description |
|---|---|---|---|
| NVIC_INIT_ITNS |
0x00000000 .. 0xFFFFFFFF\n [each bit represents an interrupt] | 0x00000000 | Interrupt vector target - 0: Secure state - 1: Non-Secure state |