1 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
3 \defgroup usart_config Configuration
6 The USART driver validation settings are available in the <b>DV_USART_Config.h</b> configuration file.
8 \image html dv_usart_config_h.png "DV_USART_Config.h configuration file in Configuration Wizard view mode"
10 Some settings depend on the test environment and need to be changed for proper operation of the USART driver validation.<br>
12 \section usart_config_detail Configuration settings
14 <b>Driver_USART#</b> selects the driver instance that will be tested.<br>
15 For example if we want to test <c>Driver_USART2</c> then this setting would be set to <c>2</c>.
17 <b>Configuration</b> section contains configuration of: Test Mode, USART Server and Tests settings:
18 - <b>Test Mode</b> can be set to <b>Loopback</b> or <b>USART Server</b>.<br>
19 Loopback mode should be used for initial validation.<br>
20 Loopback mode requires that Tx and Rx pins are connected together thus driver validation can test basic
22 <b>For full compliance of the USART driver with the CMSIS-Driver USART specification the USART Server Test Mode has to be used.</b>
23 - <b>USART Server</b> settings are relevant if <b>Test Mode: USART Server</b> is selected.<br>
24 These settings specify communication settings at which Driver Validation communicates with the USART Server<br>
25 and <b>must be same as configured on the USART Server.</b>
26 - Some settings are fixed and cannot be changed, these are the following ones:
27 - <b>Baudrate: 115200</b>
31 - <b>Flow Control: None</b>
32 - Only configurable setting for the USART Server is:
33 - <b>Mode</b> setting specifies the mode for communication with USART Server.<br>
34 Different modes require different physical connection and also USART Server must use same setting.<br>
35 For details on modes please check \ref usart_server_con "USART Server connection".
36 - <b>Tests</b> settings specify tests configuration:
37 - <b>Default settings</b> specifies the default settings used in the data exchange tests.<br>
38 Usually, one feature is tested by executing the data exchange while all other parameters are used as default.<br>
39 For details on which parameters are used as default in each test function please refer to \ref usart_tests_data_xchg
40 functions documentation.
41 - <b>Baudrate</b> settings specifies minimum and maximum bus speeds at which data transfer will be executed.<br>
42 These settings are used by the \ref USART_Baudrate_Min and \ref USART_Baudrate_Max test functions.
43 - <b>Number of Items</b> settings specifies a few different number of items to be tested.<br>
44 These settings are used by the \ref USART_Number_Of_Items test function which tests that odd and unusual number of items
45 are transferred correctly according to the CMSIS-Driver specification.
47 <b>Tests</b> section contains selection of tests to be executed:
48 - <b>Driver Management</b> allows enabling or disabling of the whole driver management group of test functions.<br>
49 Each test function in this group can be enabled or disabled individually, for details on tests performed
50 by each test function please refer to \ref usart_tests_drv_mgmt documentation.
51 - <b>Data Exchange</b> allows enabling or disabling of the whole data exchange group of test functions.<br>
52 Each test function in this group can be enabled or disabled individually, for details on tests performed
53 by each test function please refer to \ref usart_tests_data_xchg documentation.
54 - <b>Modem</b> allows enabling or disabling of the whole modem lines group of test functions.<br>
55 Each test function in this group can be enabled or disabled individually, for details on tests performed
56 by each test function please refer to \ref usart_tests_modem documentation.
57 - <b>Event</b> allows enabling or disabling of the whole event group of test functions.<br>
58 Each test function in this group can be enabled or disabled individually, for details on tests performed
59 by each test function please refer to \ref usart_tests_evt documentation.
63 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
65 \defgroup usart_server USART Server
68 The <b>USART Server</b> is an application providing a set of features used by the CMSIS-Driver Validation suite to test the
69 physical operation of the USART driver.<br>
70 It is located in the <c>\<pack root directory\></c><b>\\Tools\\USART_Server</b> directory.
72 The USART Server offers the following features:
73 - read of the <b>version</b> information
74 - read of the <b>capabilities</b> information
75 - set and read of the <b>data buffers content</b>
76 - read of the last <b>send/receive/transfer count</b>
78 - <b>reception</b> of data
79 - <b>transfer</b> in synchronous mode
80 - generation of <b>break</b> signal
81 - read of <b>break</b> signal status
82 - control of <b>modem lines</b>
83 - read of <b>modem lines</b> state
85 \section usart_server_oper Operation
87 The USART Server is continuously waiting on a command from the USART Client (Driver Validation),
88 after the command is received it is executed, and the process repeats.<br>
89 Most commands do not have any additional related data phase, but some do have additional input or output
90 data exchange phase following the command.
92 \section usart_server_config Configuration
94 Communication interface settings used during command exchange are set in the <b>USART_Server_Config.h</b> configuration file.
95 \image html usart_server_config_h.png "USART_Server_Config.h configuration file in Configuration Wizard view mode"
97 \subsection usart_server_config_detail Configuration settings
99 <b>Driver_USART#</b> selects the driver instance used by the USART Server.<br>
100 <b>Communication settings</b> specify the communication parameters for command exchange with the USART Client:
101 - <b>Mode</b> setting specifies the mode used for command exchange.
102 Different modes require different physical connection and also USART Server must use same setting.<br>
103 For details on modes please check \ref usart_server_con "USART Server connection".
105 Fixed communication settings used for command exchange with the USART Client are:
106 - <b>Baudrate: 115200</b>
107 - <b>Data Bits: 8</b>
108 - <b>Parity: None</b>
109 - <b>Stop Bits: 1</b>
110 - <b>Flow Control: None</b>
112 \section usart_server_commands Commands
114 Commands are encoded in human readable format (ASCII strings) so they can be viewed by the USART bus analyzer
115 and analyzed more easily.
118 - <b>GET VER</b>: used to retrieve the version of the USART Server application
119 - <b>GET CAP</b>: used to retrieve the capabilities of the USART Server
120 (the Server auto-detects capabilities upon reception of this command)
121 - <b>SET BUF</b>: used for initialization of the content of receive or transmit buffer of the USART Server
122 - <b>GET BUF</b>: used for retrieving the content of receive or transmit buffer of the USART Server
123 - <b>SET COM</b>: used for specifying configuration of the send/receive/transfer activated by the XFER command
124 - <b>XFER</b>: used to trigger a send/receive/transfer (parameters specified with the last SET COM command)
125 - <b>GET CNT</b>: used to retrieve the number of sent/received/transferred items in previous send/receive/transfer
126 - <b>SET BRK</b>: used to instruct USART Server to generate break signal
127 - <b>GET BRK</b>: used to retrieve break signal status on the USART Server
128 - <b>SET MDM</b>: used for activation of modem lines
129 - <b>GET MDM</b>: used to retrieve modem lines status on the USART Server
131 \note For details about commands please refer to <b>Abstract.txt</b> file in the
132 <c>\<pack root directory\></c>\\Tools\\USART_Server\\Board\\MCBSTM32F400 directory.
134 Picture below shows a capture of USART Driver Validation validating functionality of the Send function in the Asynchronous mode
135 \image html usart_bus_async_send.png
137 \section usart_server_porting Porting USART Server to other targets
139 To create USART Server application for a different target device, follow the steps below:
140 -# Create a new project in µVision for your target device
141 -# In the RTE window enable and configure the following software components:
143 - <b>CMSIS: RTOS2 (API): Keil RTX5</b> any variant
144 - <b>CMSIS Driver: USART (API)</b>
145 - <b>CMSIS Driver: VIO (API)</b> select <b>Virtual</b> implementation if implementation for your target system is not available
146 - Generic device specific components (startup, clock system, I/O, ...) as required
147 (please consult device's documentation for more information)
148 - Resolve any unresolved dependencies between components
149 -# Copy the <b>USART_Server.c</b> file from the <c>\<pack root directory\></c><b>\\Tools\\USART_Server\\Source</b> directory
150 to the project root and add it to µVision project
151 -# Copy the <b>USART_Server.h</b> file from the <c>\<pack root directory\></c><b>\\Tools\\USART_Server\\Include</b>
152 directory to the project root
153 -# Copy the files specified below from the directory <c>\<pack root directory\></c><b>\\Tools\\USART_Server\\Config</b> to the project root:
154 - <b>USART_Server_Config.h</b>: also adapt this file as required by your device
155 - <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
156 testing of the DCD and RI lines
157 -# Add root of the project to include path (<b>Options for Target</b> -> <b>C/C++</b> -> <b>Include Paths: .\\</b>)
158 -# Add the <b>main.c</b> file from a template
159 (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
160 <b>CMSIS-RTOS2 'main' function</b> file from <b>CMSIS: RTOS2:Keil RTX5</b>)
161 and update with code snippet below (replace <c>app_main</c> function):
163 #include "USART_Server.h"
165 /*----------------------------------------------------------------------------
166 * Application main thread
167 *---------------------------------------------------------------------------*/
168 __NO_RETURN static void app_main (void *argument) {
170 USART_Server_Start();
174 -# Build and download the ported USART Server application to the target device
176 \section usart_server_troubleshooting Troubleshooting
178 Problems and solutions:
179 1. USART Server is not responding to commands
180 - reset the USART Server
181 - check that correct driver instance is selected in the USART_Server_Config.h file
182 - check that communication settings (mode) between USART Server and USART Driver Validation are the same,<br>
183 if they are not, correct them, rebuild the application and download to the hardware
184 2. USART Server is not responding to commands it reports "Server Start failed!" message
185 if debug variant is used
186 - check heap settings
187 (it has to be larger than 2 * USART_SERVER_BUF_SIZE specified in the USART_Server_Config.h file)
188 - check that RTOS allows allocation of at least 512 bytes for the USART Server main thread
189 (Global Dynamic Memory size [bytes] setting in RTX_Config.h file if RTX5 is used)
190 - check that USART driver used for USART Server supports selected mode and all fixed settings:
197 \section usart_server_MCBSTM32F400 USART Server on the Keil MCBSTM32F400
199 µVision project and source files for the MCBSTM32F400 board are available in the <c>\<pack root directory\></c><b>\\Tools\\USART_Server\\Board\\MCBSTM32F400</b> directory.
201 On the Keil MCBSTM32F400 the <b>USART1</b> interface is used, with the following pinout:
203 | USART function | Pin |
204 | :------------- | :----: |
207 | CLK (synchro) | PA8 |
210 | DCD test pin | PA9 |
211 | RI test pin | PA10 |
213 \note IMPORTANT: Ground must be connected between USART Server and Device (Driver) Under Test
214 so that USART signals have same ground potential.
216 For more information please consult <b>Abstract.txt</b> file in the project root.
218 \note For synchronous mode testing this device's hardware supports only synchronous Master mode,
219 so it can only be used for testing synchronous Slave mode of the Driver Under Test.
222 \section usart_server_STM32F429I_DISC1 USART Server on the STMicroelectronics STM32F429I-DISC1 (32F429IDISCOVERY) board
224 µVision project and source files for the STM32F429I-DISC1 board are available in the <c>\<pack root directory\></c><b>\\Tools\\USART_Server\\Board\\STM32F429I-DISC1</b> directory.
226 On the STMicroelectronics STM32F429I-DISC1 board the <b>USART1</b> interface is used, with the following pinout:
228 | USART function | Pin |
229 | :------------- | :----: |
232 | CLK (synchro) | PA8 |
235 | DCD test pin | PA13 |
236 | RI test pin | PA14 |
238 \note IMPORTANT: Ground must be connected between USART Server and Device (Driver) Under Test
239 so that USART signals have same ground potential.
241 For more information please consult <b>Abstract.txt</b> file in the project root.
243 \note For synchronous mode testing this device's hardware supports only synchronous Master mode,
244 so it can only be used for testing synchronous Slave mode of the Driver Under Test.