Skip to content

Latest commit

 

History

History
 
 

packchk

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Pack Checking Tool

The utility packchk assists the validation of a CMSIS-Pack. It operates on the unzipped content of the Software Pack. It distributed as part of the CMSIS-Toolbox.

packchk performs the following operations:

  • Reads the content of the specified *.pdsc file. The path to this *.pdsc file is considered as root directory of the Software Pack.
  • Verifies the existence of all files in the Software Pack that are referenced in the *.pdsc file.
  • Checks for presence and correctness of mandatory elements such as <vendor>, <version>, etc. - Optionally, reads other PDSC files to resolve dependencies on <apis>, <boards>, and <conditions>.
  • Optionally, verifies the element <url>.
  • Optionally, composes the versioned pack ID from the information contained in the PDSC: package:vendor.package:name.release.latest:version
  • Sets the exit status reflecting the validation result to:
    • 0 : no errors detected
    • 1 : errors during validation detected

Usage

 packchk [-V] [--version] [-h] [--help]
          [OPTIONS...] <PDSC file>

 packchk options:
  -i, --include arg           PDSC file(s) as dependency reference
  -b, --log arg               Log file
  -x, --diag-suppress arg     Suppress Messages
  -s, --xsd arg               Specify PACK.xsd path.
  -v, --verbose               Verbose mode. Prints extra process information
  -w, --warning arg           Warning level [0|1|2|3|all] (default: all)
  -u, --url arg               Verifies that the specified URL matches with the <url>
                              element in the *.PDSC file (default: "")
  -n, --name arg              Text file for pack file name (default: "")
  -V, --version               Print version
  -h, --help                  Print usage
      --disable-validation    Disable the pdsc validation against the PACK.xsd
      --allow-suppress-error  Allow to suppress error messages
      --break                 Debug halt after start
      --ignore-other-pdsc     Ignores other PDSC files in working folder

Quick Start

This tutorial aims to get you up and running with packchk using CMake. We recommend this tutorial as a starting point. In order to build packchk and run related tests. Please employ the sequence of steps mentioned here.

Note: PackChkIntegTests makes use of test packs from test & data directory contains the example pack required for integration tests.

Usage Examples

Run packchk on the package description file called MyVendor.MyPack.pdsc. It verifies the file against the Software Pack that is located in the same directory.

packchk MyVendor.MyPack.pdsc

Run packchk on the package description file called MyVendor.MyPack.pdsc in the current directory and try to resolve conditions using the RefVendor.RefPack.pdsc file based in another directory.

packchk MyVendor.MyPack.pdsc -i /path/to/reference/pdsc/RefVendor.RefPack.pdsc

Run packchk on the package description file called MyVendor.MVCM3.pdsc, verify the URL to the Pack Server, and generate a ASCII text file with the standardized name of the Software Pack.

packchk "MyVendor.MVCM3.pdsc" -u "http://www.myvendor.com/pack" -n packname.txt

Run packchk on the package description file called MyVendor.MVCM3.pdsc. Suppress validation messages M304 and M331.

packchk MyVendor.MVCM3.pdsc --diag-suppress M304,M331   // messages as a list
packchk MyVendor.MVCM3.pdsc -x M304 -x M331             // option repeated

Error and Warning Messages

The following table explains the categories for the output messages issued by PackChk utility. Sections below list the errors and warnings and contain recommendations on how to resolve them.

Categories

Code Category Description
M0xx Info messages Help and Progress messages. No action required.
M1xx Internal errors Internal execution errors
M2xx Invocation Errors Errors in the command line input.
M3xx, M4xx Validation Messages Errors and Warnings from the pack validation.
M5xx Model Errors Errors in RTE model creation

Internal Errors

The errors in this category are issued because of an internal error in the packchk utility.

Message Number Type Description Details and Actions
M101 ERROR Unknown error! Contact Arm for clarifications
M103 ERROR Internal Error: 'REF' Contact Arm for clarifications
M104 ERROR Path empty when searching for other PDSC files Execute the check in verbose mode and try to identify the PDSC file intended for use. Correct the PDSC.
M108 TEXT Reading PDSC File failed! XML parsing of the PDSC file failed. Verify syntax of the PDSC file.
M109 TEXT Constructing Model failed! Contact Arm for clarifications
M110 TEXT Verifying Model failed Contact Arm for clarifications

