CMSIS-SVD  Version 1.3.9
CMSIS System View Description
 All Pages
SVDConv utility

SVDConv is a command-line utility to validate CMSIS-SVD files and to generate CMSIS-compliant device header files. SVDConv is distributed with the ARM::CMSIS Pack (in the CMSIS\Utilities directory) together with the CMSIS-SVD.xsd schema file. SVDConv is available for Windows and Linux operating systems.

SVDConv performs the following operations:

  • Checks the syntactical and structural compliance with the specified CMSIS-SVD format.
  • Checks the consistency, correctness, and completeness of the CMSIS-SVD file against the CMSIS-SVD schema file.
  • Generates CMSIS-compliant device header files, which can be used for software development.
Note
Consider using --strict option to receive all pedantic warnings. Some rules are skipped by default due to backward compatibility reasons. All newly developed/updated SVD files should rather respect all rules.

Operation

SVDConv is invoked form the command line. The general command format is:

SVDConv.exe <SVD_file> <options>

 

<options> Short Name Description
none Validation Perform a validation check of the SVD file. Errors and warnings are printed on screen.
-b Log File Specify the log file name for writing messages. Default: screen.
-o Output Path Specify an output path for the generated device header file or log file. Default: current directory.
--generate=header Generate Device Header File Generates the device header file. The name of the generated file is derived from the value of the tag <devicename> in the CMSIS-SVD file. Refer to device.
--generate=partition Generate Partition file for Cortex-M Security Extensions (Armv8-M) Generates the device partition file. The name of the generated file is composed of partition_ and the value of the device <name> (for example, partition_CMSDK_ARMv8MBL.h). Refer to /device element. The content of the file uses Configuration Wizard annotations and is derived from the SAU-specific information of the /device/cpu/sauRegionsConfig element and the interrupts specified in the /device/peripherals element.
--fields=enum Bit-field Enums Generates enum lists for each field value description contained in the CMSIS-SVD input file. Must be used in combination with --generate=header.
--fields=macro Bit-field Macros Generates position and mask C-Macros for each field description contained in the CMSIS-SVD input file. Must be used in combination with --generate=header.
--fields=struct Bit-field Structs Generates bit fields for each field description contained in the CMSIS-SVD input file. Must be used in combination with --generate=header.
--fields=struct-ansic ANSI Bit-field Structs Generates MISRA-compliant structures for each bitfield. The generated code is not CMSIS-compliant! Must be used in combination with --generate=header.
--strict Strict error checking RECOMMENDED! Applies strict error checking and generates a lot more messages.

Return Codes

SVDConv returns the following codes:

Code Description Action
0 OK No action required. Validation and conversion performed without errors.
1 WARNINGS Warnings should be checked an possibly removed. The header file is created and could be used.
2 ERRORS Errors in the SVD description file. Important elements are missing and must be corrected.
3 Error in command line Check and correct the command line arguments.

