xmclib/CMSIS/Documentation/SVD/html/svd_SVDConv_pg.html

278 lines
16 KiB
HTML
Raw Normal View History

2024-10-17 17:09:59 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SVDConv.exe</title>
<title>CMSIS-SVD: SVDConv.exe</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 46px;">
<td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">CMSIS-SVD
&#160;<span id="projectnumber">Version 1.3.3</span>
</div>
<div id="projectbrief">CMSIS System View Description</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
<ul class="tablist">
<script type="text/javascript">
<!--
writeComponentTabs.call(this);
//-->
</script>
</ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('svd_SVDConv_pg.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">SVDConv.exe </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>SVDConv.exe</b> is a command-line utility to validate CMSIS-SVD files and to generate CMSIS-compliant device header files. <b>SVDConv.exe</b> is distributed with the <b>ARM::CMSIS</b> Pack (in the CMSIS\Utilities directory) together with the CMSIS-SVD schema file.</p>
<p><b>SVDConv.exe</b> performs the following operations:</p>
<ul>
<li>Checks the syntactical and structural compliance with the specified CMSIS-SVD format.</li>
<li>Checks the consistency, correctness, and completeness of the CMSIS-SVD file against the CMSIS-SVD schema file.</li>
<li>Generates CMSIS-compliant device header files, which can be used for software development.</li>
</ul>
<h2>Operation </h2>
<p><b>SVDConv.exe</b> is invoked form the command line. The general command format is: </p>
<div class="fragment"><div class="line">SVDConv.exe &lt;SVD_file&gt; &lt;options&gt;</div>
</div><!-- fragment --><p>&#160;</p>
<table class="cmtable" summary="SVDConv Args">
<tr>
<th>&lt;options&gt; </th><th>Short Name </th><th>Description </th></tr>
<tr>
<td><em>none</em> </td><td>Validation </td><td>Perform a validation check of the SVD file. Errors and warnings are printed on screen. </td></tr>
<tr>
<td>-b </td><td>Log File </td><td>Specify the log file name for writing messages. Default: screen. </td></tr>
<tr>
<td>-o </td><td>Output Path </td><td>Specify an output path for the generated device header file or log file. Default: current directory. </td></tr>
<tr>
<td>--generate=header </td><td>Generate Device Header File </td><td>Generates the device header file. The name of the generated file is derived from the value of the tag &lt;device&lt;name&gt; in the CMSIS-SVD file. Refer to <a class="el" href="elem_device.html">device</a>. </td></tr>
<tr>
<td>--generate=partition </td><td>Generate Partition file for Cortex-M Security Extensions (ARMv8M) </td><td>Generates the device partition file. The name of the generated file is composed of <em>partition_</em> and the value of the device <em>&lt;name&gt;</em> (for example, <em>partition_CMSDK_ARMv8MBL.h</em>). Refer to <a class="el" href="elem_device.html">/device element</a>. The content of the file uses Configuration Wizard annotations and is derived from the SAU-specific information of the <a class="el" href="elem_cpu.html#elem_sauRegionsConfig">/device/cpu/sauRegionsConfig element</a> and the interrupts specified in the <a class="el" href="elem_peripherals.html">/device/peripherals element</a>. </td></tr>
<tr>
<td>--fields=enum </td><td>Bit-field Enums </td><td>Generates enum lists for each field value description contained in the CMSIS-SVD input file. Must be used in combination with <em>--generate=header</em>. </td></tr>
<tr>
<td>--fields=macro </td><td>Bit-field Macros </td><td>Generates position and mask C-Macros for each field description contained in the CMSIS-SVD input file. Must be used in combination with <em>--generate=header</em>. </td></tr>
<tr>
<td>--fields=struct </td><td>Bit-field Structs </td><td>Generates bit fields for each field description contained in the CMSIS-SVD input file. Must be used in combination with <em>--generate=header</em>. </td></tr>
<tr>
<td>--fields=struct-ansic </td><td>ANSI Bit-field Structs </td><td>Generates MISRA-compliant structures for each bitfield. The generated code <b>is not CMSIS-compliant</b>! Must be used in combination with <em>--generate=header</em>. </td></tr>
</table>
<h2>Return Codes </h2>
<p><b>SVDConv.exe</b> returns the following codes: <br/>
</p>
<table class="doxtable">
<tr>
<th align="center">Code </th><th align="left">Description </th><th align="left">Action </th></tr>
<tr>
<td align="center">0 </td><td align="left">OK </td><td align="left">No action required. Validation and conversion performed without errors. </td></tr>
<tr>
<td align="center">1 </td><td align="left">WARNINGS </td><td align="left">Warnings should be checked an possibly removed. The header file is created and could be used. </td></tr>
<tr>
<td align="center">2 </td><td align="left">ERRORS </td><td align="left">Errors in the SVD description file. Important elements are missing and must be corrected. </td></tr>
<tr>
<td align="center">3 </td><td align="left">Error in command line </td><td align="left">Check and correct the command line arguments. </td></tr>
</table>
<p><b>Examples</b> <br/>
</p>
<ol type="1">
<li>Retrieve help information on screen. <div class="fragment"><div class="line">SVDConv.exe </div>
</div><!-- fragment --> <br/>
</li>
<li>Perform a consistency check by passing only the SVD file name. Errors and warnings are printed on screen. <div class="fragment"><div class="line">SVDConv.exe ARM_Example.svd </div>
</div><!-- fragment --> <br/>
The result is printed on screen: <pre class="fragment"> MVCM3110.svd(1688) : info
&lt;description&gt; missing for value '2 : MODE2'
MVCM3110.svd(1692) : info
&lt;description&gt; missing for value '3 : MODE3'
MVCM3110.svd(1696) : info
&lt;description&gt; missing for value '4 : MODE4'
Area of improvements:
* Description contains 267 &lt;fields&gt; defined without associated &lt;enumeratedValues&gt;
Found 0 Errors and 1 Warnings
Return Code: 1 (WARNINGS)</pre> <br/>
</li>
<li>Generate the header file. Performs a consistency check. Errors and warnings are printed on screen. <div class="fragment"><div class="line">SVDConv.exe ARM_Example.svd --generate=header</div>
</div><!-- fragment --> <br/>
Code snippet from the generated header file showing the structure for <b>TIMER0</b>. <br/>
<div class="fragment"><div class="line"><span class="comment">/* ================ TIMER0 ================ */</span></div>
<div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{ </div>
<div class="line"> __IO uint32_t CR; </div>
<div class="line"> __IO uint16_t SR; </div>
<div class="line"> __I uint16_t RESERVED0[5];</div>
<div class="line"> __IO uint16_t INT; </div>
<div class="line"> __I uint16_t RESERVED1[7];</div>
<div class="line"> __IO uint32_t COUNT; </div>
<div class="line"> __IO uint32_t MATCH; </div>
<div class="line"> <span class="keyword">union </span>{</div>
<div class="line"> __O uint32_t PRESCALE_WR; </div>
<div class="line"> __I uint32_t PRESCALE_RD; </div>
<div class="line"> };</div>
<div class="line"> __I uint32_t RESERVED2[9];</div>
<div class="line"> __IO uint32_t RELOAD[4]; </div>
<div class="line">} TIMER0_Type;</div>
</div><!-- fragment --> <br/>
</li>
<li>Generate the header file containing bit fields. Performs a consistency check. Errors and warnings are printed on screen. <div class="fragment"><div class="line">SVDConv.exe ARM_Example.svd --generate=header --fields=<span class="keyword">struct</span></div>
</div><!-- fragment --> <br/>
Code snippet from the generated header file showing the structure for <b>TIMER0</b>. <br/>
Compare to the code snippet above. <div class="fragment"><div class="line"><span class="comment">/* ================ TIMER0 ================ */</span></div>
<div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{ </div>
<div class="line"> <span class="keyword">union </span>{</div>
<div class="line"> __IO uint32_t CR; </div>
<div class="line"> <span class="keyword">struct </span>{</div>
<div class="line"> __IO uint32_t EN : 1; </div>
<div class="line"> __O uint32_t RST : 1; </div>
<div class="line"> __IO uint32_t CNT : 2; </div>
<div class="line"> __IO uint32_t MODE : 3; </div>
<div class="line"> __IO uint32_t PSC : 1; </div>
<div class="line"> __IO uint32_t CNTSRC : 4; </div>
<div class="line"> __IO uint32_t CAPSRC : 4; </div>
<div class="line"> __IO uint32_t CAPEDGE : 2; </div>
<div class="line"> uint32_t : 2;</div>
<div class="line"> __IO uint32_t TRGEXT : 2; </div>
<div class="line"> uint32_t : 2;</div>
<div class="line"> __IO uint32_t RELOAD : 2; </div>
<div class="line"> __IO uint32_t IDR : 2; </div>
<div class="line"> uint32_t : 3;</div>
<div class="line"> __IO uint32_t S : 1; </div>
<div class="line"> } CR_b; </div>
<div class="line"> };</div>
<div class="line"> </div>
<div class="line"> <span class="keyword">union </span>{</div>
<div class="line"> __IO uint16_t SR; </div>
<div class="line"> <span class="keyword">struct </span>{</div>
<div class="line"> __I uint16_t RUN : 1; </div>
<div class="line"> uint16_t : 7;</div>
<div class="line"> __IO uint16_t MATCH : 1; </div>
<div class="line"> __IO uint16_t UN : 1; </div>
<div class="line"> __IO uint16_t OV : 1; </div>
<div class="line"> uint16_t : 1;</div>
<div class="line"> __I uint16_t RST : 1; </div>
<div class="line"> uint16_t : 1;</div>
<div class="line"> __I uint16_t RELOAD : 2; </div>
<div class="line"> } SR_b; </div>
<div class="line"> };</div>
<div class="line"> __I uint16_t RESERVED0[5];</div>
<div class="line"> </div>
<div class="line"> <span class="keyword">union </span>{</div>
<div class="line"> __IO uint16_t INT; </div>
<div class="line"> <span class="keyword">struct </span>{</div>
<div class="line"> __IO uint16_t EN : 1; </div>
<div class="line"> uint16_t : 3;</div>
<div class="line"> __IO uint16_t MODE : 3; </div>
<div class="line"> } INT_b; </div>
<div class="line"> };</div>
<div class="line"> __I uint16_t RESERVED1[7];</div>
<div class="line"> __IO uint32_t COUNT; </div>
<div class="line"> __IO uint32_t MATCH; </div>
<div class="line"> <span class="keyword">union </span>{</div>
<div class="line"> __O uint32_t PRESCALE_WR; </div>
<div class="line"> __I uint32_t PRESCALE_RD; </div>
<div class="line"> };</div>
<div class="line"> __I uint32_t RESERVED2[9];</div>
<div class="line"> __IO uint32_t RELOAD[4]; </div>
<div class="line">} TIMER0_Type;</div>
</div><!-- fragment --> </li>
</ol>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Wed Feb 8 2017 10:21:05 for CMSIS-SVD by ARM Ltd. All rights reserved.
<!--
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
-->
</li>
</ul>
</div>
</body>
</html>