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">
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <title>CMSIS-Driver Validation: 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);
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); });
25 <link href="stylsheetf" rel="stylesheet" type="text/css" />
28 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
30 <table cellspacing="0" cellpadding="0">
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  <span id="projectnumber">Version 3.0.0</span>
38 <div id="projectbrief">Driver Validation</div>
44 <!-- end header part -->
45 <div id="DRVnav" class="tabs1">
47 <script type="text/javascript">
49 writeComponentTabs.call(this);
54 <!-- Generated by Doxygen 1.8.6 -->
55 <script type="text/javascript">
56 var searchBox = new SearchBox("searchBox", "search",false,'Search');
58 <div id="navrow1" class="tabs">
60 <li><a href="index.html"><span>Main Page</span></a></li>
61 <li class="current"><a href="pages.html"><span>Usage and Description</span></a></li>
62 <li><a href="modules.html"><span>Reference</span></a></li>
64 <div id="MSearchBox" class="MSearchBoxInactive">
66 <img id="MSearchSelect" src="search/mag_sel.png"
67 onmouseover="return searchBox.OnSearchSelectShow()"
68 onmouseout="return searchBox.OnSearchSelectHide()"
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>
82 <div id="side-nav" class="ui-resizable side-nav-resizable">
84 <div id="nav-tree-contents">
85 <div id="nav-sync" class="sync"></div>
88 <div id="splitbar" style="-moz-user-select:none;"
89 class="ui-resizable-handle">
92 <script type="text/javascript">
93 $(document).ready(function(){initNavTree('setup.html','');});
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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Pages</a></div>
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">
111 <div class="headertitle">
112 <div class="title">Setup </div> </div>
114 <div class="contents">
115 <div class="textblock"><h1><a class="anchor" id="step1"></a>
116 Step 1: Create an MDK project for your target microcontroller device</h1>
117 <h1><a class="anchor" id="step2"></a>
118 Step 2: Add the required software components</h1>
119 <p>For proper operation, add the following software components in the <b>Manage Run-Time Environment</b> window:</p>
121 <li><b>CMSIS Driver Validation: Framework</b></li>
122 <li><b>CMSIS Driver Validation: driver</b>, driver interfaces to be tested</li>
123 <li><b>CMSIS Driver: driver</b>, driver implementations to be tested</li>
124 <li><b>CMSIS: RTOS2 (API): Keil RTX5</b></li>
125 <li><b>Compiler: I/O: STDOUT</b>, variant <b>ITM</b> (if your hardware does not support ITM select <b>EVR</b> to use Event Recorder instead of ITM)</li>
126 <li>Resolve any unresolved component dependencies</li>
128 <h1><a class="anchor" id="step3"></a>
129 Step 3: Add the application's main file (main.c)</h1>
130 <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>CMSIS-RTOS2 'main' function</b> file from <b>CMSIS: RTOS2:Keil RTX5</b>.</p>
131 <p>Add this include: </p>
132 <div class="fragment"><div class="line"><span class="preprocessor">#include "cmsis_dv.h"</span></div>
133 </div><!-- fragment --><p>In the <code>app_main</code> function, create the <code>cmsis_dv</code> thread, before endless <code>for</code> loop: </p>
134 <div class="fragment"><div class="line">osThreadNew(<a class="code" href="group__framework__funcs.html#ga6e9dc1a6a5392afdf07478bd6b159287">cmsis_dv</a>, NULL, NULL);</div>
135 </div><!-- fragment --><p> to run all the tests that you have chosen in the next step.</p>
136 <h1><a class="anchor" id="step4"></a>
137 Step 4: Configure the CMSIS-Driver Validation framework in DV_Config.h file</h1>
138 <p>Open <b>DV_Config.h</b> under the <b>CMSIS Driver Validation</b> group in the Project window.</p>
139 <p>In the configuration file <b>DV_Config.h</b> select <b>Plain Text</b> as the <b>Report Format</b>.</p>
140 <h1><a class="anchor" id="step5"></a>
141 Step 5: Configure the interface settings and tests in related DV_interface_Config.h files</h1>
142 <p>Each interface has a related <b>DV_<em>interface</em>_Config.h</b> file, where <em>interface</em> represents interface's acronym or abbreviation.<br/>
143 For example for Serial Peripheral Interface (SPI) related config file name is DV_SPI_Config.h.</p>
144 <p>For details on interface specific configuration and test selection please check the Configuration section in the <a href="./modules.html" class="el">Reference</a> of the related interface.</p>
145 <h1><a class="anchor" id="step6"></a>
146 Step 6: Configure the Heap memory</h1>
147 <p>Depending on the buffer sizes used for data transfer tests the heap size has to be adjusted to provide enough memory for these buffers to be allocated.<br/>
148 Depending on how heap is configured in your system, open your <b>startup_<em>device</em>.s</b> file from the <b>Device</b> group in the <b>Project</b> window or use a <b>linker script</b> to adjust the heap size.<br/>
149 Set the <b>heap size</b> to minimum of <b>16384</b> bytes.</p>
150 <p>For details on heap requirements please refer to the <a class="el" href="resource_requirements.html#heap_req">Heap Memory requirements</a> documentation.</p>
151 <h1><a class="anchor" id="step7"></a>
152 Step 7: Configure the CMSIS-RTOS2 (Keil RTX5)</h1>
153 <p>Open <b>RTX_Config.h</b> and set:</p>
155 <li><b>System Configuration: Global Dynamic Memory size [bytes]</b> to <em>16384</em> </li>
156 <li><b>Thread configuration: Default Thread stack size [bytes]</b> to <em>3072</em> </li>
158 <p>For details on CMSIS-RTOS2 requirements please refer to the <a class="el" href="resource_requirements.html#rtos2_req">CMSIS-RTOS2 requirements</a> documentation.</p>
159 <h1><a class="anchor" id="step8"></a>
160 Step 8: Configure the Device</h1>
161 <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 or with a vendor provided pin configuration tool. Enable all interfaces you wish to test and make all necessary pin-out changes required by your actual board layout (consult the board schematics).<br/>
162 You can check the provided <a class="el" href="examples.html">examples</a> as a reference point.</p>
163 <p>For a robust test with good coverage, implement various targets with different settings:</p>
165 <li>Use <b>non-DMA (IRQ)</b> and <b>DMA</b> configurations if they are available on the driver</li>
166 <li>Use different compiler <b>optimization 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>
168 <h1><a class="anchor" id="step9"></a>
169 Step 9: Setup the required hardware</h1>
170 <p>For the interfaces that support loopback testing: <a class="el" href="group__dv__eth.html">Ethernet</a>, <a class="el" href="group__dv__usart.html">USART</a> and <a class="el" href="group__dv__spi.html">SPI</a>, connect the following pins on your target hardware together (refer to the hardware schematics):</p>
172 <li>Ethernet: RX+ and TX+, RX- and TX-</li>
173 <li>USART: RX and TX</li>
174 <li>SPI: MOSI and MISO</li>
176 <p>For the interfaces that support testing with dedicated server: <a class="el" href="group__dv__wifi.html">WiFi</a> and <a class="el" href="group__dv__spi.html">SPI</a>, connect the related hardware as required by the related server:</p>
178 <li>WiFi: WiFi module has to be in close proximity to the Access Point which is in the same network as the required <a class="el" href="group__wifi__sock__setup.html">SockServer</a></li>
179 <li>SPI: MOSI, MISO, SCLK, SS, GND to the same lines on the <a class="el" href="group__spi__server.html">SPI Server</a></li>
181 <h1><a class="anchor" id="step10"></a>
182 Step 10: Download and Run the Project</h1>
183 <p>In the <b>Options for Target</b> dialog, under debug settings, if you use ITM as standard output channel ensure that <b>Trace</b> and <b>ITM port 0</b> are enabled and that the correct <b>Core Clock</b> frequency is set:</p>
185 <img src="target_dialog.png" alt="target_dialog.png"/>
186 <div class="caption">
187 ITM Channel setting</div></div>
188 <p> Build, load and run the project. The output is displayed in the <b>Debug (printf) Viewer</b> window.<br/>
189 Example below shows output result of an SPI driver testing: </p>
190 <pre class="fragment">CMSIS-Driver_Validation v3.0.0 CMSIS-Driver SPI Test Report March 30 2022 13:44:11
192 TEST 01: SPI_GetVersion
193 DV_SPI.c (1023): [INFO] Driver API version 2.3, Driver version 2.15
195 TEST 02: SPI_GetCapabilities PASSED
196 TEST 03: SPI_Initialize_Uninitialize PASSED
197 TEST 04: SPI_PowerControl
198 DV_SPI.c (1314): [WARNING] PowerControl (ARM_POWER_LOW) is not supported
200 TEST 05: SPI_Mode_Master_SS_Unused PASSED
201 TEST 06: SPI_Mode_Master_SS_Sw_Ctrl PASSED
202 TEST 07: SPI_Mode_Master_SS_Hw_Ctrl_Out PASSED
203 TEST 08: SPI_Mode_Master_SS_Hw_Mon_In PASSED
204 TEST 09: SPI_Mode_Slave_SS_Hw_Mon PASSED
205 TEST 10: SPI_Mode_Slave_SS_Sw_Ctrl PASSED
206 TEST 11: SPI_Format_Clock_Pol0_Pha0 PASSED
207 TEST 12: SPI_Format_Clock_Pol0_Pha1 PASSED
208 TEST 13: SPI_Format_Clock_Pol1_Pha0 PASSED
209 TEST 14: SPI_Format_Clock_Pol1_Pha1 PASSED
210 TEST 15: SPI_Format_Frame_TI PASSED
211 TEST 16: SPI_Format_Clock_Microwire NOT EXECUTED
212 TEST 17: SPI_Data_Bits_1 NOT EXECUTED
213 TEST 18: SPI_Data_Bits_2 NOT EXECUTED
214 TEST 19: SPI_Data_Bits_3 NOT EXECUTED
215 TEST 20: SPI_Data_Bits_4 NOT EXECUTED
216 TEST 21: SPI_Data_Bits_5 NOT EXECUTED
217 TEST 22: SPI_Data_Bits_6 NOT EXECUTED
218 TEST 23: SPI_Data_Bits_7 NOT EXECUTED
219 TEST 24: SPI_Data_Bits_8 PASSED
220 TEST 25: SPI_Data_Bits_9 NOT EXECUTED
221 TEST 26: SPI_Data_Bits_10 NOT EXECUTED
222 TEST 27: SPI_Data_Bits_11 NOT EXECUTED
223 TEST 28: SPI_Data_Bits_12 NOT EXECUTED
224 TEST 29: SPI_Data_Bits_13 NOT EXECUTED
225 TEST 30: SPI_Data_Bits_14 NOT EXECUTED
226 TEST 31: SPI_Data_Bits_15 NOT EXECUTED
227 TEST 32: SPI_Data_Bits_16 PASSED
228 TEST 33: SPI_Data_Bits_17 NOT EXECUTED
229 TEST 34: SPI_Data_Bits_18 NOT EXECUTED
230 TEST 35: SPI_Data_Bits_19 NOT EXECUTED
231 TEST 36: SPI_Data_Bits_20 NOT EXECUTED
232 TEST 37: SPI_Data_Bits_21 NOT EXECUTED
233 TEST 38: SPI_Data_Bits_22 NOT EXECUTED
234 TEST 39: SPI_Data_Bits_23 NOT EXECUTED
235 TEST 40: SPI_Data_Bits_24 NOT EXECUTED
236 TEST 41: SPI_Data_Bits_25 NOT EXECUTED
237 TEST 42: SPI_Data_Bits_26 NOT EXECUTED
238 TEST 43: SPI_Data_Bits_27 NOT EXECUTED
239 TEST 44: SPI_Data_Bits_28 NOT EXECUTED
240 TEST 45: SPI_Data_Bits_29 NOT EXECUTED
241 TEST 46: SPI_Data_Bits_30 NOT EXECUTED
242 TEST 47: SPI_Data_Bits_31 NOT EXECUTED
243 TEST 48: SPI_Data_Bits_32 NOT EXECUTED
244 TEST 49: SPI_Bit_Order_MSB_LSB PASSED
245 TEST 50: SPI_Bit_Order_LSB_MSB PASSED
246 TEST 51: SPI_Bus_Speed_Min PASSED
247 TEST 52: SPI_Bus_Speed_Max
248 DV_SPI.c (3524): [WARNING] At requested bus speed of 10000000 bps, effective bus speed is 6477809 bps
250 TEST 53: SPI_Number_Of_Items PASSED
251 TEST 54: SPI_Abort PASSED
252 TEST 55: SPI_DataLost PASSED
253 TEST 56: SPI_ModeFault PASSED
255 Test Summary: 56 Tests, 25 Passed, 0 Failed.
257 </pre> </div></div><!-- contents -->
258 </div><!-- doc-content -->
259 <!-- start footer part -->
260 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
262 <li class="footer">Generated on Fri Jul 15 2022 08:42:08 for CMSIS-Driver Validation by ARM Ltd. All rights reserved.
264 <a href="http://www.doxygen.org/index.html">
265 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6