Examples

  1. Retrieve help information on screen.
    SVDConv

  2. Perform a consistency check by passing only the SVD file name. Errors and warnings are printed on screen.
    SVDConv ARM_Example.svd

    The result is printed on screen:
       MVCM3110.svd(1688) : info
       <description> missing for value '2 : MODE2'
       MVCM3110.svd(1692) : info
       <description> missing for value '3 : MODE3'
       MVCM3110.svd(1696) : info
       <description> missing for value '4 : MODE4'
       Area of improvements:
       * Description contains 267 <fields> defined without associated <enumeratedValues>
       Found 0 Errors and 1 Warnings
       Return Code: 1 (WARNINGS)

  3. Generate the header file. Performs a consistency check. Errors and warnings are printed on screen.
    SVDConv ARM_Example.svd --generate=header

    Code snippet from the generated header file showing the structure for TIMER0.
    /* ================ TIMER0 ================ */
    typedef struct {
    __IO uint32_t CR;
    __IO uint16_t SR;
    __I uint16_t RESERVED0[5];
    __IO uint16_t INT;
    __I uint16_t RESERVED1[7];
    __IO uint32_t COUNT;
    __IO uint32_t MATCH;
    union {
    __O uint32_t PRESCALE_WR;
    __I uint32_t PRESCALE_RD;
    };
    __I uint32_t RESERVED2[9];
    __IO uint32_t RELOAD[4];
    } TIMER0_Type;

  4. Generate the header file containing bit fields. Performs a consistency check. Errors and warnings are printed on screen.
    SVDConv ARM_Example.svd --generate=header --fields=struct

    Code snippet from the generated header file showing the structure for TIMER0.
    Compare to the code snippet above.
    /* ================ TIMER0 ================ */
    typedef struct {
    union {
    __IO uint32_t CR;
    struct {
    __IO uint32_t EN : 1;
    __O uint32_t RST : 1;
    __IO uint32_t CNT : 2;
    __IO uint32_t MODE : 3;
    __IO uint32_t PSC : 1;
    __IO uint32_t CNTSRC : 4;
    __IO uint32_t CAPSRC : 4;
    __IO uint32_t CAPEDGE : 2;
    uint32_t : 2;
    __IO uint32_t TRGEXT : 2;
    uint32_t : 2;
    __IO uint32_t RELOAD : 2;
    __IO uint32_t IDR : 2;
    uint32_t : 3;
    __IO uint32_t S : 1;
    } CR_b;
    };
    union {
    __IO uint16_t SR;
    struct {
    __I uint16_t RUN : 1;
    uint16_t : 7;
    __IO uint16_t MATCH : 1;
    __IO uint16_t UN : 1;
    __IO uint16_t OV : 1;
    uint16_t : 1;
    __I uint16_t RST : 1;
    uint16_t : 1;
    __I uint16_t RELOAD : 2;
    } SR_b;
    };
    __I uint16_t RESERVED0[5];
    union {
    __IO uint16_t INT;
    struct {
    __IO uint16_t EN : 1;
    uint16_t : 3;
    __IO uint16_t MODE : 3;
    } INT_b;
    };
    __I uint16_t RESERVED1[7];
    __IO uint32_t COUNT;
    __IO uint32_t MATCH;
    union {
    __O uint32_t PRESCALE_WR;
    __I uint32_t PRESCALE_RD;
    };
    __I uint32_t RESERVED2[9];
    __IO uint32_t RELOAD[4];
    } TIMER0_Type;

Error and Warning Messages

The following table shows the errors and warnings issued by svdconv.

Help messages

Message Number Type Message Text Details/Action
M020 TEXTSVD_STRING_OPTIONS Displays programm help.
M021 TEXT'DESCR' 'VER'
'COPYRIGHT'
Displays module name 'DESCR', version 'VER' and copyright information 'COPYRIGHT'.
M022 TEXTFound 'ERR' Error(s) and 'WARN' Warning(s).Displays the number of errors/warnings.
M023 TEXTPhase 'CHECK' Information about the check phase.
M024 TEXTArguments: 'OPTS' Specify arguments.

Informative messages

Message Number Type Message Text Details/Action
M040 Info'NAME': 'TIME' ms. Passed
M041 InfoOverall time: 'TIME' ms.
M050 InfoCurrent Working Directory: 'PATH'
M051 InfoReading SVD File: 'PATH'
M061 InfoChecking SVD Description

Invocation errors

Message Number Type Message Text Action
M101 ERRORUnknown error!Please contact support.
M102 ERRORMFC initialization failedPlease contact support.
M103 ERRORInternal Error: 'REF' Please contact support.
M104 CRITICAL'MSG' Please contact support.
M105 ERRORCannot add Register to group sorter: 'NAME'
M106 ERRORCommand 'NAME' failed: 'NUM': 'MSG'
M107 ERRORLost xml file stream.Check SVD file.
M108 ERRORSfrDis not supported.Disassembly not supported.
M109 ERRORCannot find 'NAME' Check specified file.
M111 PROGRESS'NAME' failedCheck specified file.
M120 ERRORInvalid arguments!Provide a list of valid arguments.
M121 ERRORFile not found 'NAME' Check specified file.
M122 ERRORName of command file should follow '@' Check specified command.
M123 ERRORFile not found: 'PATH'! Check speficied path.
M124 ERRORCannot execute SfrCC2: 'PATH'!" Check path to SfrCC2.
M125 WARNINGSfrCC2 report:
'MSG'
SfrCC2 report end.
M126 WARNINGSfrDis: 'MSG'
M127 ERRORSfrCC2 reports errors!Check SVD file.
M128 WARNINGSfrCC2 reports warnings!Check SVD file.
M129 ERROROption unknown: 'OPT' Check given option 'OPT'.
M130 ERRORCannot create file 'NAME' Check user rights.
M132 ERRORSfrCC2 report:
'MSG'
SfrCC2 report end."

