]> begriffs open source - cmsis-driver-validation/blob - docs/html/group__usart__server.html
use https url
[cmsis-driver-validation] / docs / html / group__usart__server.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>USART Server</title>
7 <title>CMSIS-Driver Validation: USART Server</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 3.0.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><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('group__usart__server.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>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><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">USART Server<div class="ingroups"><a class="el" href="group__dv__usart.html">USART Validation</a></div></div>  </div>
113 </div><!--header-->
114 <div class="contents">
115 <p>The <b>USART Server</b> is an application providing a set of features used by the CMSIS-Driver Validation suite to test the physical operation of the USART driver.<br/>
116  It is located in the <code>&lt;pack root directory&gt;</code><b>\Tools\USART_Server</b> directory.</p>
117 <p>The USART Server offers the following features:</p>
118 <ul>
119 <li>read of the <b>version</b> information</li>
120 <li>read of the <b>capabilities</b> information</li>
121 <li>set and read of the <b>data buffers content</b></li>
122 <li>read of the last <b>send/receive/transfer count</b></li>
123 <li><b>send</b> of data</li>
124 <li><b>reception</b> of data</li>
125 <li><b>transfer</b> in synchronous mode</li>
126 <li>generation of <b>break</b> signal</li>
127 <li>read of <b>break</b> signal status</li>
128 <li>control of <b>modem lines</b></li>
129 <li>read of <b>modem lines</b> state</li>
130 </ul>
131 <h1><a class="anchor" id="usart_server_oper"></a>
132 Operation</h1>
133 <p>The USART Server is continuously waiting on a command from the USART Client (Driver Validation), after the command is received it is executed, and the process repeats.<br/>
134  Most commands do not have any additional related data phase, but some do have additional input or output data exchange phase following the command.</p>
135 <h1><a class="anchor" id="usart_server_config"></a>
136 Configuration</h1>
137 <p>Communication interface settings used during command exchange are set in the <b>USART_Server_Config.h</b> configuration file. </p>
138 <div class="image">
139 <img src="usart_server_config_h.png" alt="usart_server_config_h.png"/>
140 <div class="caption">
141 USART_Server_Config.h configuration file in Configuration Wizard view mode</div></div>
142  <h2><a class="anchor" id="usart_server_config_detail"></a>
143 Configuration settings</h2>
144 <p><b>Driver_USART#</b> selects the driver instance used by the USART Server.<br/>
145  <b>Communication settings</b> specify the communication parameters for command exchange with the USART Client:</p>
146 <ul>
147 <li><b>Mode</b> setting specifies the mode used for command exchange. Different modes require different physical connection and also USART Server must use same setting.<br/>
148  For details on modes please check <a class="el" href="group__dv__usart.html#usart_server_con">USART Server connection</a>.</li>
149 </ul>
150 <p>Fixed communication settings used for command exchange with the USART Client are:</p>
151 <ul>
152 <li><b>Baudrate: 115200</b></li>
153 <li><b>Data Bits: 8</b></li>
154 <li><b>Parity: None</b></li>
155 <li><b>Stop Bits: 1</b></li>
156 <li><b>Flow Control: None</b></li>
157 </ul>
158 <h1><a class="anchor" id="usart_server_commands"></a>
159 Commands</h1>
160 <p>Commands are encoded in human readable format (ASCII strings) so they can be viewed by the USART bus analyzer and analyzed more easily.</p>
161 <p>Supported commands:</p>
162 <ul>
163 <li><b>GET VER</b>: used to retrieve the version of the USART Server application</li>
164 <li><b>GET CAP</b>: used to retrieve the capabilities of the USART Server (the Server auto-detects capabilities upon reception of this command)</li>
165 <li><b>SET BUF</b>: used for initialization of the content of receive or transmit buffer of the USART Server</li>
166 <li><b>GET BUF</b>: used for retrieving the content of receive or transmit buffer of the USART Server</li>
167 <li><b>SET COM</b>: used for specifying configuration of the send/receive/transfer activated by the XFER command</li>
168 <li><b>XFER</b>: used to trigger a send/receive/transfer (parameters specified with the last SET COM command)</li>
169 <li><b>GET CNT</b>: used to retrieve the number of sent/received/transferred items in previous send/receive/transfer</li>
170 <li><b>SET BRK</b>: used to instruct USART Server to generate break signal</li>
171 <li><b>GET BRK</b>: used to retrieve break signal status on the USART Server</li>
172 <li><b>SET MDM</b>: used for activation of modem lines</li>
173 <li><b>GET MDM</b>: used to retrieve modem lines status on the USART Server</li>
174 </ul>
175 <dl class="section note"><dt>Note</dt><dd>For details about commands please refer to <b>Abstract.txt</b> file in the <code>&lt;pack root directory&gt;</code>\Tools\USART_Server\Board\MCBSTM32F400 directory.</dd></dl>
176 <p>Picture below shows a capture of USART Driver Validation validating functionality of the Send function in the Asynchronous mode </p>
177 <div class="image">
178 <img src="usart_bus_async_send.png" alt="usart_bus_async_send.png"/>
179 </div>
180 <h1><a class="anchor" id="usart_server_porting"></a>
181 Porting USART Server to other targets</h1>
182 <p>To create USART Server application for a different target device, follow the steps below:</p>
183 <ol type="1">
184 <li>Create a new project in µVision for your target device</li>
185 <li>In the RTE window enable and configure the following software components:<ul>
186 <li><b>CMSIS: CORE</b></li>
187 <li><b>CMSIS: RTOS2 (API): Keil RTX5</b> any variant</li>
188 <li><b>CMSIS Driver: USART (API)</b></li>
189 <li><b>CMSIS Driver: VIO (API)</b> select <b>Virtual</b> implementation if implementation for your target system is not available</li>
190 <li>Generic device specific components (startup, clock system, I/O, ...) as required (please consult device's documentation for more information)</li>
191 <li>Resolve any unresolved dependencies between components</li>
192 </ul>
193 </li>
194 <li>Copy the <b>USART_Server.c</b> file from the <code>&lt;pack root directory&gt;</code><b>\Tools\USART_Server\Source</b> directory to the project root and add it to µVision project</li>
195 <li>Copy the <b>USART_Server.h</b> file from the <code>&lt;pack root directory&gt;</code><b>\Tools\USART_Server\Include</b> directory to the project root</li>
196 <li>Copy the files specified below from the directory <code>&lt;pack root directory&gt;</code><b>\Tools\USART_Server\Config</b> to the project root:<ul>
197 <li><b>USART_Server_Config.h</b>: also adapt this file as required by your device</li>
198 <li><b>USART_Server_HW.c</b>: add this file to the µVision project also adapt it for your device's specific handling of the GPIO lines for testing of the DCD and RI lines</li>
199 </ul>
200 </li>
201 <li>Add root of the project to include path (<b>Options for Target</b> -&gt; <b>C/C++</b> -&gt; <b>Include Paths: .\</b>)</li>
202 <li>Add the <b>main.c</b> file from a template (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>) and update with code snippet below (replace <code>app_main</code> function): <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;USART_Server.h&quot;</span></div>
203 <div class="line"> </div>
204 <div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
205 <div class="line"><span class="comment"> * Application main thread</span></div>
206 <div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
207 <div class="line">__NO_RETURN <span class="keyword">static</span> <span class="keywordtype">void</span> app_main (<span class="keywordtype">void</span> *argument) {</div>
208 <div class="line">  (void)argument;</div>
209 <div class="line">  USART_Server_Start();</div>
210 <div class="line">  <span class="keywordflow">for</span> (;;) {}</div>
211 <div class="line">}</div>
212 </div><!-- fragment --></li>
213 <li>Build and download the ported USART Server application to the target device</li>
214 </ol>
215 <h1><a class="anchor" id="usart_server_troubleshooting"></a>
216 Troubleshooting</h1>
217 <p>Problems and solutions:</p>
218 <ol type="1">
219 <li>USART Server is not responding to commands<ul>
220 <li>reset the USART Server</li>
221 <li>check that correct driver instance is selected in the USART_Server_Config.h file</li>
222 <li>check that communication settings (mode) between USART Server and USART Driver Validation are the same,<br/>
223  if they are not, correct them, rebuild the application and download to the hardware</li>
224 </ul>
225 </li>
226 <li>USART Server is not responding to commands it reports "Server Start failed!" message if debug variant is used<ul>
227 <li>check heap settings (it has to be larger than 2 * USART_SERVER_BUF_SIZE specified in the USART_Server_Config.h file)</li>
228 <li>check that RTOS allows allocation of at least 512 bytes for the USART Server main thread (Global Dynamic Memory size [bytes] setting in RTX_Config.h file if RTX5 is used)</li>
229 <li>check that USART driver used for USART Server supports selected mode and all fixed settings:<ul>
230 <li>Baudrate: 115200</li>
231 <li>Data Bits: 8</li>
232 <li>Parity: None</li>
233 <li>Stop Bits: 1</li>
234 <li>Flow Control: None</li>
235 </ul>
236 </li>
237 </ul>
238 </li>
239 </ol>
240 <h1><a class="anchor" id="usart_server_MCBSTM32F400"></a>
241 USART Server on the Keil MCBSTM32F400</h1>
242 <p>µVision project and source files for the MCBSTM32F400 board are available in the <code>&lt;pack root directory&gt;</code><b>\Tools\USART_Server\Board\MCBSTM32F400</b> directory.</p>
243 <p>On the Keil MCBSTM32F400 the <b>USART1</b> interface is used, with the following pinout:</p>
244 <table class="doxtable">
245 <tr>
246 <th align="left">USART function </th><th align="center">Pin  </th></tr>
247 <tr>
248 <td align="left">Tx </td><td align="center">PB6 </td></tr>
249 <tr>
250 <td align="left">Rx </td><td align="center">PB7 </td></tr>
251 <tr>
252 <td align="left">CLK (synchro) </td><td align="center">PA8 </td></tr>
253 <tr>
254 <td align="left">CTS </td><td align="center">PA11 </td></tr>
255 <tr>
256 <td align="left">RTS </td><td align="center">PA12 </td></tr>
257 <tr>
258 <td align="left">DCD test pin </td><td align="center">PA9 </td></tr>
259 <tr>
260 <td align="left">RI test pin </td><td align="center">PA10 </td></tr>
261 </table>
262 <dl class="section note"><dt>Note</dt><dd>IMPORTANT: Ground must be connected between USART Server and Device (Driver) Under Test so that USART signals have same ground potential.</dd></dl>
263 <p>For more information please consult <b>Abstract.txt</b> file in the project root.</p>
264 <dl class="section note"><dt>Note</dt><dd>For synchronous mode testing this device's hardware supports only synchronous Master mode, so it can only be used for testing synchronous Slave mode of the Driver Under Test.</dd></dl>
265 <h1><a class="anchor" id="usart_server_STM32F429I_DISC1"></a>
266 USART Server on the STMicroelectronics STM32F429I-DISC1 (32F429IDISCOVERY) board</h1>
267 <p>µVision project and source files for the STM32F429I-DISC1 board are available in the <code>&lt;pack root directory&gt;</code><b>\Tools\USART_Server\Board\STM32F429I-DISC1</b> directory.</p>
268 <p>On the STMicroelectronics STM32F429I-DISC1 board the <b>USART1</b> interface is used, with the following pinout:</p>
269 <table class="doxtable">
270 <tr>
271 <th align="left">USART function </th><th align="center">Pin  </th></tr>
272 <tr>
273 <td align="left">Tx </td><td align="center">PA9 </td></tr>
274 <tr>
275 <td align="left">Rx </td><td align="center">PA10 </td></tr>
276 <tr>
277 <td align="left">CLK (synchro) </td><td align="center">PA8 </td></tr>
278 <tr>
279 <td align="left">CTS </td><td align="center">PA11 </td></tr>
280 <tr>
281 <td align="left">RTS </td><td align="center">PA12 </td></tr>
282 <tr>
283 <td align="left">DCD test pin </td><td align="center">PA13 </td></tr>
284 <tr>
285 <td align="left">RI test pin </td><td align="center">PA14 </td></tr>
286 </table>
287 <dl class="section note"><dt>Note</dt><dd>IMPORTANT: Ground must be connected between USART Server and Device (Driver) Under Test so that USART signals have same ground potential.</dd></dl>
288 <p>For more information please consult <b>Abstract.txt</b> file in the project root.</p>
289 <dl class="section note"><dt>Note</dt><dd>For synchronous mode testing this device's hardware supports only synchronous Master mode, so it can only be used for testing synchronous Slave mode of the Driver Under Test. </dd></dl>
290 </div><!-- contents -->
291 </div><!-- doc-content -->
292 <!-- start footer part -->
293 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
294   <ul>
295     <li class="footer">Generated on Fri Jul 15 2022 08:42:08 for CMSIS-Driver Validation by ARM Ltd. All rights reserved.
296         <!--
297     <a href="http://www.doxygen.org/index.html">
298     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
299         -->
300         </li>
301   </ul>
302 </div>
303 </body>
304 </html>