Invocation Errors

The errors in this category are issued because of an incorrect command-line input that prevents the packchk execution.

Message Number Type Message Text Details and Actions
M202 ERROR No PDSC input file specified Correct the command line. packchk expects a *.pdsc file name as input.
M203 ERROR Error reading PDSC file 'PATH/FILENAME'! Verify the PDSC file for consistency.
M204 ERROR File not found: 'PATH' The specified PDSC file could not be found in the PATH displayed in the message. Correct the path or the filename.
M205 ERROR Cannot create Pack Name file 'PATH' Check the disk space or your permissions. Correct the path name.
M206 ERROR Multiple PDSC files found in package: 'FILES' Only one PDSC file is allowed in a package. Remove unnecessary PDSC files. The message lists all *.pdsc files found.
M207 ERROR PDSC file name mismatch! Expected: 'PDSC1.pdsc' Actual : 'PDSC2.pdsc' The PDSC file expected has not been found. Rename or exchange the PDSC file.
M210 ERROR Only one input file to be checked is allowed. You can only check one PDSC file at a time.
M218 ERROR Cannot find the schema file specified by "--xsd". CHeck whether the file exists.

Validation Messages

The messages in this category are issued by PackChk during package validation. This can be for example incorrect use of the pack schema in the PDSC file, missing files, broken dependencies and others. ERROR messages must be resolved to ensure that the package is compliant to the CMSIS-format. WARNING messages should be checked and are strongly recommended to be resolved.