Validation errors

Message Number Type Message Text Action
M201 ERRORTag <'TAG'> unknown or not allowed on this level."Check tag
M202 ERRORParse error: <'TAG'> = 'VALUE' Check tag/value.
M203 ERRORValue already set: <'TAG'> = 'VALUE' Check tag/value.
M204 ERRORParse Error: 'VALUE' Check value.
M205 WARNINGTag <'TAG'> emptyAssign value to tag.
M206 ERRORDerivedFrom not found: 'NAME' Check derivate.
M207 ERRORExpression marker found but no <dim> specified: 'NAME' Specify dimension.
M208 ERRORIgnoring <dimIndex> because specified <name> requires Array generation.Generate an array.
M209 WARNINGCPU section not set. This is required for CMSIS Headerfile generation and debug support.Add CPU section.
M210 WARNINGUse new Format CMSIS-SVD >= V1.1 and add <CPU> Section.Update schema and add CPU section.
M211 ERRORIgnoring 'LEVEL' 'NAME' (see previous message)
M212 ERRORAddress Block <usage> parse error: 'NAME' Correct address block.
M213 ERRORExpression for 'NAME' incomplete, <'TAG'> missing.Add tag.
M214 ERRORPeripheral 'NAME' <dim> single-instantiation is not supported (use Array instead).Correct Regs to Reg[s].
M215 WARNINGSize of <dim> is only one element for 'NAME', is this intended?Check single element.
M216 WARNINGUnsupported character found in 'NAME' : 'HEX'.Correct name.
M217 WARNINGForbidden Trigraph '??CHAR' found in 'NAME'.
M218 WARNINGUnsupported ESC sequence found in 'NAME' : 'CHAR'.Correct escape sequence.
M219 ERRORC Code generation error: 'MSG'
M220 WARNINGC Code generation warning: 'MSG'
M221 WARNINGInput filename must end with .svd: 'NAME' Correct input filename extension.
M222 WARNINGInput filename has no extension: 'NAME' Correct input filename extension.
M223 ERRORInput File Name 'INFILE' does not match the tag <name> in the <device> section: 'NAME' Correct the MCU name.
M224 WARNINGDeprecated: 'NAME' Use 'NAME2' insteadUpdate SVD file.
M225 ERRORUpper/lower case error: 'NAME', should be 'NAME2'" Update SVD file.
M226 ERRORSFD Code generation error: 'MSG'
M227 WARNINGSFD Code generation warning: 'MSG'
M228 ERROREnumerated Value Container: Only one Item allowed on this Level!Remove additional items.
M229 ERRORRegister 'NAME' is not an array, <dimArrayIndex> is not applicableCorrect SVD.
M230 ERRORValue 'NAME':'NUM' out of Range for 'LEVEL' 'NAME2'['NUM2'].Correct SVD.
M231 ERRORValue <isDefault> not allowed for 'LEVEL'.Correct SVD.
M232 ERRORTag <'TAG'> name 'NAME' must not have specifier 'CHAR'. Ignoring entry."Correct SVD.
M233 ERRORParse error: <'TAG'> = 'VALUE' Correct SVD.
M234 ERRORNo valid items found for 'LEVEL' 'NAME' Correct SVD.
M235 ERROR'LEVEL' 'NAME' cannot be an array.Correct SVD.
M236 ERRORExpression for <'TAG'> 'NAME' not allowed.Correct SVD.
M237 ERRORNameless 'LEVEL' must have <'TAG'>.Correct SVD.
M238 ERROR'LEVEL' must not have <'TAG'>."Correct SVD.
M239 ERRORDimed 'LEVEL' 'NAME' must have an expression.Correct SVD.
M240 ERRORTag <'TAG'> unknown or not allowed on 'LEVEL2':'LEVEL'.Correct SVD.
M241 ERRORParse Error: 'VALUE' invalid for Array generationCorrect SVD.
M242 WARNING'LEVEL' 'NAME' <dimArrayIndex> found, but no <dim>Correct SVD.
M243 WARNING'LEVEL' 'NAME' <dimArrayIndex> found, but <dim> does not describe an arrayCorrect SVD.

Data Check Errors

