Skip to content

Commit c7649ea

Browse files
Add Driver Validation application template (#38)
1 parent 51c0a04 commit c7649ea

37 files changed

Lines changed: 4895 additions & 139 deletions

ARM.CMSIS-Driver_Validation.pdsc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<releases>
1111
<release version="3.1.0-dev">
1212
Active Development ...
13+
- Add Driver Validation application template
1314
- Add GPIO Driver validation
1415
- Update SPI Server application to CMSIS solution format
1516
- Add SPI Server application template
@@ -277,6 +278,13 @@
277278
</components> <!-- end of components sections -->
278279

279280
<examples>
281+
<example name="Driver Validation" doc="README.md" folder="Template">
282+
<description>CMSIS-Driver Validation application</description>
283+
<project>
284+
<environment name="csolution" load="CMSIS_DV.csolution.yml"/>
285+
</project>
286+
</example>
287+
280288
<example name="SPI Server" doc="README.md" folder="Tools/SPI_Server/STM32F429I-DISC1">
281289
<description>CMSIS-Driver Validation SPI Server application for STM32F429I-DISC1 board</description>
282290
<board name="STM32F429I-DISC1" vendor="STMicroelectronics"/>

Documentation/Doxygen/src/DriverValidation.txt

Lines changed: 70 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
1+
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
22
/**
33
\mainpage Overview
44

@@ -70,78 +70,41 @@ The table below provides information about the changes delivered with specific v
7070
/**
7171
\page setup Setup
7272

73-
\section step1 Step 1: Create an MDK project for your target microcontroller device
74-
75-
76-
\section step2 Step 2: Add the required software components
77-
78-
For proper operation, add the following software components in the <b>Manage Run-Time Environment</b> window:
79-
- <b>CMSIS Driver Validation: Framework</b>
80-
- <b>CMSIS Driver Validation: driver</b>, driver interfaces to be tested
81-
- <b>CMSIS Driver: driver</b>, driver implementations to be tested
82-
- <b>CMSIS: RTOS2 (API): Keil RTX5</b>
83-
- <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)
84-
- Resolve any unresolved component dependencies
85-
86-
87-
\section step3 Step 3: Add the application's main file (main.c)
88-
89-
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
90-
<b>CMSIS-RTOS2 'main' function</b> file from <b>CMSIS: RTOS2:Keil RTX5</b>.
91-
92-
Add this include:
93-
\code
94-
#include "cmsis_dv.h"
95-
\endcode
96-
97-
In the <c>app_main</c> function, create the \c cmsis_dv thread, before endless <c>for</c> loop:
98-
\code
99-
osThreadNew(cmsis_dv, NULL, NULL);
100-
\endcode
101-
to run all the tests that you have chosen in the next step.
102-
103-
104-
\section step4 Step 4: Configure the interface settings and tests in related DV_interface_Config.h files
105-
106-
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>
107-
For example for Serial Peripheral Interface (SPI) related config file name is DV_SPI_Config.h.
108-
109-
For details on interface specific configuration and test selection please check the Configuration section in the
110-
<a class="el" href="./topics.html">Reference</a> of the related interface.
111-
112-
113-
\section step5 Step 5: Configure the Heap memory
73+
Using the [Arm CMSIS Solution](https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution) VS Code extension,
74+
create a new solution from **template**:
11475

115-
Depending on the buffer sizes used for data transfer tests the heap size has to be adjusted to provide enough memory for these
116-
buffers to be allocated.<br>
117-
Depending on how heap is configured in your system, open your <b>startup_\<device\>.s</b> or <b>startup_\<device\>.c</b> file from the \b Device group in the \b Project window
118-
or use a <b>linker script</b> to adjust the heap size.<br>
119-
Set the <b>heap size</b> to minimum of <b>16384</b> bytes.
76+
\section step1 Step 1: In the **CMSIS** extension, click **Create a New Solution**.
77+
\image html server_new_sol_create.png
12078

121-
For details on heap requirements please refer to the \ref heap_req "Heap Memory requirements" documentation.
79+
\section step2 Step 2: Select the **Target Board**.
12280

81+
\section step3 Step 3: Under **Templates, Reference Applications, and Examples**, select **Driver Validation (CMSIS-Driver Validation application)**.
82+
\image html driver_validation_new_sol_template.png
12383

124-
\section step6 Step 6: Configure the CMSIS-RTOS2 (Keil RTX5)
84+
\section step4 Step 4: Choose **Solution Base Folder**, click **Create**.
85+
\image html driver_validation_new_sol_create.png
12586

126-
Open <b>RTX_Config.h</b> and set:
127-
- <b>System Configuration: Global Dynamic Memory size [bytes]</b> to \a 16384
128-
- <b>Thread configuration: Default Thread stack size [bytes]</b> to \a 3072
87+
\section step5 Step 5: Select the **Board Layer** that provides **required CMSIS Driver**, click **OK**.
88+
\image html driver_validation_new_sol_layer.png
12989

130-
For details on CMSIS-RTOS2 requirements please refer to the \ref rtos2_req "CMSIS-RTOS2 requirements" documentation.
90+
\section step6 Step 6: In the **Manage Solution**, under **Build Type** select desired Driver for validation, click **Save**.
91+
\image html driver_validation_build_type.png
13192

132-
\section step7 Step 7: Configure the Device
93+
\section step7 Step 7: Configure the Driver Tests in appropriate **DV_..._Config.h** file.
13394

134-
Depending on your device, you might have different pin/hardware configuration options. Usually, you can configure the device
135-
using the \c RTE_Device.h file from the \b Device group or with a vendor provided pin configuration tool.
136-
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>
137-
You can check the provided \ref examples "examples" as a reference point.
138-
139-
For a robust test with good coverage, implement various targets with different settings:
140-
- Use <b>non-DMA (IRQ)</b> and <b>DMA</b> configurations if they are available on the driver
141-
- Use different compiler <b>optimization levels</b> in the
142-
<a href="http://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm" target="_blank">C/C++ tab</a> of the
143-
<b>Options for Target</b> dialog
95+
> **Note:** `...` in **DV_`...`_Config.h** file depends on the driver being validated; for example, for Ethernet, the file would be **DV_ETH_Config.h** file.
14496

97+
For validation configuration of specific driver check respective driver documentation:
98+
- [CAN](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__can__config.html)
99+
- [Ethernet](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__eth__config.html)
100+
- [GPIO](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__gpio__config.html)
101+
- [I2C](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__i2c__config.html)
102+
- [MCI](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__mci__config.html)
103+
- [SPI](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__spi__config.html)
104+
- [USART](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__usart__config.html)
105+
- [USB Device](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__usbd__config.html)
106+
- [USB Host](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__usbh__config.html)
107+
- [WiFi](https://arm-software.github.io/CMSIS-Driver_Validation/latest/group__wifi__config.html)
145108

146109
\section step8 Step 8: Setup the required hardware
147110

@@ -152,89 +115,60 @@ connect the following pins on your target hardware together (refer to the hardwa
152115
- USART: RX and TX
153116
- SPI: MOSI and MISO
154117

155-
For the interfaces that support testing with dedicated server: \ref dv_wifi "WiFi" and \ref dv_spi "SPI",
118+
For the interfaces that support testing with dedicated server: \ref dv_wifi "WiFi", \ref dv_spi "SPI" and \ref dv_usart "USART"
156119
connect the related hardware as required by the related server:
157120

158121
- 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
159122
- SPI: MOSI, MISO, SCLK, SS, GND to the same lines on the \ref spi_server
123+
- USART: Tx, Rx, GND and optionally CLK, CTS, RTS, DCD and RI lines as described in \ref usart_server
160124

125+
\section step9 Step 9: Build and Run the application
161126

162-
\section step9 Step 9: Download and Run the Project
163-
164-
In the <b>Options for Target</b> dialog, under debug settings, if you use ITM as standard output channel ensure that
165-
\b Trace and <b>ITM port 0</b> are enabled and that the correct <b>Core Clock</b> frequency is set:
166-
167-
\image html target_dialog.png "ITM Channel setting"
168-
169-
Build, load and run the project. The output is displayed in the <b>Debug (printf) Viewer</b> window.<br>
170-
Example below shows output result of an SPI driver testing:
127+
Example below shows output results (in STDOUT channel) of an Ethernet driver testing:
171128
\verbatim
172-
CMSIS-Driver_Validation v3.0.0 CMSIS-Driver SPI Test Report March 30 2022 13:44:11
129+
CMSIS-Driver_Validation v3.1.0 CMSIS-Driver ETH Test Report Oct 9 2025 07:30:34
173130

174-
TEST 01: SPI_GetVersion
175-
DV_SPI.c (1023): [INFO] Driver API version 2.3, Driver version 2.15
131+
TEST 01: ETH_MAC_GetVersion
132+
DV_ETH.c (267): [INFO] API version 2.2, Driver version 3.1
176133
PASSED
177-
TEST 02: SPI_GetCapabilities PASSED
178-
TEST 03: SPI_Initialize_Uninitialize PASSED
179-
TEST 04: SPI_PowerControl
180-
DV_SPI.c (1314): [WARNING] PowerControl (ARM_POWER_LOW) is not supported
134+
TEST 02: ETH_MAC_GetCapabilities PASSED
135+
TEST 03: ETH_MAC_Initialization PASSED
136+
TEST 04: ETH_MAC_PowerControl
137+
DV_ETH.c (366): [WARNING] Low power is not supported
181138
PASSED
182-
TEST 05: SPI_Mode_Master_SS_Unused PASSED
183-
TEST 06: SPI_Mode_Master_SS_Sw_Ctrl PASSED
184-
TEST 07: SPI_Mode_Master_SS_Hw_Ctrl_Out PASSED
185-
TEST 08: SPI_Mode_Master_SS_Hw_Mon_In PASSED
186-
TEST 09: SPI_Mode_Slave_SS_Hw_Mon PASSED
187-
TEST 10: SPI_Mode_Slave_SS_Sw_Ctrl PASSED
188-
TEST 11: SPI_Format_Clock_Pol0_Pha0 PASSED
189-
TEST 12: SPI_Format_Clock_Pol0_Pha1 PASSED
190-
TEST 13: SPI_Format_Clock_Pol1_Pha0 PASSED
191-
TEST 14: SPI_Format_Clock_Pol1_Pha1 PASSED
192-
TEST 15: SPI_Format_Frame_TI PASSED
193-
TEST 16: SPI_Format_Clock_Microwire NOT EXECUTED
194-
TEST 17: SPI_Data_Bits_1 NOT EXECUTED
195-
TEST 18: SPI_Data_Bits_2 NOT EXECUTED
196-
TEST 19: SPI_Data_Bits_3 NOT EXECUTED
197-
TEST 20: SPI_Data_Bits_4 NOT EXECUTED
198-
TEST 21: SPI_Data_Bits_5 NOT EXECUTED
199-
TEST 22: SPI_Data_Bits_6 NOT EXECUTED
200-
TEST 23: SPI_Data_Bits_7 NOT EXECUTED
201-
TEST 24: SPI_Data_Bits_8 PASSED
202-
TEST 25: SPI_Data_Bits_9 NOT EXECUTED
203-
TEST 26: SPI_Data_Bits_10 NOT EXECUTED
204-
TEST 27: SPI_Data_Bits_11 NOT EXECUTED
205-
TEST 28: SPI_Data_Bits_12 NOT EXECUTED
206-
TEST 29: SPI_Data_Bits_13 NOT EXECUTED
207-
TEST 30: SPI_Data_Bits_14 NOT EXECUTED
208-
TEST 31: SPI_Data_Bits_15 NOT EXECUTED
209-
TEST 32: SPI_Data_Bits_16 PASSED
210-
TEST 33: SPI_Data_Bits_17 NOT EXECUTED
211-
TEST 34: SPI_Data_Bits_18 NOT EXECUTED
212-
TEST 35: SPI_Data_Bits_19 NOT EXECUTED
213-
TEST 36: SPI_Data_Bits_20 NOT EXECUTED
214-
TEST 37: SPI_Data_Bits_21 NOT EXECUTED
215-
TEST 38: SPI_Data_Bits_22 NOT EXECUTED
216-
TEST 39: SPI_Data_Bits_23 NOT EXECUTED
217-
TEST 40: SPI_Data_Bits_24 NOT EXECUTED
218-
TEST 41: SPI_Data_Bits_25 NOT EXECUTED
219-
TEST 42: SPI_Data_Bits_26 NOT EXECUTED
220-
TEST 43: SPI_Data_Bits_27 NOT EXECUTED
221-
TEST 44: SPI_Data_Bits_28 NOT EXECUTED
222-
TEST 45: SPI_Data_Bits_29 NOT EXECUTED
223-
TEST 46: SPI_Data_Bits_30 NOT EXECUTED
224-
TEST 47: SPI_Data_Bits_31 NOT EXECUTED
225-
TEST 48: SPI_Data_Bits_32 NOT EXECUTED
226-
TEST 49: SPI_Bit_Order_MSB_LSB PASSED
227-
TEST 50: SPI_Bit_Order_LSB_MSB PASSED
228-
TEST 51: SPI_Bus_Speed_Min PASSED
229-
TEST 52: SPI_Bus_Speed_Max
230-
DV_SPI.c (3524): [WARNING] At requested bus speed of 10000000 bps, effective bus speed is 6477809 bps
139+
TEST 05: ETH_MAC_MacAddress PASSED
140+
TEST 06: ETH_MAC_SetBusSpeed
141+
DV_ETH.c (445): [WARNING] Link speed 1G is not supported
231142
PASSED
232-
TEST 53: SPI_Number_Of_Items PASSED
233-
TEST 54: SPI_Abort PASSED
234-
TEST 55: SPI_DataLost PASSED
235-
TEST 56: SPI_ModeFault PASSED
236-
237-
Test Summary: 56 Tests, 25 Passed, 0 Failed.
143+
TEST 07: ETH_MAC_Config_Mode PASSED
144+
TEST 08: ETH_MAC_Config_CommonParams PASSED
145+
TEST 09: ETH_MAC_Control_Filtering PASSED
146+
TEST 10: ETH_MAC_SetAddressFilter PASSED
147+
TEST 11: ETH_MAC_VLAN_Filter
148+
DV_ETH.c (910): [WARNING] Received non VLAN tagged frame
149+
PASSED
150+
TEST 12: ETH_MAC_SignalEvent PASSED
151+
TEST 13: ETH_MAC_PTP_ControlTimer
152+
DV_ETH.c (1412): [WARNING] Precision Time Protocol is not supported
153+
NOT EXECUTED
154+
TEST 14: ETH_MAC_CheckInvalidInit PASSED
155+
TEST 15: ETH_PHY_GetVersion
156+
DV_ETH.c (1018): [INFO] API version 2.2, Driver version 1.3
157+
PASSED
158+
TEST 16: ETH_PHY_Initialization PASSED
159+
TEST 17: ETH_PHY_PowerControl
160+
DV_ETH.c (1114): [WARNING] Low power is not supported
161+
DV_ETH.c (1131): [WARNING] MAC is locked when PHY power is off
162+
PASSED
163+
TEST 18: ETH_PHY_Config PASSED
164+
TEST 19: ETH_PHY_CheckInvalidInit PASSED
165+
TEST 20: ETH_Loopback_Transfer PASSED
166+
TEST 21: ETH_Loopback_PTP
167+
DV_ETH.c (1574): [WARNING] Precision Time Protocol is not supported
168+
NOT EXECUTED
169+
TEST 22: ETH_Loopback_External PASSED
170+
171+
Test Summary: 22 Tests, 20 Passed, 0 Failed.
238172
Test Result: PASSED
239173
\endverbatim
240174

41.3 KB
Loading
31.2 KB
Loading
38.2 KB
Loading
52.1 KB
Loading

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Basic tests:
3333
| --------------------- | --------------------------------------------------------- |
3434
| [`Boards`](./Boards/) | Driver Validation examples for various boards |
3535
| [`Config`](./Config/) | Configuration files for the Driver Validation framework |
36-
| [`Documentation`](./Documentation) | Placeholder for the offline documentation in the pack |
37-
| [`DoxyGen`](./Doxygen) | Source of the documentation |
36+
| [`Documentation`](./Documentation) | Placeholder and source for the offline documentation in the pack |
3837
| [`Include`](./Include) | Header files for Driver Validation components |
3938
| [`Source`](./Source) | Source files for Driver Validation components |
39+
| [`Template`](./Template) | Driver Validation application template |
4040
| [`Tools`](./Tools) | Various Server implementations for extensive testing |
4141
| [`ARM.CMSIS-Driver_Validation.pdsc`](./ARM.CMSIS-Driver_Validation.pdsc) | Open-CMSIS-Pack description file |
4242
| [`gen_pack.sh`](./gen_pack.sh) | Open-CMSIS-Pack generation script |
@@ -55,7 +55,7 @@ Folder [`Boards`](./Boards/) contains example projects that show how to use the
5555
- Verify that following tools are installed on the PC:
5656
- git bash (e.g. for Windows: https://gitforwindows.org/)
5757
- ZIP archive creation utility (e.g. [7-Zip](http://www.7-zip.org/download.html))
58-
- Doxygen version 1.9.2 (https://sourceforge.net/projects/doxygen/files/rel-1.9.2/)
58+
- Doxygen version 1.13.2 (https://sourceforge.net/projects/doxygen/files/rel-1.13.2/)
5959
- Checkout this repository. For example in git bash with:
6060
```git clone https://github.com/ARM-Software/CMSIS-Driver_Validation```
6161
- In the local repository folder execute `./gen_pack.sh` in the bash shell.

Template/CMSIS_DV.cproject.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
project:
2+
description: CMSIS Driver Validation application
3+
4+
# List of packs used in the project.
5+
packs:
6+
- pack: ARM::CMSIS@^6.2.0
7+
- pack: ARM::CMSIS-Compiler@^2.1.0
8+
- pack: ARM::CMSIS-Driver_Validation@^3.1.0-0
9+
- pack: ARM::CMSIS-RTX@^5.9.0
10+
11+
# List of connections required or provided by the project.
12+
connections:
13+
- connect: Driver Validation
14+
provides:
15+
- CMSIS-RTOS2
16+
consumes:
17+
- STDOUT
18+
19+
# List of source groups and files.
20+
groups:
21+
- group: Documentation
22+
files:
23+
- file: README.md
24+
- group: Source Files
25+
files:
26+
- file: app_main.c
27+
28+
# List of components used by the application.
29+
components:
30+
- component: CMSIS:OS Tick:SysTick
31+
- component: CMSIS:RTOS2:Keil RTX5&Source
32+
- component: CMSIS Driver Validation:Framework
33+
- component: CMSIS Driver Validation:CAN
34+
for-context:
35+
- .CAN
36+
- component: CMSIS Driver Validation:Ethernet
37+
for-context:
38+
- .Ethernet
39+
- component: CMSIS Driver Validation:GPIO
40+
for-context:
41+
- .GPIO
42+
- component: CMSIS Driver Validation:I2C
43+
for-context:
44+
- .I2C
45+
- component: CMSIS Driver Validation:MCI
46+
for-context:
47+
- .MCI
48+
- component: CMSIS Driver Validation:SPI
49+
for-context:
50+
- .SPI
51+
- component: CMSIS Driver Validation:USART
52+
for-context:
53+
- .USART
54+
- component: CMSIS Driver Validation:USB Device
55+
for-context:
56+
- .USB_Device
57+
- component: CMSIS Driver Validation:USB Host
58+
for-context:
59+
- .USB_Host
60+
- component: CMSIS Driver Validation:WiFi
61+
for-context:
62+
- .WiFi
63+
64+
# List of layers.
65+
layers:
66+
- layer: $Board-Layer$
67+
type: Board
68+
69+
# List of executable file formats to be generated.
70+
output:
71+
type:
72+
- elf
73+
- hex
74+
- map

0 commit comments

Comments
 (0)