]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/Template.txt
Doxygen: Fix warnings.
[cmsis] / CMSIS / DoxyGen / Core / src / Template.txt
1 /**
2 \page templates_pg CMSIS-Core Device Templates
3
4 \details
5
6 Arm supplies CMSIS-Core device template files for the all supported Cortex-M processors and various compiler vendors.
7 Refer to the list of \ref tested_tools_sec for compliance.
8
9
10 These CMSIS-Core device template files include the following:
11  - Register names of the Core Peripherals and names of the Core Exception Vectors.
12  - Functions to access core peripherals, special CPU instructions and SIMD instructions (for Cortex-M4 and Cortex-M7)
13  - Generic startup code and system configuration code.
14
15 The detailed file structure of the CMSIS-Core device templates is shown in the following picture.
16
17 \image html "CMSIS_CORE_Files.png" "CMSIS-Core File Structure"
18
19 \section CMSIS_Processor_files CMSIS-Core Processor Files
20
21 The CMSIS-Core processor files provided by Arm are in the directory .\\CMSIS\\Core\\Include. These header files define all processor specific attributes do not need any modifications.
22 The <b>core_&lt;cpu&gt;.h</b> defines the core peripherals and provides helper functions that access the core registers. One file is available for each supported Cortex-M processor:
23
24  Header File      | Processor
25 :-----------      |:---------
26 core_cm0.h        | for the Cortex-M0 processor
27 core_cm0plus.h    | for the Cortex-M0+ processor
28 core_cm3.h        | for the Cortex-M3 processor
29 core_cm4.h        | for the Cortex-M4 processor
30 core_cm7.h        | for the Cortex-M7 processor
31 \if ARMv8M
32 core_cm23.h       | for the Cortex-M23 processor
33 core_cm33.h       | for the Cortex-M33 processor
34 core_cm35p.h      | for the Cortex-M35P processor
35 core_cm55.h       | for the Cortex-M55 processor
36 \endif
37 \if ARMSC
38 core_sc000.h      | for the SecurCore SC000 processor
39 core_sc300.h      | for the SecurCore SC300 processor
40 \endif
41 \if ARMv8M
42 core_armv8mbl.h   | for the Armv8-M Baseline processor
43 core_armv8mml.h   | for the Armv8-M Mainline processor
44 core_armv81mml.h  | for the Armv8.1-M Mainline processor
45 \endif
46 \section device_examples Device Examples
47
48 The CMSIS Software Pack defines several devices that are based on the various processors. The device related CMSIS-Core files are in the directory .\\Device\\ARM
49 and include CMSIS-Core processor file explained before. The following sample devices are defined in the CMSIS-Pack description file <b>ARM.CMSIS.pdsc</b>:
50
51  Family            | Device                  | Description
52 :------            |:------                  |:-----------
53 ARM Cortex-M0      | ARMCM0                  | Cortex-M0 based device
54 ARM Cortex-M0 plus | ARMCM0P                 | Cortex-M0+ based device
55 ARM Cortex-M3      | ARMCM3                  | Cortex-M3 based device
56 ARM Cortex-M4      | ARMCM4                  | Cortex-M4 based device without floating-point hardware
57 ARM Cortex-M4      | ARMCM4_FP               | Cortex-M4 based device with floating-point hardware
58 ARM Cortex-M7      | ARMCM7                  | Cortex-M4 based device without floating-point hardware
59 ARM Cortex-M7      | ARMCM7_FP               | Cortex-M7 based device with single precision floating-point unit (FPU)
60 ARM Cortex-M7      | ARMCM7_DP               | Cortex-M7 based device with double precision floating-point unit
61 ARM Cortex-M7      | ARMCM7                  | Cortex-M7 based device without floating-point hardware
62 \if ARMv8M
63 ARM Cortex-M23     | ARMCM23                 | Cortex-M23 based device without TrustZone
64 ARM Cortex-M23     | ARMCM23_TZ              | Cortex-M23 based device with TrustZone
65 ARM Cortex-M33     | ARMCM33                 | Cortex-M33 based device without TrustZone, SIMD, FPU
66 ARM Cortex-M33     | ARMCM33_TZ              | Cortex-M33 based device with TrustZone, no SIMD, no FPU
67 ARM Cortex-M33     | ARMCM33_DSP_FP          | Cortex-M33 based device with SIMD, FPU, no TrustZone
68 ARM Cortex-M33     | ARMCM33_DSP_FP_TZ       | Cortex-M33 based device with TrustZone, SIMD, FPU
69 ARM Cortex-M35P    | ARMCM35P                | Cortex-M35P based device without TrustZone, SIMD, FPU
70 ARM Cortex-M35P    | ARMCM35P_TZ             | Cortex-M35P based device with TrustZone, no SIMD, no FPU
71 ARM Cortex-M35P    | ARMCM35P_DSP_FP         | Cortex-M35P based device with SIMD, FPU, no TrustZone
72 ARM Cortex-M35P    | ARMCM35P_DSP_FP_TZ      | Cortex-M35P based device with TrustZone, SIMD, FPU
73 ARM Cortex-M55     | ARMCM55                 | Cortex-M55 based device with TrustZone, SIMD, double precision FPU, and floating-point MVE
74 \endif
75 \if ARMSC
76 ARM SC000          | ARM SC000               | SC000 based device
77 ARM SC300          | ARM SC300               | SC300 based device
78 \endif
79 \if ARMv8M
80 ARMv8-M Baseline   | ARMv8MBL                | Armv8-M Baseline based device with TrustZone
81 ARMv8-M Mainline   | ARMv8MML                | Armv8-M Mainline based device with TrustZone
82 ARMv8-M Mainline   | ARMv8MML_DP             | Armv8-M Mainline based device with TrustZone and double precision FPU
83 ARMv8-M Mainline   | ARMv8MML_SP             | Armv8-M Mainline based device with TrustZone and single precision FPU
84 ARMv8-M Mainline   | ARMv8MML_DSP            | Armv8-M Mainline based device with TrustZone and SIMD
85 ARMv8-M Mainline   | ARMv8MML_DSP_DP         | Armv8-M Mainline based device with TrustZone, SIMD, and double precision FPU
86 ARMv8-M Mainline   | ARMv8MML_DSP_SP         | Armv8-M Mainline based device with TrustZone, SIMD, and single precision FPU
87 ARMv8.1-M Mainline | ARMv81MML_DSP_DP_MVE_FP | Armv8.1-M Mainline based device with TrustZone, SIMD, double precision FPU, and floating-point MVE
88 \endif
89
90 \section template_files_sec Template Files
91
92 To simplify the creation of CMSIS-Core device files, the following template files are provided that should be extended by the silicon vendor to reflect the actual device and device peripherals.
93 Silicon vendors add to these template files the following information:
94  - <b>Device Peripheral Access Layer</b> that provides definitions for device-specific peripherals.
95  - <b>Access Functions for Peripherals</b> (optional) that provides additional helper functions to access device-specific peripherals.
96  - <b>Interrupt vectors</b> in the startup file that are device specific.
97
98 <table class="cmtable">
99     <tr>
100       <th>Template File</th>
101       <th>Description</th>
102     </tr>
103     <tr>
104       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\startup_Device_ac5_noSct.s</td>
105       <td>Startup file template for Arm Compiler V5. No linker description file necessary.<br>
106           <b>Deprecated</b></td>
107     </tr>
108     <tr>
109       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\startup_Device_ac5.s</td>
110       <td>Startup file template for Arm Compiler V5. Use of linker description file is <b>necessary</b>.<br>
111           <b>Deprecated</b></td>
112     </tr>
113     <tr>
114       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\startup_Device_ac6.S</td>
115       <td>Preprocessed startup file template for Arm Compiler V6. Use of linker description file is <b>necessary</b>.<br>
116           <b>Deprecated</b></td>
117     </tr>
118     <tr>
119       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\Device_ac5.sct</td>
120       <td>Linker description file for Arm Compiler V5.<br>
121           <b>Deprecated</b></td>
122     </tr>
123     <tr>
124       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\ARM\\Device_ac6.sct</td>
125       <td>Linker description file for Arm Compiler V6.</td>
126     </tr>
127     <tr>
128       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\GCC\\startup_Device.S</td>
129       <td>Preprocessed startup file template for GNU GCC Arm Embedded Compiler. Use of linker description file is <b>necessary</b>.<.<br>
130           <b>Deprecated</b></td>
131     </tr>
132     <tr>
133       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\GCC\\gcc_arm.ld</td>
134       <td>Linker description file for GNU GCC Arm Embedded Compiler.</td>
135     </tr>
136     <tr>
137       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\IAR\\startup_Device.s</td>
138       <td>Startup file template for IAR C/C++ Compiler.</td>
139     </tr>
140     <tr>
141       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\startup_Device.c</td>
142       <td>Generic startup_Device.c file for device startup implemented in C. Use of linker description file is necessary.</td>
143     </tr>
144     <tr>
145       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Source\\system_Device.c</td>
146       <td>Generic system_Device.c file for system configuration (i.e. processor clock and memory bus system).</td>
147     </tr>
148     <tr>
149       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Include\\Device.h</td>
150       <td>Generic device header file. Needs to be extended with the device-specific peripheral registers. Optionally functions that access the peripherals
151       can be part of that file.</td>
152     </tr>
153     <tr>
154       <td>.\\Device\\\_Template_Vendor\\Vendor\\Device\\Include\\system_Device.h</td>
155       <td>Generic system device configuration include file.</td>
156     </tr>
157 </table>
158
159
160 <b>Adapt Template Files to a Device</b>
161
162 The following steps describe how to adopt the template files to a specific device or device family.
163 Copy the complete all files in the template directory and replace:
164   - directory name 'Vendor' with the abbreviation for the device vendor  e.g.: NXP.
165   - directory name 'Device' with the specific device name e.g.: LPC17xx.
166   - in the file names 'Device' with the specific device name e.g.: LPC17xx.
167
168 Each template file contains comments that start with \b ToDo: that describe a required modification.
169 The template files contain place holders:
170
171 <table class="cmtable">
172     <tr>
173       <th>Placeholder</th>
174       <th>Replaced with</th>
175     </tr>
176     <tr>
177       <td>&lt;Device&gt;</td>
178       <td>the specific device name or device family name; i.e. LPC17xx.</td>
179     </tr>
180     <tr>
181       <td>&lt;DeviceInterrupt&gt;</td>
182       <td>a specific interrupt name of the device; i.e. TIM1 for Timer 1.</td>
183     <tr>
184       <td>&lt;DeviceAbbreviation&gt;</td>
185       <td>short name or abbreviation of the device family; i.e. LPC.</td>
186     </tr>
187     <tr>
188       <td>Cortex-M#</td>
189       <td>the specific Cortex-M processor name; i.e. Cortex-M3.</td>
190     </tr>
191 </table>
192
193
194 The device configuration of the template files is described in detail on the following pages:
195   - \subpage startup_c_pg
196   - \subpage startup_s_pg (deprecated)
197   - \subpage system_c_pg
198   - \subpage device_h_pg
199 \if ARMv8M
200   - \subpage partition_h_pg
201   - \subpage partition_gen_h_pg
202 \endif
203 */
204
205 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
206 /**
207 \page startup_c_pg Startup File startup_<device>.c
208
209 The \ref startup_c_pg contains:
210  - The reset handler which is executed after CPU reset and typically calls the \ref SystemInit function.
211  - The setup values for the Main Stack Pointer (MSP).
212  - Exception vectors of the Cortex-M Processor with weak functions that implement default routines.
213  - Interrupt vectors that are device specific with weak functions that implement default routines.
214
215 The file exists for each supported toolchain and is the only tool-chain specific CMSIS file.
216
217 To adapt the file to a new device only the interrupt vector table needs to be extended with
218 the device-specific interrupt handlers. The naming convention for the interrupt handler names are
219 &lt;interrupt_name&gt;_IRQHandler.  This table needs to be consistent with \ref IRQn_Type that defines all the
220 IRQ numbers for each interrupt.
221
222 \b Example:
223
224 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
225
226 \code
227 /*----------------------------------------------------------------------------
228   Exception / Interrupt Handler
229  *----------------------------------------------------------------------------*/
230 /* Exceptions */
231 void WAKEUP0_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
232 void WAKEUP1_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
233 void WAKEUP2_IRQHandler     (void) __attribute__ ((weak, alias("Default_Handler")));
234 // :
235 // :
236 void EINT1_IRQHandler       (void) __attribute__ ((weak, alias("Default_Handler")));
237 void EINT2_IRQHandler       (void) __attribute__ ((weak, alias("Default_Handler")));
238 // :
239 // :
240
241 /*----------------------------------------------------------------------------
242   Exception / Interrupt Vector table
243  *----------------------------------------------------------------------------*/
244 extern const pFunc __VECTOR_TABLE[240];
245        const pFunc __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
246   (pFunc)(&__INITIAL_SP),                   /*     Initial Stack Pointer */
247   Reset_Handler,                            /*     Reset Handler */
248   NMI_Handler,                              /* -14 NMI Handler */
249   HardFault_Handler,                        /* -13 Hard Fault Handler */
250   MemManage_Handler,                        /* -12 MPU Fault Handler */
251   BusFault_Handler,                         /* -11 Bus Fault Handler */
252   UsageFault_Handler,                       /* -10 Usage Fault Handler */
253   0,                                        /*     Reserved */
254   0,                                        /*     Reserved */
255   0,                                        /*     Reserved */
256   0,                                        /*     Reserved */
257   SVC_Handler,                              /*  -5 SVC Handler */
258   DebugMon_Handler,                         /*  -4 Debug Monitor Handler */
259   0,                                        /*     Reserved */
260   PendSV_Handler,                           /*  -2 PendSV Handler */
261   SysTick_Handler,                          /*  -1 SysTick Handler */
262
263   /* Interrupts */
264   WAKEUP0_IRQHandler,                       /*   0 Wakeup PIO0.0 */
265   WAKEUP1_IRQHandler,                       /*   1 Wakeup PIO0.1 */
266   WAKEUP2_IRQHandler,                       /*   2 Wakeup PIO0.2 */
267   // :
268   // :
269   EINT1_IRQHandler,                         /*  30 PIO INT1 */
270   EINT2_IRQHandler,                         /*  31 PIO INT2 */
271   // :
272   // :
273 };
274 \endcode
275
276 \section startup_c_sec startup_Device.c Template File
277
278 A compiler agnostic \ref startup_c_sec for an Armv7-M processor like Cortex-M3 is shown below.
279 The C startup file relys on certain compiler specific preprocessor defines specified in CMSIS compiler headers:
280  - \ref __INITIAL_SP
281  - \ref __STACK_LIMIT
282  - \ref __PROGRAM_START
283  - \ref __VECTOR_TABLE
284  - \ref __VECTOR_TABLE_ATTRIBUTE
285
286 \verbinclude "Source/startup_Device.c"
287 \section startup_c_sec_v8 startup_Device.c Template File (Armv8-M/v8.1-M)
288
289 The C-startup file for an Armv8-M/v8.1-M processor is similar to the one for an Armv7-M processor
290 except that it offers the possibility of stack sealing for the Main Stack Pointer (MSP).
291 The following preprocessor defines and CMSIS functions are used:
292  - \ref __STACK_SEAL
293  - \ref __TZ_set_STACKSEAL_S
294
295 The stack sealing and the initialization fof the Stack Limit register is done in function <b>void Reset_Handler(void)</b>:
296
297 \code
298 /*----------------------------------------------------------------------------
299   Reset Handler called on controller reset
300  *----------------------------------------------------------------------------*/
301 __NO_RETURN void Reset_Handler(void)
302 {
303   __set_PSP((uint32_t)(&__INITIAL_SP));
304
305   __set_MSPLIM((uint32_t)(&__STACK_LIMIT));
306   __set_PSPLIM((uint32_t)(&__STACK_LIMIT));
307
308 #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
309   __TZ_set_STACKSEAL_S((uint32_t *)(&__STACK_SEAL));
310 #endif
311
312   SystemInit();                             /* CMSIS System Initialization */
313   __PROGRAM_START();                        /* Enter PreMain (C library entry point) */
314 }
315 \endcode
316
317 \note Stack Sealing also requires the application project to use a scatter file (or a linker script) as explained in \ref RTOS_TrustZone_stacksealing section.
318
319 */
320
321 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
322 /**
323 \page startup_s_pg Startup File startup_<device>.s (deprecated)
324
325 The \ref startup_s_pg contains:
326  - The reset handler which is executed after CPU reset and typically calls the \ref SystemInit function.
327  - The setup values for the Main Stack Pointer (MSP).
328  - Exception vectors of the Cortex-M Processor with weak functions that implement default routines.
329  - Interrupt vectors that are device specific with weak functions that implement default routines.
330
331 The file exists for each supported toolchain and is the only tool-chain specific CMSIS file.
332
333 To adapt the file to a new device only the interrupt vector table needs to be extended with
334 the device-specific interrupt handlers. The naming convention for the interrupt handler names are
335 &lt;interrupt_name&gt;_IRQHandler.  This table needs to be consistent with \ref IRQn_Type that defines all the
336 IRQ numbers for each interrupt.
337
338 \b Example:
339
340 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
341
342 \code
343                 ; External Interrupts
344                 DCD     WAKEUP0_IRQHandler       ; 16+ 0: Wakeup PIO0.0
345                 DCD     WAKEUP1_IRQHandler       ; 16+ 1: Wakeup PIO0.1
346                 DCD     WAKEUP2_IRQHandler       ; 16+ 2: Wakeup PIO0.2
347                  :       :
348                  :       :
349                 DCD     EINT1_IRQHandler         ; 16+30: PIO INT1
350                 DCD     EINT0_IRQHandler         ; 16+31: PIO INT0
351    :
352    :
353                 EXPORT  WAKEUP0_IRQHandler       [WEAK]
354                 EXPORT  WAKEUP1_IRQHandler       [WEAK]
355                 EXPORT  WAKEUP2_IRQHandler       [WEAK]
356                  :       :
357                  :       :
358                 EXPORT  EINT1_IRQHandler         [WEAK]
359                 EXPORT  EINT0_IRQHandler         [WEAK]
360
361 WAKEUP0_IRQHandler
362 WAKEUP1_IRQHandler
363 WAKEUP1_IRQHandler
364       :
365       :
366 EINT1_IRQHandler
367 EINT0_IRQHandler
368                 B       .
369
370 \endcode
371
372 \section startup_s_sec startup_Device.S Template File
373
374 An Arm Compiler V6 assembler \ref startup_s_sec for an Armv8-M processor like Cortex-M33 is shown below.
375 The files for other compiler vendors differ slightly in the syntax, but not in the overall structure.
376
377 \verbinclude "Source/ARM/startup_Device_ac6.S"
378 */
379
380 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
381 /**
382 \page system_c_pg System Configuration Files system_<device>.c and system_<device>.h
383
384 The \ref system_c_pg provides as a minimum the functions described under \ref system_init_gr.
385 These functions are device specific and need adaptations. In addition, the file might have
386 configuration settings for the device such as XTAL frequency or PLL prescaler settings.
387
388 For devices with external memory BUS the system_<device>.c also configures the BUS system.
389
390 The silicon vendor might expose other functions (i.e. for power configuration) in the system_<device>.c file.
391 In case of additional features the function prototypes need to be added to the system_<device>.h header file.
392
393 \section system_Device_sec system_Device.c Template File
394
395 The \ref system_Device_sec for the Cortex-M3 is shown below.
396
397 \verbinclude "Source/system_Device.c"
398
399 \section system_Device_h_sec system_Device.h Template File
400
401 The system_<device>.h header file contains prototypes to access the public functions in the system_<device>.c file.
402 The \ref system_Device_h_sec is shown below.
403
404 \verbinclude "Include/system_Device.h"
405
406 */
407
408 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
409 /**
410 \page device_h_pg Device Header File <device.h>
411
412 The \ref device_h_pg contains the following sections that are device specific:
413
414   - \ref interrupt_number_sec provides interrupt numbers (IRQn) for all exceptions and interrupts of the device.
415   - \ref core_config_sect reflect the features of the device.
416   - \ref device_access provides definitions for the \ref peripheral_gr to all device peripherals. It contains all data structures and the address mapping for device-specific peripherals.
417   - <b>Access Functions for Peripherals (optional)</b> provide additional helper functions for peripherals that are useful for programming of these peripherals. Access Functions may be provided as inline functions or can be extern references to a device-specific library provided by the silicon vendor.
418
419 <a href="Modules.html">\b Reference </a> describes the standard features and functions of the \ref device_h_pg in detail.
420
421 \section interrupt_number_sec Interrupt Number Definition
422
423 \ref device_h_pg contains the enumeration \ref IRQn_Type that defines all exceptions and interrupts of the device.
424   - Negative IRQn values represent processor core exceptions (internal interrupts).
425   - Positive IRQn values represent device-specific exceptions (external interrupts). The first device-specific interrupt has the IRQn value 0.
426     The IRQn values needs extension to reflect the device-specific interrupt vector table in the \ref startup_s_pg.
427
428 \b Example:
429
430 The following example shows the extension of the interrupt vector table for the LPC1100 device family.
431
432 \code
433 typedef enum IRQn
434 {
435 /******  Cortex-M0 Processor Exceptions Numbers ***************************************************/
436   NonMaskableInt_IRQn           = -14,      /*!< 2 Non Maskable Interrupt                         */
437   HardFault_IRQn                = -13,      /*!< 3 Cortex-M0 Hard Fault Interrupt                 */
438   SVCall_IRQn                   = -5,       /*!< 11 Cortex-M0 SVC Interrupt                       */
439   PendSV_IRQn                   = -2,       /*!< 14 Cortex-M0 PendSV Interrupt                    */
440   SysTick_IRQn                  = -1,       /*!< 15 Cortex-M0 System Tick Interrupt               */
441
442 /******  LPC11xx/LPC11Cxx Specific Interrupt Numbers **********************************************/
443   WAKEUP0_IRQn                  = 0,        /*!< All I/O pins can be used as wakeup source.       */
444   WAKEUP1_IRQn                  = 1,        /*!< There are 13 pins in total for LPC11xx           */
445   WAKEUP2_IRQn                  = 2,
446                  :       :
447                  :       :
448   EINT1_IRQn                    = 30,       /*!< External Interrupt 1 Interrupt                   */
449   EINT0_IRQn                    = 31,       /*!< External Interrupt 0 Interrupt                   */
450 } IRQn_Type;
451 \endcode
452
453 \section core_config_sect Configuration of the Processor and Core Peripherals
454
455 The \ref device_h_pg  configures the Cortex-M or SecurCore processor and the core peripherals with <i>\#defines</i>
456 that are set prior to including the file <b>core_<cpu>.h</b>.
457
458 The following tables list the <i>\#defines</i> along with the possible values for each processor core.
459 If these <i>\#defines</i> are missing default values are used.
460 \b core_cm0.h
461 <table class="cmtable">
462     <tr>
463       <th>\#define</th>
464       <th>Value Range</th>
465       <th>Default</th>
466       <th>Description</th>
467     </tr>
468     <tr>
469       <td>\ref __CM0_REV</td>
470       <td>0x0000</td>
471       <td>0x0000</td>
472       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
473     </tr>
474     <tr>
475       <td>\ref __NVIC_PRIO_BITS</td>
476       <td>2</td>
477       <td>2</td>
478       <td>Number of priority bits implemented in the NVIC (device specific)</td>
479     </tr>
480     <tr>
481       <td>\ref __Vendor_SysTickConfig</td>
482       <td>0 .. 1</td>
483       <td>0</td>
484       <td>Vendor defined <b>SysTick_Config</b> function.</td>
485     </tr>
486 </table>
487
488 \b core_cm0plus.h
489 <table class="cmtable">
490     <tr>
491       <th>\#define</th>
492       <th>Value Range</th>
493       <th>Default</th>
494       <th>Description</th>
495     </tr>
496     <tr>
497       <td>\ref __CM0PLUS_REV</td>
498       <td>0x0000</td>
499       <td>0x0000</td>
500       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
501     </tr>
502     <tr>
503       <td>\ref __VTOR_PRESENT</td>
504       <td>0 .. 1</td>
505       <td>0</td>
506       <td>Defines if a VTOR register is present or not</td>
507     </tr>
508     <tr>
509       <td>\ref __NVIC_PRIO_BITS</td>
510       <td>2</td>
511       <td>2</td>
512       <td>Number of priority bits implemented in the NVIC (device specific)</td>
513     </tr>
514     <tr>
515       <td>\ref __Vendor_SysTickConfig</td>
516       <td>0 .. 1</td>
517       <td>0</td>
518       <td>Vendor defined <b>SysTick_Config</b> function.</td>
519     </tr>
520 </table>
521
522 \b core_cm3.h
523 <table class="cmtable">
524     <tr>
525       <th>\#define</th>
526       <th>Value Range</th>
527       <th>Default</th>
528       <th>Description</th>
529     </tr>
530     <tr>
531       <td>\ref __CM3_REV</td>
532       <td>0x0101 | 0x0200</td>
533       <td>0x0200</td>
534       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
535     </tr>
536     <tr>
537       <td>\ref __VTOR_PRESENT</td>
538       <td>0 .. 1</td>
539       <td>1</td>
540       <td>Defines if a VTOR register is present or not</td>
541     </tr>
542     <tr>
543       <td>\ref __NVIC_PRIO_BITS</td>
544       <td>2 .. 8</td>
545       <td>4</td>
546       <td>Number of priority bits implemented in the NVIC (device specific)</td>
547     </tr>
548     <tr>
549       <td>\ref __MPU_PRESENT</td>
550       <td>0 .. 1</td>
551       <td>0</td>
552       <td>Defines if a MPU is present or not</td>
553     </tr>
554     <tr>
555       <td>\ref __Vendor_SysTickConfig</td>
556       <td>0 .. 1</td>
557       <td>0</td>
558       <td>Vendor defined <b>SysTick_Config</b> function.</td>
559     </tr>
560 </table>
561
562 \b core_cm4.h
563 <table class="cmtable">
564     <tr>
565       <th>\#define</th>
566       <th>Value Range</th>
567       <th>Default</th>
568       <th>Description</th>
569     </tr>
570     <tr>
571       <td>\ref __CM4_REV</td>
572       <td>0x0000</td>
573       <td>0x0000</td>
574       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
575     </tr>
576     <tr>
577       <td>\ref __VTOR_PRESENT</td>
578       <td>0 .. 1</td>
579       <td>1</td>
580       <td>Defines if a VTOR register is present or not</td>
581     </tr>
582     <tr>
583       <td>\ref __NVIC_PRIO_BITS</td>
584       <td>2 .. 8</td>
585       <td>4</td>
586       <td>Number of priority bits implemented in the NVIC (device specific)</td>
587     </tr>
588     <tr>
589       <td>\ref __MPU_PRESENT</td>
590       <td>0 .. 1</td>
591       <td>0</td>
592       <td>Defines if a MPU is present or not</td>
593     </tr>
594     <tr>
595       <td>\ref __FPU_PRESENT</td>
596       <td>0 .. 1</td>
597       <td>0</td>
598       <td>Defines if a FPU is present or not</td>
599     </tr>
600     <tr>
601       <td>\ref __Vendor_SysTickConfig</td>
602       <td>0 .. 1</td>
603       <td>0</td>
604       <td>Vendor defined <b>SysTick_Config</b> function.</td>
605     </tr>
606 </table>
607
608 \b core_cm7.h
609 <table class="cmtable" summary="">
610     <tr>
611       <th>\#define</th>
612       <th>Value Range</th>
613       <th>Default</th>
614       <th>Description</th>
615     </tr>
616     <tr>
617       <td>\ref __CM7_REV</td>
618       <td>0x0000</td>
619       <td>0x0000</td>
620       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
621     </tr>
622     <tr>
623       <td>\ref __MPU_PRESENT</td>
624       <td>0 .. 1</td>
625       <td>0</td>
626       <td>Defines if a MPU is present or not</td>
627     </tr>
628     <tr>
629       <td>\ref __VTOR_PRESENT</td>
630       <td>0 .. 1</td>
631       <td>1</td>
632       <td>Defines if a VTOR register is present or not</td>
633     </tr>
634     <tr>
635       <td>\ref __NVIC_PRIO_BITS</td>
636       <td>2 .. 8</td>
637       <td>4</td>
638       <td>Number of priority bits implemented in the NVIC (device specific)</td>
639     </tr>
640     <tr>
641       <td>\ref __Vendor_SysTickConfig</td>
642       <td>0 .. 1</td>
643       <td>0</td>
644       <td>
645         If this define is set to 1, then the default <b>SysTick_Config</b> function
646         is excluded. In this case, the file <i><b>device.h</b></i>
647         must contain a vendor specific implementation of this function.
648       </td>
649     </tr>
650     <tr>
651       <td>\ref __FPU_PRESENT</td>
652       <td>0 .. 1</td>
653       <td>0</td>
654       <td>Defines if a FPU is present or not.</td>
655     </tr>
656     <tr>
657       <td>\ref __FPU_DP</td>
658       <td>0 .. 1</td>
659       <td>0</td>
660       <td>
661         The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP
662        determine whether the FPU is with single or double precision.
663       </td>
664     </tr>
665     <tr>
666       <td>\ref __ICACHE_PRESENT</td>
667       <td>0 .. 1</td>
668       <td>1</td>
669       <td>Instruction Chache present or not</td>
670     </tr>
671     <tr>
672       <td>\ref __DCACHE_PRESENT</td>
673       <td>0 .. 1</td>
674       <td>1</td>
675       <td>Data Chache present or not</td>
676     </tr>
677     <tr>
678       <td>\ref __DTCM_PRESENT</td>
679       <td>0 .. 1</td>
680       <td>1</td>
681       <td>Data Tightly Coupled Memory is present or not</td>
682     </tr>
683 </table>
684
685 \if ARMSC
686 \b core_sc000.h
687 <table class="cmtable">
688     <tr>
689       <th>\#define</th>
690       <th>Value Range</th>
691       <th>Default</th>
692       <th>Description</th>
693     </tr>
694     <tr>
695       <td>\ref __SC000_REV</td>
696       <td>0x0000</td>
697       <td>0x0000</td>
698       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
699     </tr>
700     <tr>
701       <td>\ref __VTOR_PRESENT</td>
702       <td>0 .. 1</td>
703       <td>0</td>
704       <td>Defines if a VTOR register is present or not</td>
705     </tr>
706     <tr>
707       <td>\ref __NVIC_PRIO_BITS</td>
708       <td>2</td>
709       <td>2</td>
710       <td>Number of priority bits implemented in the NVIC (device specific)</td>
711     </tr>
712     <tr>
713       <td>\ref __MPU_PRESENT</td>
714       <td>0 .. 1</td>
715       <td>0</td>
716       <td>Defines if a MPU is present or not</td>
717     </tr>
718     <tr>
719       <td>\ref __Vendor_SysTickConfig</td>
720       <td>0 .. 1</td>
721       <td>0</td>
722       <td>Vendor defined <b>SysTick_Config</b> function.</td>
723     </tr>
724 </table>
725 \endif
726
727 \if ARMSC
728 \b core_sc300.h
729 <table class="cmtable">
730     <tr>
731       <th>\#define</th>
732       <th>Value Range</th>
733       <th>Default</th>
734       <th>Description</th>
735     </tr>
736     <tr>
737       <td>\ref __SC300_REV</td>
738       <td>0x0000</td>
739       <td>0x0000</td>
740       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
741     </tr>
742     <tr>
743       <td>\ref __VTOR_PRESENT</td>
744       <td>0 .. 1</td>
745       <td>1</td>
746       <td>Defines if a VTOR register is present or not</td>
747     </tr>
748     <tr>
749       <td>\ref __NVIC_PRIO_BITS</td>
750       <td>2 .. 8</td>
751       <td>4</td>
752       <td>Number of priority bits implemented in the NVIC (device specific)</td>
753     </tr>
754     <tr>
755       <td>\ref __MPU_PRESENT</td>
756       <td>0 .. 1</td>
757       <td>0</td>
758       <td>Defines if a MPU is present or not</td>
759     </tr>
760     <tr>
761       <td>\ref __Vendor_SysTickConfig</td>
762       <td>0 .. 1</td>
763       <td>0</td>
764       <td>Vendor defined <b>SysTick_Config</b> function.</td>
765     </tr>
766 </table>
767 \endif
768
769 \if ARMv8M
770 \b core_CM23.h or \b core_ARMv8MBL.h
771 <table class="cmtable">
772     <tr>
773       <th>\#define</th>
774       <th>Value Range</th>
775       <th>Default</th>
776       <th>Description</th>
777     </tr>
778     <tr>
779       <td>\ref __ARMv8MBL_REV or \ref __CM23_REV</td>
780       <td>0x0000</td>
781       <td>0x0000</td>
782       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
783     </tr>
784     <tr>
785       <td>\ref __MPU_PRESENT</td>
786       <td>0 .. 1</td>
787       <td>0</td>
788       <td>Defines if a MPU is present or not</td>
789     </tr>
790     <tr>
791       <td>\ref __SAUREGION_PRESENT</td>
792       <td>0 .. 1</td>
793       <td>0</td>
794       <td>Defines if SAU regions are present or not</td>
795     </tr>
796     <tr>
797       <td>\ref __VTOR_PRESENT</td>
798       <td>0 .. 1</td>
799       <td>0</td>
800       <td>Defines if a VTOR register is present or not</td>
801     </tr>
802     <tr>
803       <td>\ref __NVIC_PRIO_BITS</td>
804       <td>2</td>
805       <td>2</td>
806       <td>Number of priority bits implemented in the NVIC (device specific)</td>
807     </tr>
808     <tr>
809       <td>\ref __Vendor_SysTickConfig</td>
810       <td>0 .. 1</td>
811       <td>0</td>
812       <td>Vendor defined <b>SysTick_Config</b> function.</td>
813     </tr>
814 </table>
815 \endif
816
817 \if ARMv8M
818 \b core_CM33.h or \b core_cm35p.h or \b core_ARMv8MML.h
819 <table class="cmtable">
820     <tr>
821       <th>\#define</th>
822       <th>Value Range</th>
823       <th>Default</th>
824       <th>Description</th>
825     </tr>
826     <tr>
827       <td>\ref __ARMv8MML_REV or \ref __CM33_REV or \ref __CM35P_REV</td>
828       <td>0x0000</td>
829       <td>0x0000</td>
830       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
831     </tr>
832     <tr>
833       <td>\ref __MPU_PRESENT</td>
834       <td>0 .. 1</td>
835       <td>0</td>
836       <td>Defines if a MPU is present or not</td>
837     </tr>
838     <tr>
839       <td>\ref __SAUREGION_PRESENT</td>
840       <td>0 .. 1</td>
841       <td>0</td>
842       <td>Defines if SAU regions are present or not</td>
843     </tr>
844     <tr>
845       <td>\ref __FPU_PRESENT</td>
846       <td>0 .. 1</td>
847       <td>0</td>
848       <td>Defines if a FPU is present or not</td>
849     </tr>
850     <tr>
851       <td>\ref __VTOR_PRESENT</td>
852       <td>0 .. 1</td>
853       <td>1</td>
854       <td>Defines if a VTOR register is present or not</td>
855     </tr>
856     <tr>
857       <td>\ref __NVIC_PRIO_BITS</td>
858       <td>2 .. 8</td>
859       <td>3</td>
860       <td>Number of priority bits implemented in the NVIC (device specific)</td>
861     </tr>
862     <tr>
863       <td>\ref __Vendor_SysTickConfig</td>
864       <td>0 .. 1</td>
865       <td>0</td>
866       <td>Vendor defined <b>SysTick_Config</b> function.</td>
867     </tr>
868 </table>
869 \endif
870
871 \if ARMv8M
872 \b core_CM55.h or \b core_ARMv81MML.h
873 <table class="cmtable">
874     <tr>
875       <th>\#define</th>
876       <th>Value Range</th>
877       <th>Default</th>
878       <th>Description</th>
879     </tr>
880     <tr>
881       <td>\ref __ARMv81MML_REV or \ref __CM55_REV</td>
882       <td>0x0000</td>
883       <td>0x0000</td>
884       <td>Core revision number ([15:8] revision number, [7:0] patch number)</td>
885     </tr>
886     <tr>
887       <td>\ref __MPU_PRESENT</td>
888       <td>0 .. 1</td>
889       <td>0</td>
890       <td>Defines if a MPU is present or not</td>
891     </tr>
892     <tr>
893       <td>\ref __SAUREGION_PRESENT</td>
894       <td>0 .. 1</td>
895       <td>0</td>
896       <td>Defines if SAU regions are present or not</td>
897     </tr>
898     <tr>
899       <td>\ref __FPU_PRESENT</td>
900       <td>0 .. 1</td>
901       <td>0</td>
902       <td>Defines if a FPU is present or not</td>
903     </tr>
904     <tr>
905       <td>\ref __FPU_DP</td>
906       <td>0 .. 1</td>
907       <td>0</td>
908       <td>
909         The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP determine
910         whether the FPU is with single or double precision.
911       </td>
912     </tr>
913     <tr>
914       <td>\ref __ICACHE_PRESENT</td>
915       <td>0 .. 1</td>
916       <td>1</td>
917       <td>Instruction Chache present or not</td>
918     </tr>
919     <tr>
920       <td>\ref __DCACHE_PRESENT</td>
921       <td>0 .. 1</td>
922       <td>1</td>
923       <td>Data Chache present or not</td>
924     </tr>
925     <tr>
926       <td>\ref __VTOR_PRESENT</td>
927       <td>0 .. 1</td>
928       <td>1</td>
929       <td>Defines if a VTOR register is present or not</td>
930     </tr>
931     <tr>
932       <td>\ref __NVIC_PRIO_BITS</td>
933       <td>2 .. 8</td>
934       <td>3</td>
935       <td>Number of priority bits implemented in the NVIC (device specific)</td>
936     </tr>
937     <tr>
938       <td>\ref __Vendor_SysTickConfig</td>
939       <td>0 .. 1</td>
940       <td>0</td>
941       <td>Vendor defined <b>SysTick_Config</b> function.</td>
942     </tr>
943 </table>
944 \endif
945
946 \b Example
947
948 The following code exemplifies the configuration of the Cortex-M4 Processor and Core Peripherals.
949
950 \code
951 #define __CM4_REV                 0x0001U   /* Core revision r0p1                                 */
952 #define __MPU_PRESENT             1U        /* MPU present or not                                 */
953 #define __VTOR_PRESENT            1U        /* VTOR present */
954 #define __NVIC_PRIO_BITS          3U        /* Number of Bits used for Priority Levels            */
955 #define __Vendor_SysTickConfig    0U        /* Set to 1 if different SysTick Config is used       */
956 #define __FPU_PRESENT             1U        /* FPU present or not                                 */
957 .
958 .
959 #include <core_cm4.h>                       /* Cortex-M4 processor and core peripherals           */
960 #include "system_<device>.h"                /* Device System Header                               */
961 \endcode
962
963
964 \section core_version_sect   CMSIS Version and Processor Information
965
966 Defines in the core_<i>cpu</i>.h file identify the version of the CMSIS-Core (Cortex-M) and the processor used.
967 The following shows the defines in the various core_<i>cpu</i>.h files that may be used in the \ref device_h_pg
968 to verify a minimum version or ensure that the right processor core is used.
969
970 \b core_cm0.h
971 \code
972 #define __CM0_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /* [31:16] CMSIS HAL main version */
973 #define __CM0_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
974 #define __CM0_CMSIS_VERSION       ((__CM0_CMSIS_VERSION_MAIN << 16U) | \
975                                     __CM0_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
976
977 #define __CORTEX_M                (0U)                                              /* Cortex-M Core */
978 \endcode
979
980
981 \b core_cm0plus.h
982 \code
983 #define __CM0PLUS_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                     /* [31:16] CMSIS HAL main version */
984 #define __CM0PLUS_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                      /* [15:0]  CMSIS HAL sub version */
985 #define __CM0PLUS_CMSIS_VERSION       ((__CM0P_CMSIS_VERSION_MAIN << 16U) | \
986                                         __CM0P_CMSIS_VERSION_SUB          )         /* CMSIS HAL version number */
987
988 #define __CORTEX_M                    (0U)                                          /* Cortex-M Core */
989 \endcode
990
991
992 \b core_cm1.h
993 \code
994 #define __CM1_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /*!< \deprecated [31:16] CMSIS HAL main version */
995 #define __CM1_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /*!< \deprecated [15:0]  CMSIS HAL sub version */
996 #define __CM1_CMSIS_VERSION       ((__CM1_CMSIS_VERSION_MAIN << 16U) | \
997                                     __CM1_CMSIS_VERSION_SUB           )             /*!< \deprecated CMSIS HAL version number */
998
999 #define __CORTEX_M                (1U)                                              /*!< Cortex-M Core */
1000 \endcode
1001
1002 \b core_cm3.h
1003 \code
1004 #define __CM3_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /* [31:16] CMSIS HAL main version */
1005 #define __CM3_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
1006 #define __CM3_CMSIS_VERSION       ((__CM3_CMSIS_VERSION_MAIN << 16U) | \
1007                                     __CM3_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
1008
1009 #define __CORTEX_M                (3U)                                              /* Cortex-M Core */
1010 \endcode
1011
1012 \b core_cm4.h
1013 \code
1014 #define __CM4_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                         /* [31:16] CMSIS HAL main version */
1015 #define __CM4_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
1016 #define __CM4_CMSIS_VERSION       ((__CM4_CMSIS_VERSION_MAIN << 16U) | \
1017                                     __CM4_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
1018
1019 #define __CORTEX_M                (4U)                                              /* Cortex-M Core */
1020 \endcode
1021
1022 \b core_cm7.h
1023 \code
1024 #define __CM7_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN                          /* [31:16] CMSIS HAL main version */
1025 #define __CM7_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                          /* [15:0]  CMSIS HAL sub version */
1026 #define __CM7_CMSIS_VERSION       ((__CM7_CMSIS_VERSION_MAIN << 16U) | \
1027                                     __CM7_CMSIS_VERSION_SUB          )              /* CMSIS HAL version number */
1028
1029 #define __CORTEX_M                (7U)                                              /* Cortex-M Core */
1030 \endcode
1031
1032 \if ARMv8M
1033 \b core_cm23.h
1034 \code
1035 #define __CM23_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                        /* [31:16] CMSIS HAL main version */
1036 #define __CM23_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                         /* [15:0]  CMSIS HAL sub version */
1037 #define __CM23_CMSIS_VERSION       ((__CM23_CMSIS_VERSION_MAIN << 16U) | \
1038                                      __CM23_CMSIS_VERSION_SUB          )            /* CMSIS HAL version number */
1039
1040 #define __CORTEX_M                (23U)                                             /* Cortex-M Core */
1041 \endcode
1042
1043 \b core_cm33.h
1044 \code
1045 #define __CM33_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                        /* [31:16] CMSIS HAL main version */
1046 #define __CM33_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                         /* [15:0]  CMSIS HAL sub version */
1047 #define __CM33_CMSIS_VERSION       ((__CM33_CMSIS_VERSION_MAIN << 16U) | \
1048                                      __CM33_CMSIS_VERSION_SUB          )            /* CMSIS HAL version number */
1049
1050 #define __CORTEX_M                (33U)                                             /* Cortex-M Core */
1051 \endcode
1052
1053 \b core_cm55.h
1054 \code
1055 #define __CM55_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                        /* [31:16] CMSIS HAL main version */
1056 #define __CM55_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                         /* [15:0]  CMSIS HAL sub version */
1057 #define __CM55_CMSIS_VERSION       ((__CM55_CMSIS_VERSION_MAIN << 16U) | \
1058                                      __CM55_CMSIS_VERSION_SUB          )            /* CMSIS HAL version number */
1059
1060 #define __CORTEX_M                (7U)                                              /* Cortex-M Core */
1061 \endcode
1062 \endif
1063
1064 \if ARMSC
1065 \b core_sc000.h
1066 \code
1067 #define __SC000_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                       /* [31:16] CMSIS HAL main version */
1068 #define __SC000_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                        /* [15:0]  CMSIS HAL sub version */
1069 #define __SC000_CMSIS_VERSION       ((__SC000_CMSIS_VERSION_MAIN << 16U) | \
1070                                       __SC000_CMSIS_VERSION_SUB          )          /* CMSIS HAL version number */
1071
1072 #define __CORTEX_SC                 (0U)                                            /* Cortex secure core */
1073 \endcode
1074 \endif
1075
1076 \if ARMSC
1077 \b core_sc300.h
1078 \code
1079 #define __SC300_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                       /* [31:16] CMSIS HAL main version */
1080 #define __SC300_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                        /* [15:0]  CMSIS HAL sub version */
1081 #define __SC300_CMSIS_VERSION       ((__SC300_CMSIS_VERSION_MAIN << 16U) | \
1082                                       __SC300_CMSIS_VERSION_SUB          )          /* CMSIS HAL version number */
1083
1084 #define __CORTEX_SC                 (300U)                                          /* Cortex secure core */
1085 \endcode
1086 \endif
1087
1088 \if ARMv8M
1089 \if ARMSC
1090 \b core_cm35p.h
1091 \code
1092 #define __CM35P_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                       /* [31:16] CMSIS HAL main version */
1093 #define __CM35P_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                        /* [15:0]  CMSIS HAL sub version */
1094 #define __CM35P_CMSIS_VERSION       ((__CM35P_CMSIS_VERSION_MAIN << 16U) | \
1095                                       __CM35P_CMSIS_VERSION_SUB          )          /* CMSIS HAL version number */
1096
1097 #define __CORTEX_M                (35U)                                             /* Cortex-M Core */
1098 \endcode
1099 \endif
1100 \endif
1101
1102 \if ARMv8M
1103 \b core_ARMv8MBL.h
1104 \code
1105 #define __ARMv8MBL_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                    /* [31:16] CMSIS HAL main version */
1106 #define __ARMv8MBL_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                     /* [15:0]  CMSIS HAL sub version */
1107 #define __ARMv8MBL_CMSIS_VERSION       ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \
1108                                          __ARMv8MBL_CMSIS_VERSION_SUB           )   /* CMSIS HAL version number */
1109
1110 #define __CORTEX_M                     (2U)                                         /* Cortex secure core */
1111 \endcode
1112 \endif
1113
1114 \if ARMv8M
1115 \b core_ARMv8MML.h
1116 \code
1117 #define __ARMv8MML_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                    /* [31:16] CMSIS HAL main version */
1118 #define __ARMv8MML_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                     /* [15:0]  CMSIS HAL sub version */
1119 #define __ARMv8MML_CMSIS_VERSION       ((__ARMv8MML_CMSIS_VERSION_MAIN << 16U) | \
1120                                          __ARMv8MML_CMSIS_VERSION_SUB           )   /* CMSIS HAL version number */
1121
1122 #define __CORTEX_M                     (80U)                                        /* Cortex secure core */
1123 \endcode
1124 \endif
1125
1126 \if ARMv81M
1127 \b core_ARMv81MML.h
1128 \code
1129 #define __ARMv81MML_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                   /* [31:16] CMSIS HAL main version */
1130 #define __ARMv81MML_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                    /* [15:0]  CMSIS HAL sub version */
1131 #define __ARMv81MML_CMSIS_VERSION       ((__ARMv81MML_CMSIS_VERSION_MAIN << 16U) | \
1132                                           __ARMv81MML_CMSIS_VERSION_SUB           ) /* CMSIS HAL version number */
1133
1134 #define __CORTEX_M                     (81U)                                        /* Cortex secure core */
1135 \endcode
1136 \endif
1137
1138 \section device_access Device Peripheral Access Layer
1139
1140 The \ref device_h_pg contains for each peripheral:
1141  - Register Layout Typedef
1142  - Base Address
1143  - Access Definitions
1144
1145 The section \ref peripheral_gr shows examples for peripheral definitions.
1146
1147 \section device_h_sec Device.h Template File
1148
1149 The silicon vendor needs to extend the Device.h template file with the CMSIS features described above.
1150 In addition the \ref device_h_pg may contain functions to access device-specific peripherals.
1151 The \ref system_Device_h_sec which is provided as part of the CMSIS specification is shown below.
1152
1153 \verbinclude "Include/Device.h"
1154
1155 */
1156
1157
1158
1159 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
1160 /**
1161 \if ARMv8M
1162
1163 \page partition_h_pg TrustZone setup: partition_<device>.h
1164
1165 The \ref partition_h_pg header file contains the initial setup of the TrustZone hardware in an Armv8-M system.
1166
1167 This file implements the function \ref TZ_SAU_Setup that is call from \ref SystemInit. It uses settings in these files:
1168
1169  - \ref partition_h_pg "partition_<device>.h" that defines the initial system configuration and during SystemInit in Secure state.
1170  - \ref partition_gen_h_pg "partition_gen.h" that contains SAU region and interrupt target assignments. This file may be generated using <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>.
1171
1172 \note
1173 \ref partition_gen_h_pg "partition_gen.h" is optional and can be generated using <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>.  In previous versions of CMSIS-Core(M) this settings were part of \ref partition_h_pg "partition_<device>.h".
1174
1175 &nbsp;
1176
1177
1178 The \ref partition_h_pg "partition_<device>.h" file contains the following configuration settings for:
1179   - \ref sau_ctrlregister_sec provides settings for the SAU CTRL register.
1180   - \ref sau_sleepexception_sec provides device-specific deep-sleep and exception settings.
1181   - \ref sau_fpu_sec defines the usage of the Floating Point Unit in secure and non-secure state.
1182
1183 The \ref partition_h_pg "partition_<device>.h" file includes the \ref partition_gen_h_pg "partition_gen.h" file with configuration settings for:
1184   - \ref sau_regions_sect provides configuration of the SAU Address Regions.
1185   - \ref sau_interrupttarget_sec provides device-specific interrupt target settings.
1186
1187 \section sau_ctrlregister_sec  SAU CTRL register settings
1188 <table class="cmtable">
1189     <tr>
1190       <th>\#define</th>
1191       <th>Value Range</th>
1192       <th>Default</th>
1193       <th>Description</th>
1194     </tr>
1195     <tr>
1196       <td>SAU_INIT_CTRL</td>
1197       <td>0 .. 1</td>
1198       <td>0</td>
1199       <td>Initialize SAU CTRL register or not
1200            - 0: do not initialize SAU CTRL register
1201            - 1: initialize SAU CTRL register</td>
1202     </tr>
1203     <tr>
1204       <td>SAU_INIT_CTRL_ENABLE</td>
1205       <td>0 .. 1</td>
1206       <td>0</td>
1207       <td>enable/disable the SAU
1208            - 0: disable SAU
1209            - 1: enable SAU</td>
1210     </tr>
1211     <tr>
1212       <td>SAU_INIT_CTRL_ALLNS</td>
1213       <td>0 .. 1</td>
1214       <td>0</td>
1215       <td>value for SAU_CTRL register bit ALLNS
1216            - 0: all Memory is Secure
1217            - 1: all Memory is Non-Secure</td>
1218     </tr>
1219 </table>
1220
1221
1222 \section sau_sleepexception_sec  Configuration of Sleep and Exception behaviour
1223 <table class="cmtable">
1224     <tr>
1225       <th>\#define</th>
1226       <th>Value Range</th>
1227       <th>Default</th>
1228       <th>Description</th>
1229     </tr>
1230     <tr>
1231       <td>SCB_CSR_AIRCR_INIT</td>
1232       <td>0 .. 1</td>
1233       <td>1</td>
1234       <td>Setup behaviour of Sleep and Exception Handling
1235            - 0: not setup of CSR and AIRCR registers; the values below are not relevant
1236            - 1: setup of CSR and AIRCR registers with values below</td>
1237     </tr>
1238     <tr>
1239       <td>CSR_INIT_DEEPSLEEPS_VAL</td>
1240       <td>0 .. 1</td>
1241       <td>1</td>
1242       <td>value for SCB_CSR register bit DEEPSLEEPS
1243            - 0: Deep Sleep can be enabled by Secure and Non-Secure state
1244            - 1: Deep Sleep can be enabled by Secure state only</td>
1245     </tr>
1246     <tr>
1247       <td>AIRCR_INIT_SYSRESETREQS_VAL</td>
1248       <td>0 .. 1</td>
1249       <td>1</td>
1250       <td>value for SCB_AIRCR register bit SYSRESETREQS
1251            - 0: System reset request accessible from Secure and Non-Secure state
1252            - 1: System reset request accessible from Secure state only</td>
1253     </tr>
1254     <tr>
1255       <td>AIRCR_INIT_PRIS_VAL</td>
1256       <td>0 .. 1</td>
1257       <td>1</td>
1258       <td>value for SCB_AIRCR register bit PRIS
1259            - 0: Priority of Non-Secure exceptions is Not altered
1260            - 1: Priority of Non-Secure exceptions is Lowered to 0x80-0xFF</td>
1261     </tr>
1262     <tr>
1263       <td>AIRCR_INIT_BFHFNMINS_VAL</td>
1264       <td>0 .. 1</td>
1265       <td>0</td>
1266       <td>value for SCB_AIRCR register bit BFHFNMINS
1267            - 0: BusFault, HardFault, and NMI target are Secure state
1268            - 1: BusFault, HardFault, and NMI target are Non-Secure state</td>
1269     </tr>
1270 </table>
1271
1272
1273 \section sau_fpu_sec  Configuration of Floating Point Unit
1274 <table class="cmtable">
1275     <tr>
1276       <th>\#define</th>
1277       <th>Value Range</th>
1278       <th>Default</th>
1279       <th>Description</th>
1280     </tr>
1281     <tr>
1282       <td>TZ_FPU_NS_USAGE</td>
1283       <td>0 .. 1</td>
1284       <td>1</td>
1285       <td>Setup behaviour of Floating Point Unit
1286            - 0: not setup of NSACR and FPCCR registers; the values below are not relevant
1287            - 1: setup of NSACR and FPCCR registers with values below</td>
1288     </tr>
1289     <tr>
1290       <td>SCB_NSACR_CP10_11_VAL</td>
1291       <td>0 or 3</td>
1292       <td>3</td>
1293       <td>Floating Point Unit usage (Value for SCB->NSACR register bits CP10, CP11)
1294            - 0: Secure state only
1295            - 3: Secure and Non-Secure state</td>
1296     </tr>
1297     <tr>
1298       <td>FPU_FPCCR_TS_VAL</td>
1299       <td>0 .. 1</td>
1300       <td>0</td>
1301       <td>Treat floating-point registers as Secure (value for FPU->FPCCR register bit TS)
1302            - 0: Disable
1303            - 1: Enabled</td>
1304     </tr>
1305     <tr>
1306       <td>FPU_FPCCR_CLRONRETS_VAL</td>
1307       <td>0 .. 1</td>
1308       <td>0</td>
1309       <td>Clear on return (CLRONRET) accessibility (Value for FPU->FPCCR register bit CLRONRETS)
1310            - 0: Secure and Non-Secure state
1311            - 1: Secure state only</td>
1312     </tr>
1313     <tr>
1314       <td>FPU_FPCCR_CLRONRET_VAL</td>
1315       <td>0 .. 1</td>
1316       <td>1</td>
1317       <td>Clear floating-point caller saved registers on exception return (Value for FPU->FPCCR register bit CLRONRET)
1318            - 0: Disabled
1319            - 1: Enabled</td>
1320     </tr>
1321 </table>
1322
1323 &nbsp;
1324
1325 ----
1326
1327 \section partition_gen_h_pg Region/ISR setup: partition_gen.h
1328
1329 The \ref partition_gen_h_pg "partition_gen.h" header file can be generated using <a href="../../Zone/html/index.html"><b>CMSIS-Zone</b></a>.
1330
1331 The \ref partition_h_pg "partition_<device>.h" file includes the \ref partition_h_pg "partition_gen.h" file with configuration settings for:
1332   - \ref sau_regions_sect provides configuration of the SAU Address Regions.
1333   - \ref sau_interrupttarget_sec provides device-specific interrupt target settings.
1334
1335 \note
1336 In previous versions of CMSIS-Core(M) the above settings were part of \ref partition_h_pg "partition_<device>.h"
1337
1338 \subsection sau_regions_sect  Configuration of the SAU Address Regions
1339 <table class="cmtable">
1340     <tr>
1341       <th>\#define</th>
1342       <th>Value Range</th>
1343       <th>Default</th>
1344       <th>Description</th>
1345     </tr>
1346     <tr>
1347       <td>SAU_REGIONS_MAX</td>
1348       <td>0 .. tbd</td>
1349       <td>8</td>
1350       <td>maximum number of SAU regions</td>
1351     </tr>
1352     <tr>
1353       <td>SAU_INIT_REGION<number></td>
1354       <td>0 .. 1</td>
1355       <td>0</td>
1356       <td>initialize SAU region or not
1357            - 0: do not initialize SAU region
1358            - 1: initialize SAU region</td>
1359     </tr>
1360     <tr>
1361       <td>SAU_INIT_START<number></td>
1362       <td>0x00000000 .. 0xFFFFFFE0\n
1363           [in steps of 32]</td>
1364       <td>0x00000000</td>
1365       <td>region start address</td>
1366     </tr>
1367     <tr>
1368       <td>SAU_INIT_END<number></td>
1369       <td>0x00000000 .. 0xFFFFFFE0\n
1370           [in steps of 32]</td>
1371       <td>0x00000000</td>
1372       <td>region start address</td>
1373     </tr>
1374     <tr>
1375       <td>SAU_INIT_NSC<number></td>
1376       <td>0 .. 1</td>
1377       <td>0</td>
1378       <td>SAU region attribute
1379            - 0: Non-Secure
1380            - 1: Secure, Non-Secure callable</td>
1381     </tr>
1382 </table>
1383
1384 The range of \<number\> is from 0 .. SAU_REGIONS_MAX.
1385 A set of these macros must exist for each \<number\>.
1386
1387 The following example shows a set of SAU region macros.
1388
1389 \code
1390 #define SAU_REGIONS_MAX   8                 /* Max. number of SAU regions */
1391
1392 #define SAU_INIT_REGION0    1
1393 #define SAU_INIT_START0     0x00000000      /* start address of SAU region 0 */
1394 #define SAU_INIT_END0       0x001FFFE0      /* end address of SAU region 0 */
1395 #define SAU_INIT_NSC0       1
1396
1397 #define SAU_INIT_REGION1    1
1398 #define SAU_INIT_START1     0x00200000      /* start address of SAU region 1 */
1399 #define SAU_INIT_END1       0x003FFFE0      /* end address of SAU region 1 */
1400 #define SAU_INIT_NSC1       0
1401
1402 #define SAU_INIT_REGION2    1
1403 #define SAU_INIT_START2     0x20200000      /* start address of SAU region 2 */
1404 #define SAU_INIT_END2       0x203FFFE0      /* end address of SAU region 2 */
1405 #define SAU_INIT_NSC2       0
1406
1407 #define SAU_INIT_REGION3    1
1408 #define SAU_INIT_START3     0x40000000      /* start address of SAU region 3 */
1409 #define SAU_INIT_END3       0x40040000      /* end address of SAU region 3 */
1410 #define SAU_INIT_NSC3       0
1411
1412 #define SAU_INIT_REGION4    0
1413 #define SAU_INIT_START4     0x00000000      /* start address of SAU region 4 */
1414 #define SAU_INIT_END4       0x00000000      /* end address of SAU region 4 */
1415 #define SAU_INIT_NSC4       0
1416
1417 #define SAU_INIT_REGION5    0
1418 #define SAU_INIT_START5     0x00000000      /* start address of SAU region 5 */
1419 #define SAU_INIT_END5       0x00000000      /* end address of SAU region 5 */
1420 #define SAU_INIT_NSC5       0
1421
1422 #define SAU_INIT_REGION6    0
1423 #define SAU_INIT_START6     0x00000000      /* start address of SAU region 6 */
1424 #define SAU_INIT_END6       0x00000000      /* end address of SAU region 6 */
1425 #define SAU_INIT_NSC6       0
1426
1427 #define SAU_INIT_REGION7    0
1428 #define SAU_INIT_START7     0x00000000      /* start address of SAU region 7 */
1429 #define SAU_INIT_END7       0x00000000      /* end address of SAU region 7 */
1430 #define SAU_INIT_NSC7       0
1431 \endcode
1432
1433
1434 \subsection sau_interrupttarget_sec Configuration of Interrupt Target settings
1435
1436 Each interrupt has a configuration bit that defines the execution
1437 in Secure or Non-secure state. The Non-Secure interrupts have a separate
1438 vector table.  Refer to \ref Model_TrustZone for more information.
1439
1440 <table class="cmtable">
1441     <tr>
1442       <th>\#define</th>
1443       <th>Value Range</th>
1444       <th>Default</th>
1445       <th>Description</th>
1446     </tr>
1447     <tr>
1448       <td>NVIC_INIT_ITNS<number></td>
1449       <td>0x00000000 .. 0xFFFFFFFF\n
1450           [each bit represents an interrupt]</td>
1451       <td>0x00000000</td>
1452       <td>Interrupt vector target
1453            - 0: Secure state
1454            - 1: Non-Secure state</td>
1455     </tr>
1456 </table>
1457
1458 The range of \<number\> is 0 .. (\<number of external interrupts\> + 31) / 32.
1459
1460 The following example shows the configuration for a maximum of 64 external interrupts.
1461
1462 \code
1463 #define NVIC_INIT_ITNS0      0x0000122B
1464 #define NVIC_INIT_ITNS1      0x0000003A
1465 \endcode
1466
1467 \endif
1468
1469 */
1470
1471 /**
1472 \defgroup device_config Device capabilitiy defines
1473 \brief Defines to configure and check device capabilities.
1474 \details
1475 These defines are used by the \ref device_h_pg in order to enable or disable
1476 functionality provided by CMSIS-Core(M) dependent on the device capabilities.
1477
1478 @{
1479 */
1480
1481 #define __CM0_REV                     /*!< \brief Cortex-M0 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1482 #define __CM0PLUS_REV                 /*!< \brief Cortex-M0+ Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1483 #define __CM1_REV                     /*!< \brief Cortex-M1 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1484 #define __CM3_REV                     /*!< \brief Cortex-M3 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1485 #define __CM4_REV                     /*!< \brief Cortex-M4 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1486 #define __CM7_REV                     /*!< \brief Cortex-M7 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1487 #define __SC000_REV                   /*!< \brief SC000 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1488 #define __SC300_REV                   /*!< \brief SC300 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1489 #define __CM23_REV                    /*!< \brief Cortex-M23 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1490 #define __CM33_REV                    /*!< \brief Cortex-M33 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1491 #define __CM35P_REV                   /*!< \brief Cortex-M35P Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1492 #define __CM55_REV                    /*!< \brief Cortex-M55 Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1493 #define __ARMv8MBL_REV                /*!< \brief Armv8-M Baseline device Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1494 #define __ARMv8MML_REV                /*!< \brief Armv8-M Mainline device Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1495 #define __ARMv81MML_REV               /*!< \brief Armv8.1-M Baseline device Core revision r0p1 \details ([15:8] revision number, [7:0] patch number) */
1496 #define __NVIC_PRIO_BITS              /*!< \brief Number of Bits used for Priority Levels */
1497 #define __Vendor_SysTickConfig        /*!< \brief Set to 1 if a venor specfic SysTick configuration is used.
1498                                            \details If this define is set to 1, then the default \ref SysTick_Config function is excluded. In this
1499                                                     case, the file device.h must contain a vendor specific implementation of this function. */
1500 #define __VTOR_PRESENT                /*!< \brief VTOR present or not \details See \ref SCB_Type::VTOR */
1501 #define __MPU_PRESENT                 /*!< \brief MPU present or not */
1502
1503 /**
1504   \brief FPU present or not
1505   \details
1506   The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP
1507   determine the whether the FPU is with single or double precision as shown
1508   in the table below.
1509   <table class="cmtable" summary="">
1510     <tr bgcolor="cyan">
1511       <td>\ref __FPU_PRESENT</td>
1512       <td>\ref __FPU_DP</td>
1513       <td><b>Description</b></td>
1514     </tr>
1515     <tr>
1516       <td align="center">0</td>
1517       <td align="center"><i>ignored</i></td>
1518       <td>Processor has no FPU. The value set for \ref __FPU_DP.</td>
1519     </tr>
1520     <tr>
1521       <td align="center">1</td>
1522       <td align="center">0</td>
1523       <td>Processor with FPU with single precision.</td>
1524     </tr>
1525     <tr>
1526       <td align="center">1</td>
1527       <td align="center">1</td>
1528       <td>Processor with FPU with double precision.</td>
1529     </tr>
1530   </table>
1531 */
1532 #define __FPU_PRESENT               /*!< \brief FPU present \details The */
1533
1534 /**
1535   \brief Double precision FPU present
1536   \details
1537   The combination of the defines \ref __FPU_PRESENT and \ref __FPU_DP
1538   determine the whether the FPU is with single or double precision as shown
1539   in the table below.
1540   <table class="cmtable" summary="">
1541     <tr bgcolor="cyan">
1542       <td>\ref __FPU_PRESENT</td>
1543       <td>\ref __FPU_DP</td>
1544       <td><b>Description</b></td>
1545     </tr>
1546     <tr>
1547       <td align="center">0</td>
1548       <td align="center"><i>ignored</i></td>
1549       <td>Processor has no FPU. The value set for \ref __FPU_DP. </td>
1550     </tr>
1551     <tr>
1552       <td align="center">1</td>
1553       <td align="center">0</td>
1554       <td>Processor with FPU with single precision.</td>
1555     </tr>
1556     <tr>
1557       <td align="center">1</td>
1558       <td align="center">1</td>
1559       <td>Processor with FPU with double precision.</td>
1560     </tr>
1561   </table>
1562 */
1563 #define __FPU_DP
1564
1565 #define __DSP_PRESENT               /*!< \brief DSP extension present or not */
1566 #define __SAUREGION_PRESENT         /*!< \brief SAU regions present or not */
1567 #define __PMU_PRESENT               /*!< \brief PMU present or not */
1568 #define __PMU_NUM_EVENTCNT          /*!< \brief PMU Event Counters \details The number of Event counters if PMU is present (see \ref __PMU_PRESENT) */
1569 #define __ICACHE_PRESENT            /*!< \brief Instruction Cache present or not */
1570 #define __DCACHE_PRESENT            /*!< \brief Data Cache present or not */
1571 #define __DTCM_PRESENT              /*!< \brief Data Tightly Coupled Memory is present or not */
1572 /** @} */