CMSIS-Pack: Pack with Board Support

| CMSIS-Pack Version 1.5.0 Delivery Mechanism for Software Packs

- Main Page
- Usage and Description

All Pages
Pack with Board Support

A Software Pack that contains a <board> element is called Board Support Pack (BSP). A BSP may contain additional Software Components, Example Projects, as well as Code Templates. The typical content of a BSP is:

- Source code, libraries, header/configuration files for the underlying hardware and documentation (for example user manuals, getting started guides, and schematics).
- Example Projects that show the usage of the development board and its peripherals.
- User Code Templates that can be used as a starting point for using the development board or the mounted device.

This section is a tutorial that explains how to create a BSP. Initially the PDSC file in the BSP only describes an evaluation board. This BSP is then extended to contain also software components that interface with the hardware of the board. Example projects and code templates may be added as described in the section Pack with Software Components.

## BSP Use Cases

A BSP is typically provided by a Board Vendor and is used to extend development tools with support for development boards. In general, the BSP enables Board Vendors to distribute tool independent board support for their development platforms.
BSPs can also be used to provide information for the display on web sites. One example is the new boards page on www.keil.com/boards2/:

Board information on a web site extracted from a BSP

# Specify a Development Board

Preparations

1. Install the Software Pack Keil::ARMCortex_DFP as this will be required for the BSP to function properly.
2. Create a working directory on your PC, for example C:\temp\working_bsp.
3. Go to the directory \CMSIS\Pack\Tutorials available in the ARM::CMSIS Pack installation. Please consult your development tool's documentation for more information on the Pack installation directory structure. In a standard µVision installation, you will find it below C:\Keil_v5\ARM\Pack\ARM\CMSIS\version.
4. Open the file Pack_with_Board_Support.zip.
5. Copy the content of the ZIP file's 01_Specify_Dev_Board directory into your working directory.
6. Make sure that files/directories are not write protected (remove read-only flag).
7. Copy from the directory \CMSIS\Utilities available in the ARM::CMSIS Pack installation the following files into your working directory:
   - packChk.exe
   - PACK.xsd
8. Open the MyVendor.MyBSP.pdsc file in an editor.

Code Example

1. Add a <boards> section in the PDSC file with the following:
   <boards>
   <board vendor="MyVendor" name="MyDevBoard" revision="V1" salesContact="sales@keil.com" orderForm="http://www.keil.com">
   <description>MyVendor MyDevBoard Board Description</description>
   <image small="Images/MyDevBoard_small.png" large="Images/MyDevBoard_large.png"/>
   <book category="setup" name="Docs/MyDevBoard/MyDevBoard_setup.pdf" title="Getting Started"/>
   <book category="schematic" name="Docs/MyDevBoard/MyDevBoard_schematics.pdf" title="Schematics"/>
   <book category="manual" name="Docs/MyDevBoard/MyDevBoard_um.pdf" title="User Manual"/>
   <mountedDevice deviceIndex="0" Dvendor="ARM:82" Dname="ARMCM3"/>
   <compatibleDevice deviceIndex="0" Dvendor="ARM:82" Dfamily="ARM Cortex M3"/>
   <feature type="ODbg" n="1" name="On-board J-LINK Lite"/>
   <feature type="PWR" n="5" name="USB Powered"/>
   <feature type="DIO" n="8"/>
   <feature type="SPI" n="1"/>
   <feature type="LED" n="6" name="User LEDs"/>
   <feature type="ArduinoFF" n="1"/>
   <debugInterface adapter="J-Link Lite" connector="Mini-USB"/>
   </board>
   </boards>
   Note
     All code examples in this and the following sections can be found in the `snippets.xml` file in the 01_Specify_Dev_Board directory.

2. Finally, save the PDSC file and generate the Pack file using the gen_pack.bat script. See Generate a Pack for further details. Afterwards, install the Pack in your development tool.

   Display of development boards in development tools

Note
  packChk.exe will display M346 informations:

      *** WARNING M346: .\Files\MyVendor.MyBSP.pdsc (Line 29)
        Referenced device(s) in 'MyDevBoard' not found: 'ARMCM3'

      *** WARNING M346: .\Files\MyVendor.MyBSP.pdsc (Line 29)
        Referenced device(s) in 'MyDevBoard' not found: 'ARM Cortex M3'

  This is because this BSP does not contain a device section with the mentioned devices. To work aroung this problem, you might add the ARM:CMSIS PDSC file to the checking process.

# Create a BSP Bundle

A bundle is basically a variant on the `Cclass` level. It specifies the attributes `Cclass`, `Cversion` and optionally `Cgroup` and `Cvendor` for a collection of interdependent components. Components within a bundle inherit the attributes set by the bundle and must not set these attributes again. Bundles ensure consistency of attributes across multiple interworking components and restrict the mix and match of components within a `Cclass` from different solutions. In addition to components, a bundle has the mandatory elements `description` and `doc` (for documentation).

Copy the content of the 02_BSP_Bundle directory of the Pack_with_Board_Support.zip file to the Files directory in your working environment:

1. Add a `<conditions>` section in your PDSC with the following (the conditions section provides more information on this step):
   <condition id="ARM Cortex M3 Series">
   <description>ARM Cortex M3 device required</description>
   <require Dfamily="ARM Cortex M3" Dvendor="ARM:82"/>
   </condition>
   <condition id="MyDevBoard Board Setup">
   <description>Board Setup Code required</description>
   <require condition="ARM Cortex M3 Series"/>
   <require Cclass="Board Support" Cgroup="Board Setup"/>
   </condition>
2. Add a `<components>` section in your PDSC with the following (the components section provides more information on this step):
   <bundle Cbundle="MyDevBoardSupport" Cclass="Board Support" Cversion="1.0.1">
   <description>MyDevBoard custom board support package</description>
   <doc>Docs/BSP/MyBSP.htm</doc>
   <component Cgroup="Board Setup" condition="ARM Cortex M3 Series">
   <description>Custom board setup code</description>
   <files>
   <file category="doc" name="Docs/BSP/Setup.htm"/>
   <file category="header" name="MySWComp/Include/setup.h"/>
   <file category="source" name="MySWComp/Source/setup.c"/>
   </files>
   </component>
   <component Cgroup="I/O" Csub="LED" condition="MyDevBoard Board Setup">
   <description>LED code for custom board</description>
   <files>
   <file category="doc" name="Docs/BSP/LED.htm"/>
   <file category="header" name="MySWComp/Include/led.h"/>
   <file category="header" name="MySWComp/Include/config_led.h" attr="config" version="1.0.0"/>
   <file category="source" name="MySWComp/Source/led.c"/>
   </files>
   </component>
   <component Cgroup="I/O" Csub="GPIO" condition="MyDevBoard Board Setup">
   <description>GPIO code for custom board</description>
   <files>
   <file category="doc" name="Docs/BSP/GPIO.htm"/>
   <file category="header" name="MySWComp/Include/gpio.h"/>
   <file category="header" name="MySWComp/Include/config_gpio.h" attr="config" version="1.0.0"/>
   <file category="source" name="MySWComp/Source/gpio.c"/>
   </files>
   </component>
   </bundle>
3. Add a new version number:
   <release version="1.0.1">
   Board support bundle added
   </release>

4. Finally, save the PDSC file and regenerate the Pack file using the gen_pack.bat script. Afterwards, install the Pack in your development tool and observe the differences to version 1.0.0.

   BSP bundle display in development tools