Home

Awesome

Create a Device Family Pack - Hands-On Example

This repository explains the structure of a Device Family Pack (DFP) for Open-CMSIS-Pack based projects. It also describes the steps to create a DFP based on an example pack.

A Board Support Pack (BSP) complements a DFP with board support. While it is possible to deliver both (DFP and BSP) as a single pack, it is common practice to separate it.

Content

Benefits of Packs to deliver device and board support

To learn more review the session about Generating CMSIS-Packs for Devices and Boards.

DFP Content

Optional pack content that improves the overall usability:

Example DFP

This repository contains a example DFP of a fictional device family called ACMECM4 from the imaginary device vendor ACME. The device family consists of four members that are separated into two sub-families. The specification of the MVCM3 family is as follows:

<table> <tr> <td colspan="4"><strong>ACME ACMECM4XXX</strong></td> </tr> <tr> <td colspan="4">The ACMECM4 device family is based on the Arm Cortex-M4 processor with a set of on-chip peripherals.</td> </tr> <tr> <td colspan="2">Processor</td> <td colspan="2">Arm Cortex-M4 (r0p1), little-endian</td> </tr> <tr> <td colspan="2">MPU</td> <td colspan="2">Yes</td> </tr> <tr> <td colspan="2">FPU</td> <td colspan="2">Yes</td> </tr> <tr> <td colspan="2">External interrupts</td> <td colspan="2">16</td> </tr> <tr> <td colspan="2">Operating temperature range</td> <td colspan="2">-40 degC ~ +105 degC</td> </tr> <tr> <td colspan="2">Operating voltage</td> <td colspan="2">+2.5 V ~ 3.6 V</td> </tr> <tr> <td colspan="2">Real-time clock</td> <td colspan="2">32.768 kHz</td> </tr> <tr> <td colspan="2">Watchdog timer</td> <td colspan="2">1</td> </tr> <tr> <td colspan="2"><strong>ACMECM4100</strong></td> <td colspan="2"><strong>ACMECM4200</strong></td> </tr> <tr> <td colspan="2">The ACMECM4100 sub-family runs up to 50 MHz</td> <td colspan="2">The ACMECM4100 sub-family runs up to 100 MHz</td> </tr> <tr> <td>I/Os</td> <td>26</td> <td>I/Os</td> <td>38</td> </tr> <tr> <td>USART</td> <td>4</td> <td>USART</td> <td>5</td> </tr> <tr> <td>Timer/counter</td> <td>6 x 32-bit</td> <td>Timer/counter</td> <td>8 x 32-bit</td> </tr> <tr> <td colspan="2"></td> <td>PWM</td> <td>4 x 16-bit</td> </tr> <tr> <td>Package</td> <td>32-pin LQFP</td> <td>Package</td> <td>48-pin LQFP</td> </tr> <tr> <td colspan="2"><strong>Features ACMECM4110</strong></td> <td colspan="2"><strong>Features ACMECM4250</strong></td> </tr> <tr> <td>RAM</td> <td>2 kB SRAM</td> <td>RAM</td> <td>2 kB SRAM</td> </tr> <tr> <td>Flash</td> <td>16 kB</td> <td>Flash</td> <td>16 kB</td> </tr> <tr> <td>PWM</td> <td>2 x 16-bit</td> <td colspan="2"></td> </tr> <tr> <td colspan="2"><strong>Features ACMECM4120</strong></td> <td colspan="2"><strong>Features ACMECM4260</strong></td> </tr> <tr> <td>RAM</td> <td>4 kB SRAM</td> <td>RAM</td> <td>4 kB SRAM</td> </tr> <tr> <td>Flash</td> <td>32 kB</td> <td>Flash</td> <td>32 kB</td> </tr> <tr> <td>PWM</td> <td>4 x 16-bit</td> <td colspan="2"></td> </tr> </table>

The DFP includes the following components that are described in the PDSC file:

The pack is generated used the following scripts and workflows:

ContentDescription
gen_pack.shScript that builds the pack; refer to usage information for configuration details.
.github/workflows/pack.yamlGitHub workflow that generates the pack on every commit.

Pack Development

This repository may be used to kick start the development of a pack. The following section explains how to create a pack.

Tool-Environment (Recommended)

Steps to Create a Device Family Pack

Local Pack Development

  1. Clone this repository (as it serves as a getting started example)

  2. Register this pack with cpackget via PDSC file using this commands:

    cpackget update-index                // optional to ensure that pack index is up-to-date
    cpackget add ACME.ACMECM4_DFP.pdsc   // pack now appears in toolchains, i.e. in MDK
    csolution list packs
    
  3. The content of the pack can now be seen in the Manage Component dialog of uVision.

For changing the PDSC file it is recommended to use VS Code with XML extension, but any editor would work.

After modifications to the PDSC file run packchk; include all packs that are required by your software in the validation:

Using Command Prompt:

packchk ACME.ACMECM4_DFP.pdsc -i %CMSIS_PACK_ROOT%/ARM/CMSIS/5.9.0/ARM.CMSIS.pdsc

Using Git Bash console:

packchk ACME.ACMECM4_DFP.pdsc -i $CMSIS_PACK_ROOT/ARM/CMSIS/5.9.0/ARM.CMSIS.pdsc

With CMSIS-Toolbox v1.7.0 the XML schema check is available with packchk, the command may be then extended to:

packchk ACME.ACMECM4_DFP.pdsc -i $CMSIS_PACK_ROOT/ARM/CMSIS/5.9.0/ARM.CMSIS.pdsc -s /c/Keil_v5/UV4/PACK.xsd

The pack can be created locally in the directory output using Git Bash:

./gen_pack.sh -v

Verify Pack in Tools

To verify the tools such as the VS Code - Keil Studio Desktop extension, install the pack with:

cpackget add ./output/ACME.ACMECM4_DFP.1.0.0.pack

Notes:

  <releases>
    <release version="1.0.1-rc0">
      Further development
    </release>
    <release version="1.0.0" date="2023-04-22">
      Initial version
    </release>
  </releases>

Pack Creation on GitHub

Once changes are committed the GitHub Action creates the pack.

Publish Pack

The pack can be hosted on the <url> specified in the *.pdsc file.

Refer to Publish a Pack in the Open-CMSIS-Pack specification for further details.

Issues and Questions

Use Issues on this GitHub to raise questions or submit problems.

Happy Packing!