]> begriffs open source - cmsis-driver-validation/blob - docs/html/test_setup.html
Merge branch 'develop'
[cmsis-driver-validation] / docs / html / test_setup.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <title>Test Setup</title>
7 <title>CMSIS-Driver Validation: Test Setup</title>
8 <link href="tabs.css" rel="stylesheet" type="text/css"/>
9 <link href="drv.css" rel="stylesheet" type="text/css" />
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <script type="text/javascript" src="printComponentTabs.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtree.js"></script>
16 <script type="text/javascript">
17   $(document).ready(initResizable);
18   $(window).load(resizeHeight);
19 </script>
20 <link href="search/search.css" rel="stylesheet" type="text/css"/>
21 <script type="text/javascript" src="search/search.js"></script>
22 <script type="text/javascript">
23   $(document).ready(function() { searchBox.OnSelectItem(0); });
24 </script>
25 <link href="stylsheetf" rel="stylesheet" type="text/css" />
26 </head>
27 <body>
28 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
29 <div id="titlearea">
30 <table cellspacing="0" cellpadding="0">
31  <tbody>
32  <tr style="height: 46px;">
33   <td id="projectlogo"><img alt="Logo" src="keilarm.png"/></td>
34   <td style="padding-left: 0.5em;">
35    <div id="projectname">CMSIS-Driver Validation
36    &#160;<span id="projectnumber">Version 1.3.0</span>
37    </div>
38    <div id="projectbrief">Driver Validation</div>
39   </td>
40  </tr>
41  </tbody>
42 </table>
43 </div>
44 <!-- end header part -->
45 <div id="DRVnav" class="tabs1">
46     <ul class="tablist">
47       <script type="text/javascript">
48                 <!--
49                 writeComponentTabs.call(this);
50                 //-->
51       </script>
52           </ul>
53 </div>
54 <!-- Generated by Doxygen 1.8.6 -->
55 <script type="text/javascript">
56 var searchBox = new SearchBox("searchBox", "search",false,'Search');
57 </script>
58   <div id="navrow1" class="tabs">
59     <ul class="tablist">
60       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
61       <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
62       <li><a href="modules.html"><span>Reference</span></a></li>
63       <li>
64         <div id="MSearchBox" class="MSearchBoxInactive">
65         <span class="left">
66           <img id="MSearchSelect" src="search/mag_sel.png"
67                onmouseover="return searchBox.OnSearchSelectShow()"
68                onmouseout="return searchBox.OnSearchSelectHide()"
69                alt=""/>
70           <input type="text" id="MSearchField" value="Search" accesskey="S"
71                onfocus="searchBox.OnSearchFieldFocus(true)" 
72                onblur="searchBox.OnSearchFieldFocus(false)" 
73                onkeyup="searchBox.OnSearchFieldChange(event)"/>
74           </span><span class="right">
75             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
76           </span>
77         </div>
78       </li>
79     </ul>
80   </div>
81 </div><!-- top -->
82 <div id="side-nav" class="ui-resizable side-nav-resizable">
83   <div id="nav-tree">
84     <div id="nav-tree-contents">
85       <div id="nav-sync" class="sync"></div>
86     </div>
87   </div>
88   <div id="splitbar" style="-moz-user-select:none;" 
89        class="ui-resizable-handle">
90   </div>
91 </div>
92 <script type="text/javascript">
93 $(document).ready(function(){initNavTree('test_setup.html','');});
94 </script>
95 <div id="doc-content">
96 <!-- window showing the filter options -->
97 <div id="MSearchSelectWindow"
98      onmouseover="return searchBox.OnSearchSelectShow()"
99      onmouseout="return searchBox.OnSearchSelectHide()"
100      onkeydown="return searchBox.OnSearchSelectKey(event)">
101 <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>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>
102
103 <!-- iframe showing the search results (closed by default) -->
104 <div id="MSearchResultsWindow">
105 <iframe src="javascript:void(0)" frameborder="0" 
106         name="MSearchResults" id="MSearchResults">
107 </iframe>
108 </div>
109
110 <div class="header">
111   <div class="headertitle">
112 <div class="title">Test Setup </div>  </div>
113 </div><!--header-->
114 <div class="contents">
115 <div class="textblock"><h1><a class="anchor" id="step1"></a>
116 Step 1: Create an MDK project with your target microcontroller device</h1>
117 <h1><a class="anchor" id="step2"></a>
118 Step 2: Add required software components</h1>
119 <p>For proper operation, add the following software components in the <b>Manage Run-Time Environment</b> window:</p>
120 <ul>
121 <li><b>CMSIS:RTOS2 (API):Keil RTX5</b></li>
122 <li><b>Compiler:I/O:STDOUT</b>, variant <b>ITM</b> or <b>User</b> if your hardware does not support ITM.</li>
123 <li><b>CMSIS:CMSIS Driver Validation:Framework</b></li>
124 <li>Any other component from <b>CMSIS:CMSIS Driver Validation</b></li>
125 <li>Resolve any validation messages</li>
126 </ul>
127 <h1><a class="anchor" id="step3"></a>
128 Step 3: Add main.c</h1>
129 <p>Right-click <b>Source Group 1...</b> and select <b>Add New Item to Group</b>. Select <b>User Code Template</b> and choose the <b>main</b> file from <b>Device:Startup</b> or <b>CMSIS-RTOS2:Keil RTX5</b>.</p>
130 <p>Add this include: </p>
131 <div class="fragment"><div class="line">include <span class="stringliteral">&quot;cmsis_dv.h&quot;</span></div>
132 </div><!-- fragment --><p>In the main function, after kernel initialization, create the <code>cmsis_dv</code> thread: </p>
133 <div class="fragment"><div class="line">osThreadNew(<a class="code" href="group__framework__funcs.html#gaf2fc6d3011404f9d07346948bcc6c74d">cmsis_dv</a>, NULL, NULL);</div>
134 </div><!-- fragment --><p> to run all tests that you have chosen in the next step.</p>
135 <h1><a class="anchor" id="step4"></a>
136 Step 4: Configure DV_Config.h</h1>
137 <p>Open <code>DV_Config.h</code> under the <b>CMSIS Driver Validation</b> group in the Project window.</p>
138 <div class="image">
139 <img src="dv_config_h.png" alt="dv_config_h.png"/>
140 <div class="caption">
141 Configuration File DV_Config.h</div></div>
142 <p> <b>Common Test Settings</b></p>
143 <p>The common test settings help you to choose the output format of the test and the buffer sizes and buffer content that should be used for the send, receive, and transfer tests:</p>
144 <ul>
145 <li>The <b>Print</b> <b>Output</b> <b>Format</b> lets you select if you wish to create the output as plain text or as styled XML.</li>
146 <li>The <b>Buffer size for assertions results</b> determines the size of the buffer that can be observed in the <b>Watch</b> window.</li>
147 <li><b>Buffer</b> <b>sizes</b> lets you select the buffer sizes that are used for data transfer. This setting has a direct impact on required <a class="el" href="test_setup.html#step6">heap</a>.</li>
148 <li>You can specify also the <b>Buffer size for baudrate test</b>. For USART you can set the <b>Percentual tolerance for baudrate test</b> and for SPI the <b>Percentual trigger for bus speed test</b>. Depending on the device <a class="el" href="test_setup.html#step7">configuration</a>, for example when DMA is not used, the transfers may have larger overhead which is more significant for higher bus speeds. The transfer overhead is reduced for larger transfer buffer sizes.</li>
149 <li>Select your preferred <b>Buffer pattern</b></li>
150 </ul>
151 <p><b>Driver-specific Settings</b></p>
152 <p>Every interface has specific settings that can be changed in the according section:</p>
153 <ul>
154 <li>You need to specify the driver instance number (<b>Driver_<em>interface</em>#</b>) is used for the test. This is especially important for microcontroller devices that have multiple peripherals of the same kind.</li>
155 <li>Some drivers can have additional baudrate or timing settings.</li>
156 <li>Select all driver tests that you wish to use. Note that all tests can run independently from each other. You do not need to specify a certain order.</li>
157 </ul>
158 <dl class="section note"><dt>Note</dt><dd>For more information on additional settings and the different driver test cases, check the <a href="./modules.html" class="el">Reference</a> section.</dd></dl>
159 <h1><a class="anchor" id="step5"></a>
160 Step 5: Configure Keil RTX5</h1>
161 <p>Open <b>RTX_Config.h</b> and edit set:</p>
162 <ul>
163 <li><b>Default Thread stack size [bytes]</b> to <em>2048</em> </li>
164 </ul>
165 <h1><a class="anchor" id="step6"></a>
166 Step 6: Configure Heap</h1>
167 <p>Depending on the buffer sizes that you have chosen in <a class="el" href="test_setup.html#step4">step 4</a>, you need to add more heap. Open your startup_<em>device</em>.s file from the <b>Device</b> group in the <b>Project</b> window. Click on <b>Configuration</b> <b>Wizard</b>. Increase the heap size:</p>
168 <ul>
169 <li>For the validation framework add 1024 bytes.</li>
170 <li>double the largest buffer size you have set in the configuration file and add this as well.</li>
171 </ul>
172 <p>Refer to the <a class="el" href="resource_requirements.html">Resource Requirements</a> section for a calculation example.</p>
173 <h1><a class="anchor" id="step7"></a>
174 Step 7: Configure the Device</h1>
175 <p>Depending on your device, you might have different pin/hardware configuration options. Usually, you can configure the device using the <code>RTE_Device.h</code> file from the <b>Device</b> group. Enable all interfaces you wish to use in the tests and make all necessary pin-out changes required by your actual board layout (consult the board schematics). The pre-built <a class="el" href="examples.html">examples</a> are already configured for the underlying hardware.</p>
176 <p>For a robust test with good coverage, implement various targets with different settings:</p>
177 <ul>
178 <li><b>Enable/disable</b> the <b>DMA</b> controller of your device</li>
179 <li>Set different <b>buffer</b> <b>sizes</b> in <a class="el" href="test_setup.html#step4">DV_Config.h</a></li>
180 <li>Select different compiler <b>optimization</b> <b>levels</b> in the <a href="http://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm" target="_blank">C/C++ tab</a> of the <b>Options for Target</b> dialog.</li>
181 </ul>
182 <h1><a class="anchor" id="step8"></a>
183 Step 8: Make Hardware Connections for Loopback Tests</h1>
184 <p>These interfaces support loopback testing: <a class="el" href="group__eth__funcs.html">Ethernet</a>, <a class="el" href="group__spi__funcs.html">SPI</a>, and <a class="el" href="group__usart__funcs.html">USART</a>. Connect the following pins on your target hardware together (refer to the hardware schematics):</p>
185 <ul>
186 <li>Ethernet: RX+ and TX+, RX- and TX-</li>
187 <li>SPI: MISO and MOSI</li>
188 <li>USART: RX and TX</li>
189 </ul>
190 <h1><a class="anchor" id="step9"></a>
191 Step 9: Download and Run the Project</h1>
192 <p>In the <b>Options for Target</b> dialog, under debug settings, ensure that <b>Trace</b> and ITM port <span class="XML-Token">0</span> are enabled and that the correct clock frequency is set:</p>
193 <div class="image">
194 <img src="target_dialog.png" alt="target_dialog.png"/>
195 <div class="caption">
196 ITM Channel setting</div></div>
197 <p> Build, load and run the project. The output is displayed in the <b>Debug (printf) Viewer</b> window:</p>
198 <pre class="fragment">CMSIS-Driver Test Suite   Oct  8 2015   17:12:21 
199
200 TEST 01: ETH_MAC_GetCapabilities          PASSED
201 TEST 02: ETH_MAC_Initialization           PASSED
202 TEST 03: ETH_MAC_PowerControl             
203   DV_ETH.c (163) [WARNING] Low power is not supported
204 TEST 04: ETH_MAC_SetBusSpeed              
205   DV_ETH.c (197) [WARNING] Link speed 1G is not supported
206 TEST 05: ETH_MAC_Config_Mode              PASSED
207 TEST 06: ETH_MAC_Config_CommonParams      PASSED
208 TEST 07: ETH_PHY_Initialization           PASSED
209 TEST 08: ETH_PHY_PowerControl             
210   DV_ETH.c (300) [WARNING] Low power is not supported
211 TEST 09: ETH_PHY_Config                   PASSED
212 TEST 10: ETH_Loopback_Transfer            PASSED
213 TEST 11: ETH_PHY_CheckInvalidInit         NOT EXECUTED
214 TEST 12: ETH_MAC_CheckInvalidInit         NOT EXECUTED
215
216 Test Summary: 12 Tests, 10 Executed, 7 Passed, 0 Failed, 3 Warnings.
217 Test Result: WARNING
218 </pre><p>If you see warnings during loopback transfer tests, please read the section <a class="el" href="test_results.html">Reading Test Results</a> which gives you more information on how to interpret the results. </p>
219 </div></div><!-- contents -->
220 </div><!-- doc-content -->
221 <!-- start footer part -->
222 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
223   <ul>
224     <li class="footer">Generated on Fri Oct 4 2019 14:13:04 for CMSIS-Driver Validation by ARM Ltd. All rights reserved.
225         <!--
226     <a href="http://www.doxygen.org/index.html">
227     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
228         -->
229         </li>
230   </ul>
231 </div>
232 </body>
233 </html>