Open-CMSIS-Pack  Version 1.7.45
Delivery Mechanism for Software Packs
Publish a CMSIS-Pack

Before you start distributing a software pack, make sure that it does not contain errors. Use the tools described in the Checking CMSIS-Packs section for verification. Once you have validated that the PDSC file and the pack contain no errors, you have basically two options for distributing a software pack:

The following sections assume that you are familiar with the CMSIS-Toolbox and especially with cpackget.

Checking CMSIS-Packs

Software packs are ZIP files that contain a PDSC file and other content. The ZIP file needs to be consistent and the PDSC file within has to be validated against the XML schema file (PACK.xsd). An open-source checking tool is available that helps you with both tasks: a Bash library for gen-pack scripts. Make sure that you have used it to validate your PDSC file and the pack contents before submitting it to any pack indexing service. The library can be used on all major host operating systems and can also be run in GitHub actions.

Local installation

The easiest way to distribute a software pack is attaching it to an email or using other means of electronic distribution (for example using a file server). Install the software pack on a PC using cpackget, the pack management tool that comes with the CMSIS-Toolbox:

cpackget add vendor.packname.version.pack

If the PDSC file does not contain a valid <url> element, a manual installation is required to update a software pack. Otherwise, cpackget can check for updates on the server or the local machine that is specified by <url>.

Note
For automatic updates on a local machine, specify the <url> using the file URI scheme.

Web download

If you want to make your packs publicly available, you need to host them on the web. For publishing packs, these options are available:

The following diagram shows how you can publish your packs when using a pack indexing service:

Pack hosting and indexing service

When you run the command cpackget update-index, the tool queries the package index file (index.pidx) from the pack index server. This file is generated using the vidx2pidx tool from the vendor index file (index.vidx) which points to all known <vendor>.pidx and stand-alone PDSC files.

The PIDX file allows you to change pack versions and add packs to your distribution list. All packs that are referenced in the PIDX file will be processed and validated. Only error-free packs will become available via web pages and development tools.

Note
Refer to the Using a pack index service section for more information how to get listed on such an indexing server.

Self-hosted packs

Any web server can be used to host a software pack (specified by the <url> element in the PDSC file). At this location, the following files should be present:

  1. <vendor>.<name>.pdsc [required]: pack description file.
  2. <vendor>.<name>.<version>.pack [required]: pack file where <version> refers to the latest version specified in the PDSC file.
  3. <vendor>.pidx [optional]: list with all packs hosted and maintained by the vendor (refer to Package index file (PIDX))

All previous versions listed in the <releases> section of the PDSC file should be present at the <url> as well. This allows users to revert updates or to download a previous version of a software pack (for maintenance purposes).

The <vendor>.pidx allows you to publish multiple packs to a Pack Index Service at once.

Note
  • The <url> element in <vendor>.<name>.pdsc is the location where these services check for new packs. At this <url> location, an (unversioned) <vendor>.<name>.pdsc file and a (versioned) <vendor>.<name>.<version>.pack must be available.
  • The <url> is the page where the pack is downloaded. This means, if the URL or the PDSC/pack files become unavailable, users are unable to download the pack.
  • When a new PDSC/pack file is available, it is important to update the version number, otherwise the Pack Index Service will not recognize that the pack has changed.
  • Previous versions of a (versioned) <vendor>.<name>.<version>.pack should remain available.

GitHub-hosted packs

If you develop your packs publicly on GitHub, you can use the infrastructure to host your packs. The recommended way to do this is as follows (note that in this example, <orgname> is equal to <vendor> in the other examples. We use <orgname> here as this is the nomenclature on GitHub):

  • Create a repository for the PIDX file, for example github.com/orgname/indexrepo. The PIDX file should be named <orgname>.pidx.
  • Create seperate repositories for each pack, for example:
    • github.com/orgname/name1
    • github.com/orgname/name2
  • At the top-level of each repository's main branch, you need have a <orgname>.<nameX>.pdsc file.
  • Once you publish a pack, attach the <orgname>.<nameX>.<version>.pack file to the release assets - this will be used as the download location of the pack.

This diagram shows an exemplary set up on GitHub with pack versions 1.0.0 and 1.3.0:

Hosting packs on GitHub

PIDX file on GitHub

The vendor (orgname) PIDX file would look like the following:

<?xml version="1.0" encoding="UTF-8" ?>
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>orgname</vendor>
<url>https://github.com/orgname/indexrepo/raw/main/</url>
<timestamp>2024-08-22T15:00:10.7300074+00:00</timestamp>
<pindex>
<pdsc url="https://github.com/orgname/name1/raw/main/" vendor=”orgname" name=”name1" version="1.0.0"/>
<pdsc url="https://github.com/orgname/name2/raw/main/" vendor=”orgname" name=”name2" version="1.0.0"/>
</pindex>
</index>
Note
When updating one of the packs, you only need to change the version number and update the timestamp. All other entries remain the same. Please make sure that only release quality packs are made available using this mechanism. You can build local releases of a pack anytime for testing purposes.

PDSC file on GitHub

A PDSC file for one of the repositories would look like this:

<?xml version="1.0" encoding="utf-8"?>
<package schemaVersion="1.7.7" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
<vendor>orgname</vendor>
<name>name1</name>
<license>LICENSE</license>
<description>Whatever Pack</description>
<url>https://github.com/orgname/name1/raw/main/</url>
<supportContact>info@orgname.com</supportContact>
<repository type="git">https://github.com/orgname/name1.git</repository>
<releases>
<release version="1.0.0" tag="v1.0.0" date="2024-08-22" url="https://github.com/orgname/name1/releases/download/v1.0.0/orgname.name1.1.0.0.pack">Initial release</release>
</releases>

When updating a pack, you need to:

  • Change the <url> to the location of the latest pack file in the PDSC.
  • Add a new <release> version with the correct entries in the PDSC.
  • Attach the pack file to the release assets.
  • Update the PIDX file with the latest version information.
Note
While the repository's main branch can be used to host the PDSC file, additional confidence against unwanted changes can be made if you use a dedicated branch for hosting the PDSC file. This avoids breaking unintentionally the pack location when accepting a pull request (PR).

Using a pack index service

Tool, software, or silicon vendors may provide a web infra-structure that lists packs that are available from multiple vendors. Companies like Arm or IAR provide such a service for making CMSIS-Packs available to a wider audience of developers. The packs are then found by pack management tools and their contents are listed on web sites, such as Arm's list of CMSIS-Packs.

Once you are ready to publish your packs, please send the URL of the <vendor>.<name>.pdsc or <vendor>.pidx file to the following email addresses:

