CMSIS-Pack
Version 1.6.1
Delivery Mechanism for Software Packs
|
The CMSIS-Pack format is used to deliver a software package and is aimed to be scalable for future requirements. It provides a management process and supports a tool independent distribution for:
A software component encapsulates a set of related functions. Software components can contain C/C++ source files, object code, assembler files, header files, or libraries. The interfaces of software components should be defined with APIheaders" to make them substitutable by other compatible components at design time. In addition, CMSIS software components should contain documentation for the software component. They may provide user code templates that give a starting point for the application developer, and can have optional debug view descriptions for debuggers.
CMSIS software components can also refer to multiple interfaces of other software components. This could be also a hardware abstraction layer for a device peripheral.
Configuration files contain application specific parameters for a software component. These files are typically copied to the user project workspace; all other files are not modified by the user and can remain in a separate location which avoids that a project workspace is polluted by many source files that should be considered as “black-box” elements by the application programmer.
A component lists the files that belong to it and that are relevant for a project. The component itself or each individual file may refer to a condition that must resolve to true; if it is false, the component or file is not applicable in the given context.
Each software component must have the following attributes that are used to identify the component:
Cclass
): A component class which is a top-level component name, for example CMSIS, Device, File System Cgroup
): A component group name, for example CMSIS:RTOS, Device:Startup, File System:CORE Cversion
): the version number of the software component.Optionally, a software component may have additional attributes:
Csub
): A component sub-group that is used when multiple compatible implementations of a component are be available. For example CMSIS:RTOS:MyRTOS, Device:Driver USBD:Full-speed Cvariant
): A variant of the software component is typically used when the same implementation has multiple top-level configurations, like debug and release.Cvendor
): the supplier of the software component.The Cclass
, Cgroup
, Csub
, Cvariant
and Cversion
attributes are used together with the vendor specified by the pack to identify a component. A component vendor must ensure that the combination Cclass
, Cgroup
, Csub
and Cversion
is unique and not used by multiple components within the same Pack. Advertise a set of attributes to be used by other software components using the /package/taxonomy element.
For a list of established Cclasses, refer to Software Component Cclasses.
In case multiple interdependent components (belonging to the same Cclass
) form part of a solution, these can be grouped in a so called bundle.
Use the following syntax to reference to software components and APIs:
<Vendor>::<Cclass>:<Cgroup>:<Csub>
Examples:
Here is an example for the display of software components in a development tool:
Each software component consists of a certain number of files. Each file has at least the following attributes:
name:
File path, file name, and file extension in the format path/name.extension. The file path is relative to the root directory of the Pack.category:
Defines the purpose of the file. Select the predefined value as listed in the table File Categories.Optionally, every file may have the following attributes:
attr:
Defines the special use and handling of a file. Select a predefined value as defined in the table File Attributes.condition:
Enter the identifier (attribute id) of a condition. The element is used if the condition resolves to true.select:
Brief description and purpose of the file. The select attribute is required when attr is set to template or interface. When multiple template files of a component have the same select string, they are treated as a single selectable template. This way, multiple template or interface files can be bundled.src:
Path information. The path is specified relative to the Pack Description File (PDSC).version:
File-specific version information. This is used particularly for files copied into the project workspace. Before a file gets copied, a version check avoids unnecessary copy actions. If a file does not have a version, then the component version is used.Software components can reference other software components (either within the same pack or in other packs) using conditions:
A condition describes dependencies on:
Conditions can be used to ensure that specific software components are either present in the system or can prevent that illegal combinations of software components are chosen by the user.
Conditions are used to define AND/OR rules that make components conditional and therefore only available under certain circumstances, for example for specific devices or processors. Conditions are also used to express dependencies between software components.
Each condition has an id that is unique within the scope of a the PDSC file. An id can be referenced in the condition
attribute of components, APIs, examples, files and other conditions. All attributes set in a accept, require, or deny element must resolve to true for the element to become true. A condition becomes true when:
If a condition resolves to false during processing, the respective element will be ignored.
Packs can require other packs to be available (and can even ask for a specific version of a pack):
There are three different requirement types:
packages
section lists CMSIS Packs that have been used to configure the project. This includes the specification of a version range to ensure compatibility. If no version is provided, the latest installed version is used. If not yet installed, the latest available version will be installed before resolving the configuration.compilers
section specifies the toolchains that are supported by this example. The required compiler version is specified using the version element. If no compiler is specified, it is assumed that any toolchain will work.languages
section allows to specify requirements regarding the programming language, for example C99 standard. If no language requirements are set, ANSI C is assumed.The CMSIS-Pack system allows a central API definition that shares header file information and documentation of an API interface.
This single API interface definition ensures consistency when it is used across multiple implementations that consume the interface. The API interface definition can be distributed separately or as part of the software component that consumes this interface.
An example is the CMSIS-Driver pack that contains various hardware interface drivers that all compatible with the CMSIS-Driver APIs (that are published in the CMSIS Pack).
Frequently, the behavior or features of a software component depend on the presence of other software components in the application. For example, a network stack can interface to Ethernet or serial PPP (UART). Depending on the presence of interface components, the implementation may behave differently.
To simplify application configuration, the file RTE_Components.h is generated before the project build step. It contains the inventory of all selected components. For each selected software component, it contains #define statements that are specified by the component meta data. The following example shows an RTE_Components.h file:
Use this information in other header files to control features that depend on the inclusion to other software components. For example:
When using software components, you can use the conditions to automatically resolve dependencies on other components. Use this to combine components for a project in a certain way, while combining them differently for another project. In the following example, a network stack transfers data via Ethernet. The network stack requires a MAC and PHY to do this. The selected device from silicon vendor A that contains an on-chip MAC, thus only requiring a PHY to be selected:
You can copy the project, select a different device from silicon vendor B for example and let the run-time environment manager do the exchange of the components. As the new devices do not have an on-chip MAC, you need to select a different component to fulfill the requirement for the network stack:
This reduces the development time drastically, as the developer does not need to care for the correct dependency between software components, but can concentrate on the implementation of his own application code.
The following image shows the basic steps that are required to create a Software Pack:
The following pages will show how to create a Software Pack from scratch. The page Pack with Software Components will start with a simple Pack containing only the PDSC file and a single software component and will then explain further elements of a Pack in more detail. The page Pack with Device Support adds information on the additional requirements that a DFP has, while Pack with Board Support will elaborate on the content specific to a BSP.
The ARM::CMSIS Pack contains tutorials that are explained on the following pages. In the \CMSIS\Pack\Tutorials directory the following three ZIP files are available:
ZIP File | Documentation |
---|---|
Pack_with_Software_Components.zip | Pack with Software Components |
Pack_with_Device_Support.zip | Pack with Device Support |
Pack_with_Board_Support.zip | Pack with Board Support |
A Software Pack is a collection of files located in directories that are archived in a file with the extension *.pack using the standard ZIP file format. The Pack Description file (PDSC) with the file extension *.pdsc contains the meta information, describing the content of a pack based on XML. The PDSC file must be:
A Software Pack must have a unique filename. Therefore it is constructed from vendor, packname and version and the file extension *.pack.
<vendor>.<name>.<version>.pack.
Where:
If you add a software component in the PDSC file, you have to specify a component class (CClass), component group (Cgroup), and the component's version number (Cversion). For more information refer to Software Components.
If applicable, try to map the Cclass of your software component to one of the following predefined or already well established classes listed below. These Cclass names are pre-defined in the CMSIS pack using the taxonomy element.
Cclass | Description |
---|---|
Audio | Software components for audio processing |
Board Support | Generic interfaces for evaluation and development boards |
Board Part * | Drivers that support an external component available on an evaluation board |
CMSIS | Cortex Microcontroller Software Interface Standard components |
CMSIS Driver | Unified device drivers compliant to the CMSIS-Driver specification |
Compiler | Arm Compiler software extensions |
Data Exchange | Data exchange components or data formatter, for example JSON |
Device | Startup and system setup components |
Extension Board * | Drivers that support an extension boards or shield |
File System* | File drive support and file system |
Graphics* | Graphical libraries for user interfaces |
IoT Client | IoT cloud client connectors |
IoT Service | IoT specific services, i.e. device on-boarding |
IoT Utility | IoT specific utilities, i.e. a socket interface |
Network* | Network stack using Internet protocols |
RTOS* | Real-time operating systems |
Security* | Encryption for secure communication or storage |
USB* | Universal Serial Bus stack |
Utility | Generic software utility components |
Classes with a * should always be used together with a bundle to avoid conflicts with other software components.
If you wish to standardize a new Cclass, please send an inquiry to cmsis or raise an issue on the public @arm .comCMSIS GitHub development repository.