]> begriffs open source - cmsis-driver-validation/blob - Doxygen/DriverValidation.txt
Minor update to USART driver validation
[cmsis-driver-validation] / Doxygen / DriverValidation.txt
1 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
2 /**
3 \mainpage Introduction
4
5 This manual explains the scope and the usage of the Software Pack for <b>CMSIS-Driver Validation</b>.<br>
6 <a href="http://www.keil.com/pack/doc/CMSIS/Driver/html/index.html" target="_blank">CMSIS-Driver</a> specifies the 
7 software API for peripheral driver interfaces that connect microcontroller peripherals with middleware or the user application. 
8
9 The CMSIS-Driver Validation is used to validate the driver implementation compliance to the CMSIS-Driver specification.
10
11 The CMSIS-Driver Validation provides:
12   - Configurable validation tests for various CMSIS-Driver interfaces
13   - Example projects that show the usage of the CMSIS-Driver Validation
14   - Various Servers used for testing
15
16 The CMSIS-Driver Validation tests and verifies:
17   - <b>API interface</b> using the driver capabilities as well as valid and invalid parameters
18   - <b>Data communication</b> with various transfer sizes and communication parameters:
19     - <b>Loopback testing</b> (for some interfaces) for testing of the underlying hardware with usage of a local loopback
20     - <b>Server testing</b> (for some interfaces) for extensive testing of the underlying hardware with usage of a dedicated Server
21   - <b>Transfer speed</b> of the data communication with time measurement of data transfer duration
22   - <b>Event</b> signaling
23
24 The CMSIS-Driver Validation requires
25 <a href="http://www.keil.com/pack/doc/CMSIS/RTOS2/html/index.html" target="_blank">CMSIS-RTOS2</a> functionality and can be
26 used to verify the setup and configuration of the CMSIS-Driver interfaces in a user system.<br>
27
28 The diagram below shows an overview of the CMSIS-Driver Validation configuration.
29
30 \image html cmsis_dv.png
31
32 This manual contains the following chapters:
33   - \ref setup                 - Describes the general setup of the CMSIS-Driver Validation test and how to generate test report.
34   - \ref report                - Describes the reports produced by the CMSIS-Driver Validation.
35   - \ref debugging             - Describes procedure for debugging of the interface drivers using the CMSIS-Driver Validation.
36   - \ref resource_requirements - Lists memory and CMSIS-RTOS2 requirements.
37   - \ref examples              - Contains information about several example projects including the required hardware setup.
38   - <a class="el" href="./modules.html">Reference</a> - Explains the configuration and tests for the various CMSIS-Driver interfaces.
39
40 The CMSIS-Driver Validation provides validation for the following interfaces:
41   - \ref dv_can   "CAN"        - Controller Area Network (CAN) interface driver.
42   - \ref dv_eth   "Ethernet"   - Ethernet MAC and PHY peripheral interface driver.
43   - \ref dv_i2c   "I2C"        - Inter-Integrated Circuit (I2C) multi-master serial single-ended bus interface driver.
44   - \ref dv_mci   "MCI"        - Memory Card Interface driver for SD/MMC memory.
45   - \ref dv_spi   "SPI"        - Serial Peripheral Interface (SPI) driver.
46   - \ref dv_usart "USART"      - Universal Synchronous and Asynchronous Receiver/Transmitter (USART) interface driver.
47   - \ref dv_usbd  "USB Device" - Universal Serial Bus (USB) Device interface driver.
48   - \ref dv_usbh  "USB Host"   - Universal Serial Bus (USB) Host interface driver.
49   - \ref dv_wifi  "WiFi"       - WiFi (Wireless Fidelity Interface) module/shield driver.
50
51 \note Extensive testing using dedicated Server is available for SPI and USART drivers.
52
53 This manual assumes that you are familiar with MDK. Refer to
54 <a href="http://www2.keil.com/mdk5/install" target="_blank">MDK Version 5 - Getting Started</a> for additional information.
55
56 <hr>
57
58 Revision History
59 ----------------
60
61 <table class="cmtable" summary="Revision History">
62     <tr>
63       <th>Version</th>
64       <th>Description</th>
65     </tr>
66
67     <tr>
68       <td>V3.0.0-dev10</td>
69       <td>
70       - Minor update to USART driver validation (data buffers aligned to 32 bytes for DMA testing, 
71         Tx Underflow and Rx Overflow tests not executed in synchronous master mode)
72       </td>
73     </tr>
74     <tr>
75       <td>V3.0.0-dev9</td>
76       <td>
77         - Minor update to SPI driver validation (enable Data Bits tests in loopback mode)
78         - Minor update to SPI_Server application (use software controlled Slave Select in Master mode)
79       </td>
80     </tr>
81     <tr>
82       <td>V3.0.0-dev8</td>
83       <td>
84         - Minor update to USART driver validation (corrected RTS/CTS tests, less strict Initialize/Uninitialize and PowerControl tests)
85       </td>
86     </tr>
87     <tr>
88       <td>V3.0.0-dev7</td>
89       <td>
90         - Add support for Arm Cortex-M85 processor based devices
91         - Add support for Arm China Star-MC1 processor based devices
92       </td>
93     </tr>
94     <tr>
95       <td>V3.0.0-dev6</td>
96       <td>
97         - Add pack version information in Test Report
98       </td>
99     </tr>
100     <tr>
101       <td>V3.0.0-dev5</td>
102       <td>
103         - Minor update to WiFi driver validation (less strict SocketAccept and SocektSend tests)
104       </td>
105     </tr>
106     <tr>
107       <td>V3.0.0-dev4</td>
108       <td>
109         - Minor update to USART driver validation (USART_TxBreak test documentation)
110       </td>
111     </tr>
112     <tr>
113       <td>V3.0.0-dev3</td>
114       <td>
115         - Update validation examples for Espressif ESP32, ESP8266 and WizNet WizFi360
116         - Add SockServer application for IMXRT1050-EVKB
117       </td>
118     </tr>
119     <tr>
120       <td>V3.0.0-dev2</td>
121       <td>
122         - Minor update of WiFi Driver non-blocking mode tests
123         - Update examples
124       </td>
125     </tr>
126     <tr>
127       <td>V3.0.0-dev1</td>
128       <td>
129         - Add WiFi Driver tests (socket functions in non-blocking mode)
130         - Update examples (WiFi Driver related)
131       </td>
132     </tr>
133     <tr>
134       <td>V3.0.0-dev0</td>
135       <td>
136         - Rework USART driver validation (introduced USART_Server)
137         - Add USART_Server application for Keil MCBSTM32F400 evaluation board
138         - Update examples
139         - Update documentation
140       </td>
141     </tr>
142     <tr>
143       <td>V2.0.1-dev2</td>
144       <td>
145         - Minor update to SPI driver validation documentation
146         - Minor update to SPI_Server
147       </td>
148     </tr>
149     <tr>
150       <td>V2.0.1-dev1</td>
151       <td>
152         - Improved robustness of SPI Driver testing
153         - Improved robustness of SPI Server
154       </td>
155     </tr>
156     <tr>
157       <td>V2.0.1-dev0</td>
158       <td>
159         - Minor update to SPI Driver testing
160       </td>
161     </tr>
162     <tr>
163       <td>V2.0.0</td>
164       <td>
165         - Remove bundle from components
166         - Change configuration from single file to a file per component
167         - Rework SPI Driver testing (introduced SPI_Server)
168         - Add SPI_Server application for Keil MCBSTM32F400 evaluation board
169         - Update WiFi Driver tests (support for WiFi Driver API V1.1.0)
170         - Update all examples
171         - Deprecate CMSIS-RTOS1
172       </td>
173     </tr>
174     <tr>
175       <td>V1.4.0</td>
176       <td>
177         - Updated conditions to support all Cortex-M devices
178         - Introduced test groups (each driver is organized in a group)
179         - Improved XSL for XML display
180         - Updated all examples
181         - Removed example for Atmel board
182         - WiFi Driver Testing: Added SockServer application for PC running Microsoft Windows
183         - WiFi Driver Testing: Added upstream and downstream bandwidth testing
184         - WiFi Driver Testing: Added example for Inventek ISM43362 WiFi Driver testing on STMicroelectronics B-L475E-IOT01A1 board
185         - WiFi Driver Testing: Added example for Inventek ISM43362 WiFi Driver testing using ISMART43362-E WiFi shield mounted on NXP LPCXpresso55S69 board
186         - WiFi Driver Testing: Added examples for Espressif ESP8266 and ESP32 WiFi Driver testing with NXP MIMXRT1064-EVK board
187         - WiFi Driver Testing: Added example for WIZnet WizFi360 WiFi Driver testing with NXP MIMXRT1064-EVK board
188       </td>
189     </tr>
190     <tr>
191       <td>V1.3.0</td>
192       <td>
193         - Added WiFi tests
194       </td>
195     </tr>
196     <tr>
197       <td>V1.2.0</td>
198       <td>
199         - Added CMSIS-RTOS2 and Arm Compiler 6 compatibility
200       </td>
201     </tr>
202     <tr>
203       <td>V1.1.0</td>
204       <td>
205         - Added USB Host, CAN and Ethernet Precision Time Protocol tests
206       </td>
207     </tr>
208     <tr>
209       <td>V1.0.0</td>
210       <td>
211         - Initial release for CMSIS-Driver API V2.0
212       </td>
213     </tr>
214  </table>
215
216
217 */
218 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
219 /**
220 \page setup Setup
221
222 \section step1 Step 1: Create an MDK project for your target microcontroller device
223
224
225 \section step2 Step 2: Add the required software components
226
227 For proper operation, add the following software components in the <b>Manage Run-Time Environment</b> window:
228 - <b>CMSIS Driver Validation: Framework</b>
229 - <b>CMSIS Driver Validation: driver</b>, driver interfaces to be tested
230 - <b>CMSIS Driver: driver</b>, driver implementations to be tested
231 - <b>CMSIS: RTOS2 (API): Keil RTX5</b>
232 - <b>Compiler: I/O: STDOUT</b>, variant \b ITM (if your hardware does not support ITM select \b EVR to use Event Recorder instead of ITM)
233 - Resolve any unresolved component dependencies
234
235
236 \section step3 Step 3: Add the application's main file (main.c)
237
238 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
239 <b>CMSIS-RTOS2 'main' function</b> file from <b>CMSIS: RTOS2:Keil RTX5</b>.
240
241 Add this include:
242 \code
243 #include "cmsis_dv.h"
244 \endcode
245
246 In the <c>app_main</c> function, create the \c cmsis_dv thread, before endless <c>for</c> loop:
247 \code
248 osThreadNew(cmsis_dv, NULL, NULL);
249 \endcode
250 to run all the tests that you have chosen in the next step.
251
252
253 \section step4 Step 4: Configure the CMSIS-Driver Validation framework in DV_Config.h file
254
255 Open <b>DV_Config.h</b> under the <b>CMSIS Driver Validation</b> group in the Project window.
256
257 In the configuration file <b>DV_Config.h</b> select <b>Plain Text</b> as the <b>Report Format</b>.
258
259 \section step5 Step 5: Configure the interface settings and tests in related DV_interface_Config.h files
260
261 Each interface has a related <b>DV_<i>interface</i>_Config.h</b> file, where <i>interface</i> represents interface's acronym or abbreviation.<br>
262 For example for Serial Peripheral Interface (SPI) related config file name is DV_SPI_Config.h.
263
264 For details on interface specific configuration and test selection please check the Configuration section in the 
265 <a class="el" href="./modules.html">Reference</a> of the related interface.
266
267
268 \section step6 Step 6: Configure the Heap memory
269
270 Depending on the buffer sizes used for data transfer tests the heap size has to be adjusted to provide enough memory for these 
271 buffers to be allocated.<br>
272 Depending on how heap is configured in your system, open your <b>startup_<i>device</i>.s</b> file from the \b Device group in the \b Project window 
273 or use a <b>linker script</b> to adjust the heap size.<br>
274 Set the <b>heap size</b> to minimum of <b>16384</b> bytes.
275
276 For details on heap requirements please refer to the \ref heap_req "Heap Memory requirements" documentation.
277
278
279 \section step7 Step 7: Configure the CMSIS-RTOS2 (Keil RTX5)
280
281 Open <b>RTX_Config.h</b> and set:
282 - <b>System Configuration: Global Dynamic Memory size [bytes]</b> to \a 16384
283 - <b>Thread configuration: Default Thread stack size [bytes]</b> to \a 3072
284
285 For details on CMSIS-RTOS2 requirements please refer to the \ref rtos2_req "CMSIS-RTOS2 requirements" documentation.
286
287 \section step8 Step 8: Configure the Device
288
289 Depending on your device, you might have different pin/hardware configuration options. Usually, you can configure the device
290 using the \c RTE_Device.h file from the \b Device group or with a vendor provided pin configuration tool. 
291 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> 
292 You can check the provided \ref examples "examples" as a reference point.
293
294 For a robust test with good coverage, implement various targets with different settings:
295 - Use <b>non-DMA (IRQ)</b> and <b>DMA</b> configurations if they are available on the driver
296 - Use different compiler <b>optimization levels</b> in the
297   <a href="http://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm" target="_blank">C/C++ tab</a> of the
298   <b>Options for Target</b> dialog
299
300
301 \section step9 Step 9: Setup the required hardware
302
303 For the interfaces that support loopback testing: \ref dv_eth "Ethernet", \ref dv_usart "USART" and \ref dv_spi "SPI", 
304 connect the following pins on your target hardware together (refer to the hardware schematics):
305
306 - Ethernet: RX+ and TX+, RX- and TX-
307 - USART:    RX and TX
308 - SPI:      MOSI and MISO
309
310 For the interfaces that support testing with dedicated server: \ref dv_wifi "WiFi" and \ref dv_spi "SPI", 
311 connect the related hardware as required by the related server:
312
313 - WiFi: WiFi module has to be in close proximity to the Access Point which is in the same network as the required \ref wifi_sock_setup
314 - SPI:  MOSI, MISO, SCLK, SS, GND to the same lines on the \ref spi_server
315
316
317 \section step10 Step 10: Download and Run the Project
318
319 In the <b>Options for Target</b> dialog, under debug settings, if you use ITM as standard output channel ensure that 
320 \b Trace and <b>ITM port 0</b> are enabled and that the correct <b>Core Clock</b> frequency is set:
321
322 \image html target_dialog.png "ITM Channel setting"
323
324 Build, load and run the project. The output is displayed in the <b>Debug (printf) Viewer</b> window.<br>
325 Example below shows output result of an SPI driver testing:
326 \verbatim
327 CMSIS-Driver_Validation v3.0.0 CMSIS-Driver SPI Test Report   March  30 2022   13:44:11 
328
329 TEST 01: SPI_GetVersion                   
330   DV_SPI.c (1023): [INFO] Driver API version 2.3, Driver version 2.15
331                                           PASSED
332 TEST 02: SPI_GetCapabilities              PASSED
333 TEST 03: SPI_Initialize_Uninitialize      PASSED
334 TEST 04: SPI_PowerControl                 
335   DV_SPI.c (1314): [WARNING] PowerControl (ARM_POWER_LOW) is not supported
336                                           PASSED
337 TEST 05: SPI_Mode_Master_SS_Unused        PASSED
338 TEST 06: SPI_Mode_Master_SS_Sw_Ctrl       PASSED
339 TEST 07: SPI_Mode_Master_SS_Hw_Ctrl_Out   PASSED
340 TEST 08: SPI_Mode_Master_SS_Hw_Mon_In     PASSED
341 TEST 09: SPI_Mode_Slave_SS_Hw_Mon         PASSED
342 TEST 10: SPI_Mode_Slave_SS_Sw_Ctrl        PASSED
343 TEST 11: SPI_Format_Clock_Pol0_Pha0       PASSED
344 TEST 12: SPI_Format_Clock_Pol0_Pha1       PASSED
345 TEST 13: SPI_Format_Clock_Pol1_Pha0       PASSED
346 TEST 14: SPI_Format_Clock_Pol1_Pha1       PASSED
347 TEST 15: SPI_Format_Frame_TI              PASSED
348 TEST 16: SPI_Format_Clock_Microwire       NOT EXECUTED
349 TEST 17: SPI_Data_Bits_1                  NOT EXECUTED
350 TEST 18: SPI_Data_Bits_2                  NOT EXECUTED
351 TEST 19: SPI_Data_Bits_3                  NOT EXECUTED
352 TEST 20: SPI_Data_Bits_4                  NOT EXECUTED
353 TEST 21: SPI_Data_Bits_5                  NOT EXECUTED
354 TEST 22: SPI_Data_Bits_6                  NOT EXECUTED
355 TEST 23: SPI_Data_Bits_7                  NOT EXECUTED
356 TEST 24: SPI_Data_Bits_8                  PASSED
357 TEST 25: SPI_Data_Bits_9                  NOT EXECUTED
358 TEST 26: SPI_Data_Bits_10                 NOT EXECUTED
359 TEST 27: SPI_Data_Bits_11                 NOT EXECUTED
360 TEST 28: SPI_Data_Bits_12                 NOT EXECUTED
361 TEST 29: SPI_Data_Bits_13                 NOT EXECUTED
362 TEST 30: SPI_Data_Bits_14                 NOT EXECUTED
363 TEST 31: SPI_Data_Bits_15                 NOT EXECUTED
364 TEST 32: SPI_Data_Bits_16                 PASSED
365 TEST 33: SPI_Data_Bits_17                 NOT EXECUTED
366 TEST 34: SPI_Data_Bits_18                 NOT EXECUTED
367 TEST 35: SPI_Data_Bits_19                 NOT EXECUTED
368 TEST 36: SPI_Data_Bits_20                 NOT EXECUTED
369 TEST 37: SPI_Data_Bits_21                 NOT EXECUTED
370 TEST 38: SPI_Data_Bits_22                 NOT EXECUTED
371 TEST 39: SPI_Data_Bits_23                 NOT EXECUTED
372 TEST 40: SPI_Data_Bits_24                 NOT EXECUTED
373 TEST 41: SPI_Data_Bits_25                 NOT EXECUTED
374 TEST 42: SPI_Data_Bits_26                 NOT EXECUTED
375 TEST 43: SPI_Data_Bits_27                 NOT EXECUTED
376 TEST 44: SPI_Data_Bits_28                 NOT EXECUTED
377 TEST 45: SPI_Data_Bits_29                 NOT EXECUTED
378 TEST 46: SPI_Data_Bits_30                 NOT EXECUTED
379 TEST 47: SPI_Data_Bits_31                 NOT EXECUTED
380 TEST 48: SPI_Data_Bits_32                 NOT EXECUTED
381 TEST 49: SPI_Bit_Order_MSB_LSB            PASSED
382 TEST 50: SPI_Bit_Order_LSB_MSB            PASSED
383 TEST 51: SPI_Bus_Speed_Min                PASSED
384 TEST 52: SPI_Bus_Speed_Max                
385   DV_SPI.c (3524): [WARNING] At requested bus speed of 10000000 bps, effective bus speed is 6477809 bps
386                                           PASSED
387 TEST 53: SPI_Number_Of_Items              PASSED
388 TEST 54: SPI_Abort                        PASSED
389 TEST 55: SPI_DataLost                     PASSED
390 TEST 56: SPI_ModeFault                    PASSED
391
392 Test Summary: 56 Tests, 25 Passed, 0 Failed.
393 Test Result: PASSED
394 \endverbatim
395
396 */
397 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
398 /**
399 \page report Report
400
401 The CMSIS-Driver Validation can output the test report in a <b>Plain Text</b> format or as an <b>XML</b> formatted file.<br>
402 Selection of the output report type is done in the <b>DV_Config.h</b> configuration file.
403
404 \image html dv_config_h.png "Configuration file DV_Config.h in Configuration Wizard view mode"
405
406 The <b>Plain Text</b> selection instructs the CMSIS-Driver Validation framework to generate a plain text report 
407 which can be seen in the <b>Debug (printf) Viewer</b> window and is mostly used for driver debugging purposes 
408 but can also be used as a final report.
409
410 The <b>XML</b> selection instructs the CMSIS-Driver Validation framework to generate an XML formatted report 
411 which is meant to be used as a final report and can be viewed nicely in any Web browser.<br>
412
413 The report file can be written into a <b>TestReport.xml</b> file directly by the uVision with an additional debugger script 
414 called <b>SaveXML.ini</b> which needs to be specified as <b>Initialization File:</b> for the <b>Debugger</b> in the 
415 <b>Options for target</b> dialog, or it can be copy-pasted manually from the <b>Debug (printf) Viewer</b> window to 
416 the TestReport.xml file.<br>
417 The SaveXML.ini script can be found in <c>\<pack root directory\></c><b>\\Scripts</b> directory.
418
419 To view <b>TestReport.xml</b> file in a Web browser an additional style sheet <b>TR_Style.xsl</b> file needs to be 
420 in the same directory as the TestReport.xml file.<br>
421 The TR_Style.xsl file contains the description of formatting for the Web browser to display the TestReport.xml report and 
422 can be found in <c>\<pack root directory\></c><b>\\Scripts</b> directory.
423
424
425 The XML file uses coloring to differentiate the results in the following way:
426  - <span style="font-weight:bold; color:Green">Passed</span> status means that test function has passed successfully.
427  - <span style="font-weight:bold; color:DarkOrange">Passed</span> status means that test function has passed but there were some warnings 
428      (<c>More details</c> can be used to see the details about warnings).
429  - <span style="font-weight:bold; color:Blue">Not executed</span> status means that test function did not check any assertions.
430  - <span style="font-weight:bold; color:Red">Failed</span> status means that test function has failed 
431      (<c>More details</c> can be used to see the details on reasons of failure).
432
433 */
434 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
435 /**
436 \page debugging Debugging
437
438 After running the CMSIS-Driver Validation output report is used to see if the driver is compliant to the CMSIS-Driver specification.
439
440 If the result of the driver testing under <c>Test Summary</c> contains any <c>Failed</c> tests then the driver needs to be corrected.
441
442 Example of report in the Plain Text format of a non-compliant SPI driver:
443 \verbatim
444 CMSIS-Driver SPI Test Report   May  6 2020   10:47:11 
445
446 TEST 01: SPI_GetVersion                   
447   DV_SPI.c (1023): [INFO] Driver API version 2.3, Driver version 2.15
448                                           PASSED
449 TEST 02: SPI_GetCapabilities              PASSED
450 TEST 03: SPI_Initialize_Uninitialize      
451   DV_SPI.c (1106): [FAILED]
452   DV_SPI.c (1109): [FAILED]
453   DV_SPI.c (1112): [FAILED]
454                                           FAILED
455 TEST 04: SPI_PowerControl                 
456   DV_SPI.c (1314): [WARNING] PowerControl (ARM_POWER_LOW) is not supported
457                                           PASSED
458 ...
459
460 Test Summary: 56 Tests, 24 Passed, 1 Failed.
461 Test Result: FAILED
462 \endverbatim
463
464 From previous report it is clear that one test function has failed.<br>
465 By Inspecting the details in previous report it is clear that <c>TEST 03: SPI_Initialize_Uninitialize</c> has failed 
466 on multiple assertions.<br>
467 Each failed assertion is recorded as a single  line in the test report.<br>
468 The failed assert information in the output report contains additional information about the <b>source module</b> and <b>line</b> 
469 in that module where the assertion is located with additional debugging info if available.
470
471 The documentation can be consulted regarding the failed function, for example in previous case 
472 documentation on the \ref SPI_Initialize_Uninitialize can be consulted.
473
474 Main way of fixing the driver consists of opening reported file mentioned as failed and inspecting the 
475 line in which failure was reported.
476
477 If there are many failures, it is recommended to deselect all tests except first failing one 
478 so it is easier to focus on just that failure.
479 Also, selecting only first failing test removes potential clutter from following failing tests that 
480 are all failing due to same cause.
481
482 In the previous report, opening <b>DV_SPI.c</b> module (available in the project) and inspecting the <b>1106</b> line 
483 which states:
484 \verbatim
485   // Driver is uninitialized and peripheral is powered-off:
486   // Call PowerControl(ARM_POWER_FULL) function and assert that it returned ARM_DRIVER_ERROR status
487   TEST_ASSERT(drv->PowerControl (ARM_POWER_FULL) == ARM_DRIVER_ERROR);
488 \endverbatim
489
490 informs us that call to <c>PowerControl (ARM_POWER_FULL)</c>, when driver is not initialized, is expected to 
491 return <c>ARM_DRIVER_ERROR</c> status code but it has returned a different status code instead.
492
493 We should put a breakpoint to this line and start the debug session.<br>
494 When the breakpoint is hit we can see that a call to <c>PowerControl (ARM_POWER_FULL)</c> has returned <c>ARM_DRIVER_OK</c> 
495 instead of expected <c>ARM_DRIVER_ERROR</c> status code.
496
497 We can now go into source code of the driver and fix this.
498
499 After we have fixed the driver, the report now looks like below:
500
501 \verbatim
502 CMSIS-Driver SPI Test Report   May  6 2020   11:15:30 
503
504 TEST 01: SPI_GetVersion                   
505   DV_SPI.c (1023): [INFO] Driver API version 2.3, Driver version 2.15
506                                           PASSED
507 TEST 02: SPI_GetCapabilities              PASSED
508 TEST 03: SPI_Initialize_Uninitialize      PASSED
509 TEST 04: SPI_PowerControl                 
510   DV_SPI.c (1314): [WARNING] PowerControl (ARM_POWER_LOW) is not supported
511                                           PASSED
512 ...
513
514 Test Summary: 56 Tests, 25 Passed, 0 Failed.
515 Test Result: PASSED
516 \endverbatim
517
518 The fix for the assertion failing in line 1106 has also fixed subsequent assertions 
519 in lines 1109 and 1112 thus the driver now reports no failed tests and reports that all 
520 of the 25 executed tests have passed.
521
522 This report could be used as an insurance that the SPI Driver on this device is compliant to the CMSIS-Driver specification.
523
524 The TestReport.xml report created instead of Plain Text opened in a Web browser looks similar to the the picture below:
525
526 \image html xml_report.png "XML test report"
527
528 */
529 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
530 /**
531 \page resource_requirements Resource Requirements
532
533 \section heap_req Heap Memory
534 Heap memory is used by the memory allocation functions.<br>
535 It is usually configured in the <a class="el" href="http://www.keil.com/support/man/docs/gsac/gsac_startupcodecortex.htm" target="_blank">startup_device.s</a>
536 file located under the \b Device component class but it can also, in some cases,  be configured by a <b>linker script</b> instead.
537
538 Some interface test functions allocate additional buffers from the heap memory.
539
540 The CMSIS-Driver Validation framework does not impose heap requirements because it does not use heap memory.
541
542 Each interface test module has specific requirements for the heap memory, default requirements are listed below:
543
544 | Interface test module   | Heap memory requirement (in bytes) |
545 | :---------------------: | :--------------------------------: |
546 | CAN                     | 128                                |
547 | Ethernet                | 1024                               |
548 | SPI                     | 12288                              |
549 | USART                   | 8192                               |
550
551 Interface test modules that are not listed in the previous table do not use heap memory.
552
553 The system heap memory size must support the largest heap requirement of any used interface test module.<br>
554 For example, if SPI driver testing is selected heap memory size should be set to at least 12 kB.
555
556 Suggested value for heap memory size is <b>16384</b> bytes.
557
558 \note Each module contains additional settings in related configuration file which are not exposed through 
559       Configuration Wizard and impact the heap memory requirement.<br>
560       If these values are changed please adjust heap memory size accordingly.
561
562 \section rtos2_req CMSIS-RTOS2
563
564 The thread requirements need to be reflected in the CMSIS-RTOS2 configuration. Refer to the
565 <a class="el" href="http://www.keil.com/pack/doc/cmsis/RTOS2/html/index.html" target="_blank">CMSIS-RTOS2 Reference</a> for further details.
566
567 For <a class="el" href="http://www.keil.com/pack/doc/cmsis/RTOS2/html/rtx5_impl.html" target="_blank">CMSIS-RTOS2 RTX5</a>, thread
568 requirements are configured in the
569 <a class=el href="http://www.keil.com/pack/doc/cmsis/RTOS2/html/config_rtx5.html" target="_blank">RTX_Config.h</a> file located
570 under the \b CMSIS component class:
571
572 | Option                                                            | Value                              |
573 | :---------------------------------------------------------------- | :--------------------------------: |
574 | System Configuration: Global Dynamic Memory size [bytes] (Note 1) | 16384                              |
575 | Thread Configuration: Default Thread Stack size [bytes]           | 3072                               |
576
577 \note Note 1: This setting is only necessary for WiFi driver testing, for other driver testing value of 4096 bytes is sufficient.
578
579 */
580 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
581 /**
582 \page examples Examples
583
584 The CMSIS-Driver Validation Software Pack contains a set of examples that show how to use the CMSIS-Driver Validation on 
585 a real hardware.<br>
586 Use <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> to copy them to your machine.
587
588 The following example projects are available:
589
590 - \subpage examples_xmc4500_relax
591 - \subpage examples_mcbstm32f200
592 - \subpage examples_mcbstm32f400
593 - \subpage examples_b_l475e_iot01a1
594 - \subpage examples_stm32f746g
595 - \subpage examples_ismart43362_e
596 - \subpage examples_esp8266
597 - \subpage examples_esp32
598 - \subpage examples_wizfi360
599
600 \anchor example_targets
601 Targets
602 -------
603
604 Example projects contain some of the following targets:
605 - <b>Create Report</b>: Test results and statistics are printed to the <b>TestReport\TestReport.xml</b> file. Open the file in a Web browser of your choice.
606 - \b Debug: Results and statistics are printed to the <b>Debug (printf) Viewer</b> window or to the <b>Virtual COM Port</b> through the on-board debugger.
607 - \b Release: Same as the Debug target but with higher level of code optimization selected.
608 */
609
610
611 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
612 /**
613 \page examples_xmc4500_relax Infineon XMC4500 Relax Kit
614
615 Software Setup
616 --------------
617
618 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
619 <b>Infineon::XMC4000_DFP</b> pack and copy the example project
620 <b>CMSIS-Driver Validation (XMC4500 Relax Lite Kit)</b> to your machine.
621
622 -# Choose one of the available \ref example_targets "Targets" and build the project.
623 -# If you wish to test the loopback mode for some of the interfaces, refer to the next section for proper board
624    configuration.
625 -# Run the validation on the target hardware using the on-board JLink-Lite debugger.
626
627 Hardware Setup
628 --------------
629
630 The following picture shows the necessary external loopback connections for the Infineon XMC4500 Relax Kit evaluation board:
631  - <b>UART2</b>: \b P0.4 (UART2_RX)  and \b P0.5 (UART2_TX)  (Header X2)
632  - <b>SPI0</b>:  \b P5.0 (SPI0_MOSI) and \b P5.1 (SPI0_MISO) (Header X2)
633  - For <b>Ethernet</b> use a loopback plug as described in \ref eth_loopback "Loopback Communication Setup". 
634
635 \image html xmc4500.png  "Connections for Loopback Communication Tests on the Infineon XMC4500 Relax Kit"
636
637 */
638 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
639 /**
640 \page examples_mcbstm32f200 Keil MCBSTM32F200
641
642 Software Setup
643 --------------
644
645 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
646 <b>Keil::STM32F2xx_DFP</b> pack and copy the example project
647 <b>CMSIS-Driver Validation (MCBSTM32F200)</b> to your machine.
648
649 -# Choose one of the available \ref example_targets "Targets" and build the project.
650 -# If you wish to test the loopback mode for some of the interfaces, refer to the next section for proper board
651    configuration.
652 -# Run the validation on the target hardware.
653
654 \note The example is preconfigured to use an 
655 <a href="http://www2.keil.com/mdk5/ulink/ulinkplus/" target="_blank">ULINKplus</a> debug adapter.
656
657
658 Hardware Setup
659 --------------
660
661 The following picture shows the necessary external loopback connections for the Keil MCBSTM32F200 evaluation board:
662  - <b>SPI2</b>: \b PB14 (SPI2_MISO) and \b PB15 (SPI2_MOSI) (for Loopback Test Mode)
663  - <b>USART1</b>: \b PB6 (USART1_TX) and \b PB7 (USART1_RX)
664  - For <b>Ethernet</b> use a loopback plug as described in \ref eth_loopback "Loopback Communication Setup". 
665
666 \image html mcbstm32f400.png  "Connections for Loopback Communication Tests on the Keil MCBSTM32F200"
667
668 */
669 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
670 /**
671 \page examples_mcbstm32f400 Keil MCBSTM32F400
672
673 Software Setup
674 --------------
675
676 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
677 <b>Keil::STM32F4xx_DFP</b> pack and copy the example project
678 <b>CMSIS-Driver Validation (MCBSTM32F400)</b> to your machine.
679
680 -# Choose one of the available \ref example_targets "Targets" and build the project.
681 -# If you wish to test the loopback mode for some of the interfaces, refer to the next section for proper board
682    configuration.
683 -# Run the validation on the target hardware.
684
685 \note The example is preconfigured to use an 
686 <a href="http://www2.keil.com/mdk5/ulink/ulinkplus/" target="_blank">ULINKplus</a> debug adapter.
687
688
689 Hardware Setup
690 --------------
691
692 The following picture shows the necessary external loopback connections for the Keil MCBSTM32F400 evaluation board:
693  - <b>SPI2</b>: \b PB14 (SPI2_MISO) and \b PB15 (SPI2_MOSI) (for Loopback Test Mode)
694  - <b>USART1</b>: \b PB6 (USART1_TX) and \b PB7 (USART1_RX)
695  - For <b>Ethernet</b> use a loopback plug as described in \ref eth_loopback "Loopback Communication Setup". 
696
697 \image html mcbstm32f400.png  "Connections for Loopback Communication Tests on the Keil MCBSTM32F400"
698
699 */
700 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
701 /**
702 \page examples_b_l475e_iot01a1 STMicroelectronics B-L475E-IOT01A1
703
704 Software Setup
705 --------------
706
707 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
708 <b>Keil::STM32L4xx_DFP</b> pack and copy the example project
709 <b>CMSIS-Driver WiFi Inventek ISM43362 Validation (B-L475E-IOT01A1)</b> to your machine.
710
711 -# Choose one of the available \ref example_targets "Targets" and build the project.
712 -# Run the validation on the target hardware using the on-board ST-Link/V2 debugger.
713
714 This example is prepared for verification of the WiFi driver and it requires \ref wifi_requirements "WiFi requirements", 
715 as well as, proper configuration described in \ref wifi_config "WiFi Configuration".
716
717 For details on WiFi driver validation please refer to \ref dv_wifi.
718
719 \image html b-l475e-iot01a.png  "STMicroelectronics B-L475E-IOT01A1 board"
720
721 */
722 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
723 /**
724 \page examples_ismart43362_e Inventek ISMART43362-E WiFi Shield with NXP LPCXpresso55S69
725
726 Software Setup
727 --------------
728
729 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
730 <b>NXP::LPC55S69_DFP</b> and <b>NXP::LPCXpresso55S69_EVK</b> packs and copy the example project
731 <b>CMSIS-Driver WiFi Inventek ISM43362 Validation (LPCXpresso55S69)</b> to your machine.
732
733 -# Choose one of the available \ref example_targets "Targets" and build the project.
734 -# Run the validation on the target hardware.
735
736 \note The example is preconfigured to use an 
737 <a href="http://www2.keil.com/mdk5/ulink/ulinkplus/" target="_blank">ULINKplus</a> debug adapter.
738
739 This example is prepared for verification of the WiFi driver and it requires \ref wifi_requirements "WiFi requirements", 
740 as well as, proper configuration described in \ref wifi_config "WiFi Configuration".
741
742 For details on WiFi driver tests please refer to \ref dv_wifi.
743
744 Hardware Setup
745 --------------
746
747 This example uses the ISMART module with SPI communication.<br>
748 By default, the shield is loaded with a UART firmware.<br>
749 Instructions on how to flash the SPI firmware can be found in the
750 [CMSIS-Driver documentation](https://arm-software.github.io/CMSIS-Driver/General/html/driver_WiFi.html#driver_ISM43362).
751
752 For proper operation of the Inventek ISMART43362-E WiFi Shield please connect the jumper between 5V_BOARD and 5V_MOD pins 
753 on the WiFi Shield.
754
755 \note Before running the validation on this hardware the WiFi Shield has to be reset by pressing SW2 push-button 
756 on the WiFi Shield and the debug session has to be started in less than 5 seconds after the reset push-button was released.
757
758 \image html lpcxpresso55s69.png  "NXP LPCXpresso55S69 with Inventek ISMART43362-E WiFi Shield attached"
759
760 */
761 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
762 /**
763 \page examples_esp8266 Espressif ESP8266 SparkFun WiFi Shield with NXP MIMXRT1064-EVK
764
765 Software Setup
766 --------------
767
768 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
769 <b>NXP::MIMXRT1064_DFP</b> and <b>NXP::EVK-MIMXRT1064_BSP</b> packs and copy the example project
770 <b>CMSIS-Driver WiFi Espressif ESP8266 Validation (EVK-MIMXRT1064)</b> to your machine.
771
772 -# Choose one of the available \ref example_targets "Targets" and build the project.
773 -# Run the validation on the target hardware using the on-board CMSIS-DAP Debugger.
774
775 This example is prepared for verification of the WiFi driver and it requires \ref wifi_requirements "WiFi equirements", 
776 as well as, proper configuration described in \ref wifi_config "WiFi Configuration".
777
778 For details on WiFi driver tests please refer to \ref dv_wifi.
779
780 \image html mimxrt1064evk.png    "NXP MIMXRT1064-EVK with"
781 \image html esp8266_sparkfun.png "Espressif ESP8266 SparkFun WiFi Shield"
782
783 */
784 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
785 /**
786 \page examples_esp32 Espressif ESP32 WROOM SparkFun Thing Plus WiFi Shield with NXP MIMXRT1064-EVK
787
788 Software Setup
789 --------------
790
791 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
792 <b>NXP::MIMXRT1064_DFP</b> and <b>NXP::EVK-MIMXRT1064_BSP</b> packs and copy the example project
793 <b>CMSIS-Driver WiFi Espressif ESP32 Validation (EVK-MIMXRT1064)</b> to your machine.
794
795 -# Choose one of the available \ref example_targets "Targets" and build the project.
796 -# Run the validation on the target hardware using the on-board CMSIS-DAP Debugger.
797
798 This example is prepared for verification of the WiFi driver and it requires \ref wifi_requirements "WiFi equirements", 
799 as well as, proper configuration described in \ref wifi_config "WiFi Configuration".
800
801 For details on WiFi driver tests please refer to \ref dv_wifi.
802
803 \image html mimxrt1064evk.png        "NXP MIMXRT1064-EVK with"
804 \image html esp32_wroom_sparkfun.png "Espressif ESP32 WROOM SparkFun Thing Plus WiFi Shield"
805
806 */
807 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
808 /**
809 \page examples_wizfi360 WIZnet WizFi360-EVB WiFi Shield with NXP MIMXRT1064-EVK
810
811 Software Setup
812 --------------
813
814 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
815 <b>NXP::MIMXRT1064_DFP</b> and <b>NXP::EVK-MIMXRT1064_BSP</b> packs and copy the example project
816 <b>CMSIS-Driver WiFi WIZnet WizFi360 Validation (EVK-MIMXRT1064)</b> to your machine.
817
818 -# Choose one of the available \ref example_targets "Targets" and build the project.
819 -# Run the validation on the target hardware using the on-board CMSIS-DAP Debugger.
820
821 This example is prepared for verification of the WiFi driver and it requires \ref wifi_requirements "WiFi equirements", 
822 as well as, proper configuration described in \ref wifi_config "WiFi Configuration".
823
824 For details on WiFi driver tests please refer to \ref dv_wifi.
825
826 \image html mimxrt1064evk.png "NXP MIMXRT1064-EVK with"
827 \image html wizfi360-evb.png  "WIZnet WizFi360-EVB WiFi Shield"
828
829 */
830 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
831 /**
832 \page examples_stm32f746g STMicroelectronics STM32F746G-Discovery
833
834 Software Setup
835 --------------
836
837 Using the <a href="http://www2.keil.com/mdk5/packinstaller" target="_blank">Pack Installer</a> install the latest 
838 <b>Keil::STM32F7xx_DFP</b> pack and copy the example project
839 <b>CMSIS-Driver Validation (STM32F746G-Discovery)</b> to your machine.
840
841 -# Choose one of the available \ref example_targets "Targets" and build the project.
842 -# If you wish to test the loopback mode for some of the interfaces, refer to the next section for proper board
843    configuration.
844 -# Run the validation on the target hardware using the on-board ST-Link/V2 debugger.
845
846
847 Hardware Setup
848 --------------
849
850 The following picture shows the necessary external loopback connections for the STMicroelectronics STM32F746G-Discovery evaluation board:
851  - <b>SPI2</b>: \b D12 (SPI2_MISO) and \b D11 (SPI2_MOSI)
852  - <b>USART6</b>: \b D1 (USART6_TX) and \b D0 (USART6_RX)
853  - For <b>Ethernet</b> use a loopback plug as described in \ref eth_loopback "Loopback Communication Setup". 
854
855 \image html stm32f746g-disco.png  "Connections for Loopback Communication Tests on STM32F746G-Discovery"
856
857 */