Arm uses the pack information to generate a list of available software packs. The following content will be processed in order to generate the web site (https://www.keil.arm.com/packs/):

  • Version
  • Release notes
  • Devices
  • Boards
  • Examples
  • Software components
  • Description
  • An Overview.md file if present

Furthermore, the data is used to create lists of boards and devices.

Please allow up to seven working days for the process. If the files contain any errors, you will be notified. Otherwise, the information is added to the index server. We strongly recommend using a Package index file (PIDX) for better maintainability.

The vidx2pidx conversion tool

If you want to check the content of you Package index file (PIDX), you can use the vidx2pidx utility to create your own index.pidx file. Once created, you can use it with cpackget to install the packs listed in the PIDX file.

Follow these steps to run the conversion and installatin:

  • Download vidx2pidx.
  • Create you <vendor>.vidx file just listing the <vendor.pidx> file. Code example

    <index schemaVersion="1.0" xmlns:xs=http://www.w3.org/2001/XMLSchema-instance xs:noNamespaceSchemaLocation="PackIndex.xsd">
    <vendor>vendor</vendor>
    <url></url>
    <timestamp>2024-08-08T06:30:00</timestamp>
    <vindex>
    <pidx vendor="vendor" url="https://github.com/vendor/packrepo/raw/main/"/>
    </vindex>
    </index>
  • Run
    vidx2pidx vendor.vidx
    to create the index.pidx.
  • Run
    cpackget init -R packroot index.pidx
    to create a new pack root directory with only the packs from the index.pidx.
  • Run
    cpackget list -p -R packroot
    to show all packs and check if the process was successful.
  • Install all listed packs using
    cpackget add <packID> -R packroot
    to check if all packs can be downloaded and installed.

Rehosting a pack

Sometimes, it is necessary to rehost a pack (moving a pack from one URL to another). Rehosting implies changing the <url> element in the PDSC file. To ensure that the pack is found by a Pack Index Service, follow this procedure:

  • Create a new version of the pack: update the <vendor>.<name>.pdsc file with the new <url> ("url_B") and a new <release> tag with an incremented version.
  • Place a copy of this latest <vendor>.<name>.pdsc file at url_B and url_A (the original URL).
  • Add this new PDSC file to an updated <vendor>.<name>.<version>.pack (needs to match the version number in the PDSC file).
  • Copy the new <vendor>.<name>.<version>.pack only to url_B.
  • Copy all previous packs from url_A to url_B (so that they are available at the new location).
  • Inform Arm about the new URL by either:
    • updating the <vendor>.pidx with url_B for this pack or
    • emailing a link to the new PDSC file if your company does not maintain a <vendor>.pidx
Note
  • The PDSC file and all pack versions need to be accessible from the same new URL ("url_B").
  • Arm recommends to keep the url_A alive for at least six months so that users have time to pick up the change. Be aware that users who have not noticed the change might be unable to find pack updates once url_A have become unavailable.

Renaming a pack

Sometimes, it is necessary to rename a pack (because the pack vendor and/or its name have changed for example). To ensure that the pack is found by a Pack Index Service and the tools, follow this procedure:

  • Create a new:
    • PDSC file with the updated <name> and/or <vendor>, for example NewVendor.NewName.pdsc. The <version> should start at 1.0.0.
    • pack containing the new PDSC file with the corresponding <name> and/or <vendor>, for example NewVendor.NewName.1.0.0.pack.
  • Create a new:
    • version of the old PDSC file (Vendor.Name.pdsc) with a new <release> tag (with an updated version), containing the <deprecated> and <replacement> element. The latter pointing to the "NewVendor.NewName".
    • version of the old <vendor>.<name>.<version>.pack file with the PDSC you have created above.
  • Copy:
    • all four files (new PDSC and pack, updated old PDSC and pack) to the <url> location.
Note
  • Using this approach, you can only do a one-to-one pack replacement.
  • If you want to create more than one replacement pack for a given source pack, you need to work with requirements.

Pack index files

CMSIS-Pack is designed as a web-based distribution network. Each provider of a CMSIS-Pack (also referred to as vendor) is responsible for hosting, maintaining and publishing unique versions of a CMSIS-Pack.

A CMSIS-Pack is uniquely identified by <vendor>.<pack name>.<version>.pack. All published versions of a pack and the PDSC file need to be available in the same web folder specified by <url>. Multiple different packs may be located in the same web folder.

Package index file (PIDX)

The package index file lists all CMSIS-Packs hosted and maintained by a vendor. The file is hosted by the vendor and has the name <vendor>.pidx. The <vendor> tag needs to match the file name. The file also contains the <url> to it's origin, as well as a <timestamp> of it's last update.

It is the vendor's obligation to update this file whenever:

  • a new pack is added.
  • a new version of a pack is added.
  • a pack is deprecated.
  • a replacement for a pack becomes available.

MyVendor.pidx example

<?xml version="1.0" encoding="UTF-8" ?>
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>MyVendor</vendor>
<url>https://www.MyVendor.com/pack/</url>
<timestamp>2024-01-25T15:00:10.7300074+00:00</timestamp>
<pindex>
<pdsc url="https://www.MyVendor.com/pack/mypack/" vendor="MyVendor" name="MyPack" version="1.1.0"/>
...
</pindex>
</index>

Each individual pack is referenced by the attributes:

  • <url> = web folder where the PDSC and packs reside.
  • <vendor> = vendor of the pack.
  • <name> = the name of the pack.
  • <version> = the version number of the latest available release for the pack.

The package index file for the CMSIS-Pack compliant packs, hosted on www.keil.com can be found here: https://www.keil.com/pack/Keil.pidx.

The benefit of a single package index file is, that this file only needs to be exchanged once and can be polled for updates and additions of packs by a vendor. To add a vendor's packs to the public list maintained on www.keil.com, send an email to CMSIS@arm.com attaching a version of the <vendor>.pidx file.

Vendor index file (VIDX)

A vendor index file lists package index files from different vendors. This information can be used to compile a list of known packs.

MyVendor.vidx example

<?xml version="1.0" encoding="UTF-8" ?>
<index schemaVersion="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PackIndex.xsd">
<vendor>MyVendor</vendor>
<url>www.MyVendor.com/pack</url>
<timestamp>2024-01-08T10:30:00</timestamp>
<vindex>
<pidx url="http://www.othervendor.com/MyPacks/" vendor="OtherVendor" />
...
</vindex>
<!-- the section below is only intended for the transition until all vendors use the <vendor>.pidx file
<pindex>
<pdsc url="http://www.othervendor2.com/packs/" vendor="OtherVendor2" name="MyPack" version="2.3.0"/>
...
</pindex>
</index>

The latest index file of CMSIS-Packs belonging to vendor="ARM" and vendor="Keil" that are hosted and maintained here: https://www.keil.com/pack/Keil.pidx

Arm also maintains a flat list of all CMSIS-Pack compliant packs reported to Arm here: https://www.keil.com/pack/index.pidx

The vendor index file containing references to the package index files (or optionally PDSC files) used for compiling this summary index file are listed in the Keil.vidx file and can be downloaded from here: https://www.keil.com/pack/Keil.vidx

Based on these publicly available index files, everyone is equally positioned to create an index of available packs and their latest versions.

Index schema file

<?xml version="1.0" encoding="UTF-8"?>
<!--

  Copyright (c) 2013-2023 ARM Limited. All rights reserved.

  SPDX-License-Identifier: Apache-2.0

  Licensed under the Apache License, Version 2.0 (the License); you may
  not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an AS IS BASIS, WITHOUT
  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  $Date:        28. March 2023
  $Revision:    1.1.1

  $Project: Schema File for Package Index File Format Specification

  Package Index file naming convention <vendor>.pidx
  Vendor  Index file naming convention <vendor>.vidx
  SchemaVersion=1.1.1
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified" version="1.1.1">

  <!-- semantic versioning (semver.org) <major>.<minor>.<patch>-<quality> -->
  <xs:simpleType name="SemanticVersionType">
    <xs:restriction  base="xs:string">
      <!--                major . minor . patch [[-]quality] [+build] -->
      <xs:pattern value="[0-9]+\.[0-9]+\.[0-9]+(\-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?" />
    </xs:restriction>
  </xs:simpleType>

  <!-- some strings are used to construct filenames (e.g. package name). Such names can contain only subset of characters and must not contain neither spaces nor dots. -->
  <xs:simpleType name="RestrictedString">
    <xs:restriction base="xs:string">
      <xs:pattern value="[\-_A-Za-z0-9]+"/>
      <xs:pattern value="\S(.*\S)?"></xs:pattern>
    </xs:restriction>
  </xs:simpleType>

  <!-- Vendor index file Description Type -->
  <xs:complexType name="VidxType">
    <xs:attribute name="url"             type="xs:anyURI"           use="required"/>
    <xs:attribute name="vendor"          type="RestrictedString"    use="required"/>
    <xs:attribute name="date"            type="xs:date"             use="optional"/>
  </xs:complexType>

  <!-- Package Description Type -->
  <xs:complexType name="PdscType">
    <xs:attribute name="url"             type="xs:anyURI"           use="required"/>
    <xs:attribute name="vendor"          type="RestrictedString"    use="required"/>
    <xs:attribute name="name"            type="RestrictedString"    use="required"/>
    <xs:attribute name="version"         type="SemanticVersionType" use="required"/>
    <xs:attribute name="date"            type="xs:date"             use="optional"/>
    <xs:attribute name="deprecated"      type="xs:date"             use="optional"/>
    <xs:attribute name="replacement"     type="RestrictedString"    use="optional"/>
    <xs:attribute name="size"            type="xs:unsignedInt"      use="optional"/>
  </xs:complexType>

  <!-- Package Description file Type -->
  <xs:complexType name="PindexType">
    <xs:sequence>
      <xs:element name="pdsc"            type="PdscType"            maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Vendor vendor's package index file tag -->
  <xs:complexType name="VindexType">
    <xs:sequence>
      <xs:element name="pidx"            type="VidxType"            maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Index description root point (Vendor Index file, Package Index file -->
  <xs:element name="index" nillable="true">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="vendor"        type="RestrictedString"/>
        <xs:element name="url"           type="xs:anyURI"/>
        <xs:element name="timestamp"     type="xs:dateTime"         minOccurs="0"/>
        <xs:choice minOccurs="1" maxOccurs="2">
          <!-- index/list of packs -->
          <xs:element name="pindex"      type="PindexType"/>
          <!-- index/list of vendor index files -->
          <xs:element name="vindex"      type="VindexType"/>
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="schemaVersion" type="SemanticVersionType" use="required"/>
    </xs:complexType>
  </xs:element>
</xs:schema>