Message Number Type Message Text Details and Actions
M301 ERROR Checking Pack URL of PDSC file failed: Expected URL : 'URL1' Package URL : 'URL2' The URL specified in the package does not match the value entered for comparison in option -u. Check for possible misspellings in both URLs. Refer to /package/url.
M302 ERROR No vendor tag found in the PDSC file! Add the <vendor> tag and provide the vendor name. For example: <vendor>Keil</vendor>. Vendor name is mandatory required in the package description but was not found in the /package element in the PDSC file. Within the parent <package> element enter the tag <vendor> and add the vendor name. For example: <vendor>Keil</vendor>. Refer to /package/vendor.
M303 ERROR No package name found in the PDSC file! Add the <name> tag and provide the package name. For example: <name>MCU-Name_DFP</name>. Package name is mandatory required in the package description but was not found in the /package element in the PDSC file. Within the parent <package> element enter the tag <name> and add the package name. For example <name>MCU-Name_DFP</name>. Refer to /package/name.
M304 WARNING No package URL (<url>-tag and/or value) found in PDSC file! Package URL is mandatory required in the package description but was not found in the /package element in the PDSC file. Within the parent <package> element enter the tag <url> and add the URL that should be used to download the package. Refer to /package/url.
M305 ERROR No releases (<release> elements in a <releases>-tag) found in PDSC file!" At least one package release shall be specified in the PDSC file, but none was not found. Use <release> tag to specify release information in <releases> element. Refer to /package/releases/release.
M306 ERROR No package description found in the PDSC file. Add the <description>-tag and provide a descriptive text. Package description is mandatory required in the package description but was not found in the /package element in the PDSC file. Within the parent <package> element add the tag <description> and briefly describe the package content. Refer to /package/description.
M307 ERROR Either attribute 'TAG' or 'TAG2' + 'TAG3' must be specified for 'memory' <memory> element requires that either attribute id or attributes name and access are specified, but none of those were found. Specify the expected attributes. Refer to /package/devices/family/.../memory.
M308 ERROR Attribute 'TAG' missing on 'TAG2' Element 'TAG2' requires attribute 'TAG', but it was not found. Add missing attribute.
M309 ERROR Attribute 'TAG' missing on 'TAG2' (when 'TAG3' is specified) Add missing attribute 'TAG' or remove the attribute 'TAG3' in the element 'TAG2'.
M310 ERROR Filename mismatch (case sensitive): PDSC name : 'PDSC_FILENAME' Filename : 'SYSTEM' Filenames are case sensitive. Correct spelling.
M311 ERROR Redefinition of 'TAG' : 'NAME', see Line 'LINE' Remove the redefinition of element 'TAG' with name 'NAME'.
M312 WARNING No 'TAG' found for device 'NAME' Element 'TAG' is missing for device 'NAME'. Add missing element.
M315 ERROR Invalid URL / Paths to Drives are not allowed in Package URL: 'URL' Correct package URL 'URL'. Refer to /package/url.
M316 WARNING URL must end with slash '/': 'URL' Correct package URL 'URL'. Refer to /package/url.
M323 ERROR File/Path not found: 'PATH' The file or path 'PATH' entered in the PDSC file could not be found. Verify the path information.
M324 WARNING Board referenced in Example 'EXAMPLE' is undefined: 'VENDOR' : 'BOARD' The definition of the board referenced in the example application could not be found. Define the board (/package/boards/board) or correct the reference information (/package/examples/example/board).
M325 ERROR Board 'NAME' redefined, already defined in Line 'LINE''PATH' This board has been defined already in the line 'LINE' of the file 'PATH'. Verify and remove one of the board definitions. Refer to /package/boards/board.
M326 ERROR Path is not conformant: 'PATH': Absolute Paths or Drive references are not allowed, use Paths relative to PDSC file. The path needs to be relative to the PDSC file so that a dependency of a certain file system does not occur.
M327 WARNING Path is not conformant: 'PATH': Backslashes are not recommended, use forward slashes. Paths to files should adhere to the POSIX standard using forward slashes (/).
M328 ERROR Version not set for Release Information 'DESCR' The release defined through the description 'DESCR' requires the attribute <version>. Refer to /package/releases/release.
M329 ERROR Description not set for Release Information 'VER' The release defined through the version 'VER' needs a description. Refer to /package/releases/release.
M330 ERROR Condition redefined: 'COND', already defined in Line 'LINE' The condition has been defined already in a previous line. Correct the condition name, or remove the duplicate. Refer to /package/conditions/condition.
M331 WARNING Condition unused: 'COND' The condition has been defined but not used further. Remove the condition or add condition rules. Refer to /package/conditions/condition.
M332 ERROR Condition undefined: 'COND' A condition has been used but not defined. Correct the name of the condition or define the missing condition. Refer to /package/conditions/condition.
M333 WARNING Component has no condition: Cclass= 'CCLASS', Cgroup= 'CGROUP'Csub='CSUB'Cversion= 'CVER' The component defined has no condition. If the component has restrictions, then add a condition to the component definition. Refer to /package/components/.../component.
M334 WARNING Config File has no version: 'PATH' Specified file 'PATH' does not contain version information. It is recommended to specify versions for configuration files. Add attribute version with the file version in the <file> tag that defines the 'PATH' file in the PDSC. Refer to /package/.../files/file.
M335 WARNING Component declared as 'Board Support' has no ref to a device: Cclass= 'CCLASS', Cgroup= 'CGROUP', Cversion= 'CVER' A component defined as 'board support' needs a reference to a device. Add a device or correct the component definition. Refer to attribute Cclass of /package/components/.../component and /package/boards/board/mountedDevice.
M336 WARNING No reference to a device or device not found: Cclass= 'CCLASS', Cgroup= 'CGROUP', Cversion= 'CVER' Define the device /package/devices/family/../device or correct the information about the device in the reference.
M337 WARNING File with category 'CAT' has wrong extension 'EXT''PATH' The extension of the file does not match the file category 'CAT' specified in the category attribute. Verify the extension to match the category. Refer to /package/.../files/file.
M338 WARNING No releases found. The PDSC file is missing release information. Add <release> information to the file. Refer to /package/releases element.
M339 WARNING Include Path 'PATH' must not be a file! The path specified contains a filename. Correct the path infomation and remove the filename. Refer to /package/.../files/file.
M340 WARNING Include Path 'PATH' must end with '/' or '\' Include paths must end with a slash or backslash. Verify and correct the path name. Refer to /package/.../files/file.
M341 WARNING File with 'COMP' dependency must have extension 'EXT' : 'PATH' The file 'PATH' with dependency on component 'COMP' must have a specific extension 'EXT'. Verify the dependency and correct the file extension. Refer to /package/.../files/file.
M342 WARNING File with attribute 'ATTR' must not have category 'CAT''PATH' File 'PATH' is defined with the attribute attr set to 'ATTR'. This conflicts with the file category 'CAT' specified in category attribute. For example attr=config and category=include are not allowed for the same file. Correct the file attribute or the file category. Refer to /package/.../files/file.
M343 WARNING File with attribute 'ATTR' requires 'ATTR2' attribute: 'PATH' File 'PATH' is defined with the attribute 'ATTR' that requires presense of attribute 'ATTR2' as well, but such attribute was not found. For example, attr=template requires that attribute select is defined. Add the required attribute 'ATTR2' or correct the attribute 'ATTR' in the <file> element. Refer to /package/.../files/file.
M344 WARNING File shall have condition containing 'COND''PATH' File definition for 'PATH' shall contain a condition 'COND'. Add attribute condition with the 'COND' in the <file> tag that defines the 'PATH' file. Refer to /package/.../files/file.
M345 WARNING URL not found : 'URL' The specified URL could not be found. Correct the URL. Refer to /package.
M346 WARNING Referenced device(s) in 'BOARD' not found: 'DEVICE' The device or devices specified for the board could not be found. Verify and correct the device name or the board name. Refer to /package/boards/board/mountedDevice and /package/boards/board/compatibleDevice.
M347 WARNING Generator ID in Component Cclass= 'CCLASS', Cgroup= 'CGROUP', Cversion= 'CVER' is undefined: 'GENID' The generator ID used in the component could not be found. Verify and correct the generator ID (/package/components/.../component), or define the generator ID (ref /package/generators/generator).
M348 WARNING Feature redefined for 'MCU', see Line 'REF_LINE''FEATURE' This feature 'FEATURE' has been defined already on the same level in line 'REF_LINE'. The feature characteristics defined on line 'LINE' overwrite those from 'REF_LINE'. Correct the feature (/package/devices/family/.../feature).
M349 WARNING Examples found, but no board description(s) found Example projects have been found for a board that was not defined. Correct the entry for the examples (/package/examples/example/board) or define the board (/package/boards/board).
M350 WARNING No 'COMP' found for 'VENDOR' : 'MCU' ('COMPILER') The package (/package) defines a Vendor-MCU combination for which no component was defined. Define a component (/package/components/.../component) or verify the 'VENDOR' - 'MCU' settings.
M351 WARNING Component 'COMP' ('COMPID') error for 'VENDOR''MCU' ( 'COMPILER'): 'MSG' An unspecified error was found for the component. The message might give detailed information about the error.
M352 WARNING No Directories/Files found for 'COMP' ('COMPID') for 'VENDOR''MCU' ('COMPILER') No files or directories could be found for the defined component. Add the missing information. Refer to /package/.../files.
M353 WARNING No 'FILECAT' File found for Component 'COMP' ('COMPID') for 'VENDOR' : 'MCU' ('COMPILER') No file with the mentioned file category was found for the component. Verify whether the file exists or correct the information. Refer to attribute category in /package/.../files/file.
M354 WARNING Multiple 'FILECAT' Files found for Component 'COMP' ('COMPID') for 'VENDOR' : 'MCU' ('COMPILER') Multiple files with the mentioned file category were found for the specified component. Verify and rename the files, or correct the component settings (/package/.../files/file).
M355 WARNING No 'FILECAT' Directory found for Component 'COMP' ('COMPID') for 'VENDOR' : 'MCU' ('COMPILER') The directory specified for the file category was not found. Correct the information in the component settings (/package/components/.../component).
M358 WARNING Header File 'HFILE' for 'CFILE' missing for Component 'COMP' ('COMPID') for 'VENDOR' : 'MCU' ('COMPILER') The header file defined for the component could not be found. Verify the header file settings (/package/.../files/file) or whether the file exists.
M359 WARNING Family has no Device(s) or Subfamilies: 'FAMILY' The device family has no devices or subfamilies. Add the missing information (/package/devices/family).
M360 WARNING Subfamily has no Device(s): 'SUBFAMILY' Add the missing information. Refer to /package/devices/family/subFamily.
M361 WARNING Generator ID in Taxonomy Cclass= 'CCLASS', Cgroup= 'CGROUP' is undefined: 'GENID' The generator ID used in the taxonomy is not defined. Define or correct the generator ID (/package/taxonomy element).
M362 WARNING Not all Component Dependencies for Cclass= 'CCLASS', Cgroup= 'CGROUP', Csub= 'CSUB', Cversion= 'CVER', Capiversion= 'APIVER' can be resolved. RTE Model reports: 'MSG' Some of the component dependencies could not be resolved. The message might contain additional information. Verify and correct component definition and dependency information. Refer to /package/components/.../component attribute condition.
M363 WARNING No API defined for Component Cclass= 'CCLASS', Cgroup= 'CGROUP', Csub= 'CSUB', Cversion= 'CVER', Capiversion= 'APIVER' The package is missing the API information for the specified component. Refer to /package/apis.
M364 WARNING No Devices for Condition 'COND' available. The specified condition refers to a device that does not exist. Define the device (/package/devices/family/../device) or correct the information for the condition (/package/conditions/condition).
M365 ERROR Redefined 'DEVTYPE' 'MCU' found, see Line LINE Remove duplicate device/variant entries. Refer to /package/devices/family/../device.
M366 ERROR Redefined 'DEVTYPEEXIST' as 'DEVTYPE' 'MCU' found, see Line LINE Device has been redefined as variant or vice versa. Remove duplicate device/variant entries. Refer to /package/devices/family/../device.
M367 ERROR Redefined 'TYPE' 'NAME' found, see Line 'LINE' Remove duplicate device/variant entries. Refer to /package/devices/family/../device.
M369 WARNING Feature is already defined for 'DEVICE' and will be added, see Line 'LINE''FEATURE'. This feature 'FEATURE' has been defined already on a higher level and as such it gets added to this 'DEVICE'. This is usually done when some devices have a higher number of basic features. Correct the feature (/package/devices/family/.../feature) if this is a typo.
M370 WARNING URL is not conformant: 'URL': Backslashes are not allowed in URL, use forward slashes. Use standard URL notation using forward slashes (/).
M371 ERROR 'SECTION' Feature for 'MCU''FEATURE' unknown. This feature 'FEATURE' is unknwon to the specified 'MCU'. Correct the feature (/package/devices/family/.../feature) if this is a typo.
M372 ERROR 'SECTION' Feature for 'MCU''FEATURE' misspelled, did you mean 'KNOWNFEATURE' ('DESCR'). This feature 'FEATURE' resembles the feature 'KNOWNFEATURE'. Correct the feature (/package/devices/family/.../feature) if this is a typo.
M373 ERROR Unsupported Schema Version: 'VER'. The schema version is not supported. Verify the attribute schemaVersion of the element /package.
M374 ERROR While checking Feature for 'MCU': Pname 'CPU' not found. The processor could not be found for the specified device. Refer to /package/devices/family/../device and /package/devices/family/.../processor.
M375 ERROR 'path/pdsc_file': No <mountedDevice> for board 'BOARD' found. If a board element does not contain a <mountedDevice> element, then the examples for this board are not shown and example projects may not appear in the development tools. Refer to /package/boards/board/mountedDevice of /package/boards.
M376 ERROR Schema Version not set! Set a valid schema version in the PDSC file. Refer to schemaVersion attribute in the /package.
M377 WARNING File 'NAME' 'TYPE' must have 'attr="config"' The category 'TYPE' of the file 'NAME' requires it to be defined as a configuration file. Add the attribute attr="config" to the <file> element that defines the file. Refer to /package/.../files/file.
M378 WARNING Component Cclass='CCLASS, Cgroup='CGROUP, Csub='CSUB', Cversion='CVER', implements the API defined in 'NAME' but does not attribute 'Capiversion' specifying the version it implements. Add attribute Capiversion specifying the API version that is implemented in the component described in the message. Refer to /package/components/.../component.
M379 WARNING No example(s) found for Board '['VENDOR''BOARD'. There are no examples found for the board 'BOARD'. Provide examples. Refer to /package/examples/example.
M380 WARNING No description found for ['VENDOR'] 'MCU' No description was found for the device 'MCU' from 'VENDOR'. Use description attribute to provide information about the device, its subfamily, or family. Refer to /package/devices/family/.../description.
M381 WARNING Vendor names are not equal: '['VENDOR''MCU', MCU '['VENDOR2''MCU2', see Line 'LINE' Vendor name specified in the Dvendor attribute for the <mountedDevice> tag does not match the actual device vendor name. Verify and correct vendor name. Refer to /package/boards/board/mountedDevice.
M382 WARNING Requirement <'TAG'> '['VENDOR''NAME' 'VER' could not be resolved.'MSG' The package requires a package with name 'NAME' and version 'VER' from vendor 'VENDOR'. That package was not found. Verify the requirement. Use option -i to point to the required package. Refer to /package/requirements/packages.
M383 ERROR 'TAG' 'NAME' is not conformant to the pattern "'CHAR'" Unsupported characters are found in the 'NAME' for the tag/attribute 'TAG'. Specify the name using only supported characters from 'CHAR'.
M384 ERROR Condition 'NAME': Direct or indirect recursion detected. Skipping condition while searching for 'NAME2' Resolve recursion in condition 'NAME'.
M385 INFO Release date is empty. In the <release> tag add attribute date with the release date. Refer to /package/releases/release.
M386 WARNING Release date is in future: 'RELEASEDATE' (today: 'TODAYDATE') Set the date to the future. Refer to /package/releases/release.
M391 WARNING Redefined Item 'NAME''MSG Multiple defitions of item 'NAME' are found. Use unique names for the items listed in the message 'MSG'.
M392 ERROR Redefined Device or Variant 'NAME''MSG' Multiple defitions of device or variant 'NAME' are found. Use unique names for the devices listed in the message 'MSG'. Refer to /package/devices/family/../device and /package/devices/family/.../device/variant
M393 WARNING Package has development version 'RELEASEVER' The package has development version specified in the version attribute. For release use only MAJOR, MINOR and PATCH sections as described in the CMSIS-pack version semantics. Also refer to /package/releases/release.
M394 ERROR Not Semantic Versioning: 'RELEASEVER' Package version does not follow expected semantic versioning. Correct the value specified for the version attribute using correct semantic. Refer to /package/releases/release.
M395 WARNING Release date attribute is not set for release version: 'RELEASEVER' Specify release date in the attribute date for the returned release version 'RELEASEVER'. Refer to /package/releases/release.
M396 WARNING Release 'TAG' not consecutive (newest first): 'RELEASEVER''RELEASEDATE' (prev.: 'LATESTVER''LATESTDATE', see Line 'LINE') Package releases shall be entered in consecutive way: newest release version and latest date first. Rearrange the releases in the list or correct values for the returned 'TAG' attributes (version or date). Refer to /package/releases/release.
M397 WARNING File extension '.pdsc' must be lowercase: 'PATH' The PDSC file shall have lowercase extension .pdsc Correct extension of the PDSC file 'PATH'.
M398 ERROR Attribute 'Dname' missing in expression using 'Pname="'NAME'" When using attribute Pname in the <condition> element the Dname attribue shall be present as well. Add attribute token{Dname} specifying the device name. Refer to /package/conditions/condition.
M399 WARNING Attribute 'TAG' is ignored, because 'TAG2' + 'TAG3' is specified Deprecated attribute 'TAG' is ignored because newer attributes are found. Triggered for id attribute in the /package/devices/family/.../memory element when name or access attributes are present as well. remove deprecated attribute 'TAG'

RTE Model Errors

Message Number Type Message Text Action
M500 TEXT RTE Model reports: 'MSG' Error while preparing data. See massage for more details.
M502 TEXT RTE Model reports: #error 'NUM''NAME' : 'MSG' Additional software components required.
M504 TEXT RTE Model reports: MISSING: – SPACE NAME Add the missing component.