Message Number Type Message Text Action
M301 ERRORInterrupt number 'NUM' : 'NAME' already defined: 'NAME2' 'LINE'
M302 ERRORSize of Register 'NAME':'NUM' must be 8, 16 or 32 Bits
M303 WARNINGRegister name 'NAME' is prefixed with Peripheral name 'NAME2' RegName = USART_CR ==> USART->USART_CR
M304 WARNINGInterrupt number overwrite: 'NUM' : 'NAME' 'LINE'
M305 ERRORName not C compliant: 'NAME' : 'HEX', replaced by '_'
M306 ERRORSchema Version not set for <device>.
M307 ERRORName is equal to Value: 'NAME'
M308 ERRORNumber of <dimIndex> Elements 'NUM' is different to number of <dim> instances 'NUM2'
M309 ERRORField 'NAME': Offset error: 'NUM'
M310 ERRORField 'NAME': BitWidth error: 'NUM'
M311 ERRORField 'NAME': Calculation: MSB or LSB == -1
M312 ERRORAddress Block missing for Peripheral 'NAME'
M313 ERRORField 'NAME': LSB > MSB: BitWith calculates to 'NUM'
M314 ERRORAddress Block: <offset> or <size> not set.
M315 ERRORAddress Block: <size> is zero.
M316 ERROR'LEVEL' <name> not set.
M317 WARNING'LEVEL' <description> not set.
M318 WARNING'LEVEL' 'NAME' <'TAG'> is equal to <name>
M319 WARNING'LEVEL' <'TAG'> 'NAME' ends with newline, is this intended?
M320 WARNING'LEVEL' <description> 'NAME' is not very descriptive
M321 WARNING'LEVEL' <'ITEM'> 'NAME' starts with '_', is this intended?
M322 ERROR'LEVEL' 'ITEM' 'NAME' is meaningless text. Deleted.
M323 WARNING'LEVEL' <'ITEM'> 'NAME' contains text 'TEXT'
M324 ERRORField 'NAME' 'BITRANGE' does not fit into Register 'NAME2':'NUM' 'LINE'
M325 ERRORCPU Revision is not set"
M326 ERROREndianess is not set, using default (little)
M327 ERRORNVIC Prio Bits not set or wrong value, must be 2..8. Using default (4)
M328 WARNING'LEVEL' 'NAME' has no Registers, ignoring 'LEVEL'.
M329 ERRORCPU Type is not set, using default (Cortex-M3)
M330 ERRORInterrupt 'NAME' Number not set.
M331 ERRORInterrupt 'NAME' Number 'NUM' greater 239.
M332 WARNING'LEVEL' 'NAME' has only one Register.
M333 ERRORDuplicate <enumeratedValue> 'NUM': 'NAME' ('USAGE'), already used by 'NAME2' ('USAGE2') 'LINE'
M334 WARNING'LEVEL' <'ITEM'> 'NAME' is very long, use <description> and a shorter <name>
M335 ERRORValue 'NAME':'NUM' does not fit into field 'NAME2' 'BITRANGE'.
M336 ERROR'LEVEL' 'NAME' already defined 'LINE'
M337 ERROR'LEVEL' 'NAME' already defined 'LINE'
M338 ERRORField 'NAME' 'BITRANGE' ('ACCESS') overlaps 'NAME2' 'BITRANGE2' ('ACCESS2') 'LINE'
M339 ERRORRegister 'NAME' ('ACCESS') (@'ADDRSIZE') has same address or overlaps 'NAME2' ('ACCESS2') (@'ADDRSIZE2') 'LINE'
M340 ERRORNo Devices found.
M341 ERRORMore than one devices found, only one is allowed per SVD File.
M342 ERRORDim-extended 'LEVEL' 'NAME' must not have <headerStructName>
M343 ERROR'LEVEL' 'NAME' (@'ADDR') has same address as 'NAME2' 'LINE'
M344 ERRORRegister 'NAME' (@'ADDRSIZE') is outside or does not fit any <addressBlock> specified for Peripheral 'NAME2'
'TEXT'
M345 ERRORField 'NAME' 'BITRANGE' does not fit into Register 'NAME2':'NUM'
M346 WARNINGRegister 'NAME' (@'ADDR') offset is equal or is greater than it's Peripheral base address 'NAME2' (@'ADDR2'), is this intended?
M347 WARNINGField 'NAME' (width < 6Bit) without any <enumeratedValue> found.
M348 ERRORAlternate 'LEVEL' 'NAME' does not exist at 'LEVEL' address (@'ADDR')
M349 ERRORAlternate 'LEVEL' 'NAME' is equal to 'LEVEL' name 'NAME2'
M350 WARNINGPeripheral 'NAME' (@'ADDR') is not 4Byte-aligned.
M351 WARNINGPeripheral 'TYPE' 'NAME' is equal to Peripheral name.
M352 WARNINGAddressBlock of Peripheral 'NAME' (@'ADDR') 'TEXT' overlaps 'NAME2' (@'ADDR2') 'TEXT2' 'LINE'
M353 WARNINGPeripheral group name 'NAME' should not end with '_'
M354 ERRORInterrupt ''NUM':'NAME' specifies a Core Interrupt. Core Interrupts must not be defined, they are set through <cpu><name>.
M355 ERRORNo Interrupts found on pos. 0..15. External (Vendor-)Interrupts possibly defined on position 16+. External Interrupts must start on position 0
M356 WARNINGNo Interrupt definitions found.
M357 ERRORCore Interrupts found. Interrupt Numbers are wrong. Internal Interrupts must not be described, External Interrupts must start at 0.
M358 ERRORAddressBlock of Peripheral 'NAME' 'TEXT' overlaps AddressBlock 'TEXT2' in same peripheral 'LINE'
M359 ERRORAddress Block: <usage> not set.
M360 ERRORAddress Block: found <'TAG'> ('HEXNUM') > 'HEXNUM2'.
M361 ERROR'LEVEL' 'ITEM' 'NAME': 'RESERVED' items must not be defined.
M362 WARNING'LEVEL' 'ITEM' 'NAME': 'RESERVED' items must not be defined.
M363 ERRORCPU: <sauNumRegions> not set.
M364 ERRORCPU: <sauNumRegions> value 'NUM' greater than SAU max num ('NUM2')
M365 WARNINGRegister 'NAME' ('ACCESS') (@'ADDRSIZE') has same address or overlaps 'NAME2' ('ACCESS2') (@'ADDRSIZE2') 'LINE'
M366 ERRORRegister 'NAME' size ('NUM'Bit) is greater than <dimIncrement> * <addressBitsUnits> ('NUM2'Bit).
M367 WARNINGAccess Type: Field 'NAME' ('ACCESS') does not match Register 'NAME2' ('ACCESS2')
M368 WARNING'LEVEL' 'NAME' (@'ADDR') has same address as 'NAME2' 'LINE'
M369 ERROREnumerated Value 'NAME': <value> not set.
M370 ERROR'LEVEL' 'NAME': <offset> not set.
M371 ERROR'LEVEL' 'NAME' <headerStructName> is equal to hirachical name
M372 ERROR'LEVEL' <'TAG'> 'NAME' already defined 'LINE'
M373 ERROR'LEVEL' <'TAG'> 'NAME' already defined 'LINE'
M374 WARNING<enumeratedValues> can be one <enumeratedValues> container for all <enumeratedValue>s, where <usage> can be read, write, or read-write or two <enumeratedValues> containers, where one is set to <usage> read and the other is set to <usage> write
M375 ERROR'LEVEL' 'NAME' (<enumeratedValues> 'NAME2'): Too many <enumeratedValues> container specified.
M376 ERROR'LEVEL' 'NAME' (<enumeratedValues> 'NAME2'): 'USAGE' container already defined in 'LINE'.
M377 ERROR'LEVEL' 'NAME' (<enumeratedValues> 'NAME2'): 'USAGE' container conflicts with 'NAME3' 'LINE'.
M378 ERRORRegister Array: Register 'NAME' size ('NUM'Bit) does not match <dimIncrement> ('NUM2'Bit).
M379 ERRORXBin Number 'NAME' too large, skipping evaluation.
M380 ERRORAddressBlock of Peripheral 'NAME' (@'ADDR') 'TEXT' does not fit into 32Bit Address Space.
M381 ERRORInterrupt 'NAME' Number 'NUM' greater or equal deviceNumInterrupts ('NUM2').
M382 ERROR'LEVEL' 'NAME': 'NAME2' 'HEXNUM' does not fit into 'LEVEL' width: 'NUM' Bit.

Data modification errors

Message Number Type Message Text Action
M517 WARNINGSFD Code generation: Forbidden Trigraph '??CHAR' found in 'NAME'.
M516 WARNINGSFD Code generation: Unsupported character found in 'NAME' : 'HEX'.
M518 WARNINGSFD Code generation: Unsupported ESC sequence found in 'NAME' : 'CHAR'.