]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/core_device_files.md
Reworked CMSIS-Core(M) and Core(A) docs for CMSIS 6. (#47)
[cmsis] / CMSIS / DoxyGen / Core / src / core_device_files.md
1 # CMSIS-Core Device Files {#cmsis_device_files}
2
3 The **CMSIS-Core Device Files** implement CMSIS-Core support for a specific microcontroller device or family of devices. These files are typically provided by the device vendor and use \ref cmsis_standard_files via \#include directives.
4
5 CMSIS-Core specifies the organization of CMSIS-Core Device Files, defines their functionalities, and provides unified naming conventions. This brings   following benefits:
6  - Simplified device support for vendors with fast scaling for device families and variants on all Arm Cortex-M cores.
7  - Uniform workflows and experience for application developers.
8
9 Following CMSIS-Core Device Files are defined:
10  - \subpage system_c_pg
11  - \subpage device_h_pg
12  - \subpage startup_c_pg
13  - \subpage linker_sct_pg
14 \if ARMv8M
15  - \subpage partition_h_pg
16  - \subpage partition_gen_h_pg
17 \endif
18
19 \ref cmsis_files_dfps explains how to distribute \ref cmsis_device_files in CMSIS-Pack format.
20
21 ## Device Template Files {#cmsis_template_files}
22
23 CMSIS-Core includes the template files that simplify the creation of CMSIS-Core Device Files for a specific device variant.
24
25 Silicon vendors typically need to add to these template files the following information:
26  - **Device Peripheral Access Layer** that provides definitions for device-specific peripherals.
27  - **Access Functions for Peripherals** (optional) that provides additional helper functions to access device-specific peripherals.
28  - **Interrupt vectors** in the startup file that are device specific.
29
30 Template File                       | Description
31 :-----------------------------------|:----------------------------------------
32 📂 CMSIS/Core/Template/Device_M     | Folder with CMSIS-Core device file templates ([See on GitHub](https://github.com/ARM-software/CMSIS_6/blob/main/CMSIS/Core/Template/Device_M/))
33  â”£ ðŸ“‚ Config                        | Template configuration files
34     â”£ ðŸ“„ Device_ac6.sct   | \ref linker_sct_pg template
35     â”£ ðŸ“„ Device_gcc.ld    | Linker description file for GNU GCC Arm Embedded Compiler
36     â”— ðŸ“„ partition_Device.h |\ref partition_h_pg template
37  â”£ ðŸ“‚ Include                       | Template header files
38     â”£ ðŸ“„ Device.h         | \ref device_h_pg template
39     â”— ðŸ“„ system_Device.h  | \ref system_Device_sec
40  â”— ðŸ“‚ Source                        | Template C files
41     â”£ ðŸ“„ startup_Device.c | \ref startup_c_pg template
42     â”— ðŸ“„ system_Device.c  | \ref system_Device_sec
43
44 **Adapt Template Files to a Device**
45
46 Each template file contains comments that start with **ToDo:** and describe required modifications.
47
48 The templates contain several placeholders that need to be replaced when creating CMSIS-Core device files:
49
50 Placeholder                | To be replaced with
51 :--------------------------|:----------------------------------------
52 `<Device>`                 | The specific device name or device family name, for example `LPC17xx`
53 `<DeviceInterrupt>`        | The specific interrupt name of the device, for example `TIM1` for Timer 1 interrupt
54 `<DeviceAbbreviation>`     | Short name or abbreviation of the device family, for example `LPC`
55 `Cortex-M#`                | The specific Cortex-M processor name, for example `Cortex-M3`
56
57 Device files for the \ref device_examples can be also a good reference point for implementing CMSIS-Core support for specific devices.