1 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
3 \defgroup wifi_requirements Requirements
6 The WiFi driver validation requires the following hardware:
7 - WiFi Access Point connected to the local network
8 - Hardware running SockServer (can be \ref sockserver_pc "PC running Microsoft Windows" or an
9 \ref sockserver_embedded "embedded system")
11 The WiFi driver validation requires the following software:
12 - \ref wifi_sock_setup "SockServer" application running in the same network as WiFi Access Point used for testing
16 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
18 \defgroup wifi_config Configuration
21 The WiFi driver validation settings are available in the <b>DV_WiFi_Config.h</b> configuration file.
23 Some settings depend on the test environment and need to be changed for proper operation of the WiFi driver validation.<br>
24 These settings can be found under <b>Configuration</b> settings in the <b>DV_WiFi_Config.h</b> configuration file and need to
27 \image html dv_wifi_config_h.png "DV_WiFi_Config.h configuration file in Configuration Wizard view mode"
29 <b>Station</b> related settings needed for WiFi module to connect to the WiFi Access Point in the local network:
33 - Channel: use 0 for auto-detect channel
34 - WPS PIN: PIN used for WPS tests (the Access Point has to have the same PIN enabled and WPS service running)
36 <b>Access Point</b> related settings needed for testing Access Point functionality (network creation) of the WiFi module:
40 - Channel: use 0 for auto-detect channel
41 - WPS PIN: PIN used for WPS tests (auxiliary station has to have the same PIN enabled)
43 <b>Socket</b> related setting needed for Socket API and Socket Operation tests:
44 - SockServer IP: IP address assigned to the SockServer on your local network
45 - Number of sockets: Number of sockets that the driver supports and that will be tested
47 \note IP address is displayed by the SockServer application (on the embedded board's LCD when using embedded SockServer).
49 Under <b>Tests</b> select testing functionality as required.
50 For details on tests performed by each test function please refer to \ref wifi_tests "WiFi Tests".
52 <b>Control</b>, <b>Management</b> and <b>Socket API (requires SockServer)</b> group of tests enable or disable
53 WiFi Driver API function tests respectively.
55 <b>Management (requires user interaction)</b> and <b>Socket Operation (requires SockServer)</b> group of tests
56 are used for more complex operational test of the WiFi driver.<br>
57 A brief description of each test functionality can be viewed by using
58 <a href="http://www.keil.com/support/man/docs/uv4/uv4_ut_configwizard.htm" target="_blank">Configuration Wizard</a>
59 view of the <b>DV_WiFi_Config.h</b> file and clicking on the test or hovering a mouse pointer over it.
64 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
66 \defgroup wifi_sock_setup SockServer
69 The \b SockServer is an application providing a set of services used by the WiFi CMSIS-Driver Validation suite to test the
70 Socket interface of the WiFi driver. It is located in the <b>.\\Tools\\SockServer</b> subdirectory of the pack root directory.
71 The SockServer is available for different target systems. It runs several standard network services.
73 The SockServer is available for following target systems:
74 - <b>Personal Computer</b> running Microsoft Windows (executable located in <b>.\\Tools\\SockServer\\PC\\Win</b>)
75 - <b>Keil MCB4300</b> evaluation board (µVision project located in <b>.\\Tools\\SockServer\\Embedded\\MDK\\Board\\MCB4300</b>)
76 - <b>Keil MCBSTM32F400</b> evaluation board (µVision project located in <b>.\\Tools\\SockServer\\Embedded\\MDK\\Board\\MCBSTM32F400</b>)
78 \note To run SockServer in an embedded system, you need a license for MDK-Professional (for the MDK-Middleware Network component).
80 The following services are available by SockServer:
81 - \b Echo service on port \token{7}, TCP and UDP
82 \n (two instances of TCP service, one instance of UDP service)
83 - \b Discard service on port \token{9}, TCP and UDP
84 \n (one instance of TCP service, one instance of UDP service)
85 - \b Chargen service on port \token{19}, TCP and UDP
86 \n (two instances of TCP service, one instance of UDP service)
87 - \b Assistant service on port \token{5000}
88 \n (helper service used to test WiFi sockets in server mode (socket accept functionality))
89 - \b Telnet service on port \token{23}
90 \n (SockServer status monitoring service)
92 \note SockServer provides the Telnet service only in embedded systems.
94 \section sockserver_pc SockServer for PC running Microsoft Windows
97 - Personal Computer running Microsoft Windows
98 - PC connection to local network
100 SockServer is already built and can be executed by running the SockServer.exe file in <b>.\\Tools\\SockServer\\PC\\Win</b>
102 If you need to change the functionality of SockServer, source files and a batch script for building the executable are
103 available in <b>.\\Tools\\SockServer\\PC\\Win</b>.
106 - SockServer build process requires Minimalist GNU for Windows (MinGW).
107 - To build the SockServer executable for Windows, follow these steps:
108 - Download and install MinGW from https://osdn.net/projects/mingw/releases/
109 - Set environment path in Microsoft Windows as explained under Environment Settings heading on http://www.mingw.org/wiki/Getting_Started
110 - Run <b>Build.bat</b> located in <b>.\\Tools\\SockServer\\PC\\Win</b> which will result in an executable that is located in
111 <b>.\\Tools\\SockServer\\PC\\Win</b>
113 \subsection sockserver_pc_win_troubleshooting Troubleshooting
115 Problems and solutions:
116 1. SockServer not responding to requests
117 - Open Windows firewall -> Advanced settings
118 - select inbound rules
119 - create a new custom rule (New Rule...)
121 - Program: This program path (select path to SockServer.exe)
122 - Action: Allow the connection
123 - Profile: Domain, Private (Public not advised)
125 2. Test computer not responding to ping
126 - Open Windows firewall -> Advanced settings
127 - select inbound rules, enable rule
128 File and Printer sharing (Echo request - ICMPv4-In)
130 - If rule does not exist, create a new custom rule (New Rule...)
132 - Program: All programs
133 - Protocol type: ICMPv4
134 - ICMP Settings: Customize - Specific ICMP types: Echo Request
135 - Scope: Any IP address
136 - Action: Allow the connection
137 - Profile: Domain, Private (Public not advised)
141 \section sockserver_embedded SockServer for embedded systems
144 - Keil MCB4300 or Keil MCBSTM32F400 evaluation board
145 - Wired Ethernet connection to local network
147 \subsection sockserver_embedded_telnet Using the Telnet service
149 The Telnet service provides information about received and sent data. This can help to resolve driver problems when WiFi
150 socket sending and receiving does not work. For example, when the transfer test fails, either \b SocketSend or
151 \b SocketRecv functions may have failed or both.
153 For the Telnet connection from the PC, open a CMD window. At the prompt, type the following command or use another Telnet
156 c:\>telnet sockserver
159 The initial page opens:
160 \image html SockServer.png "Initial telnet connection"
162 You can view the remote IP address, port number, receiving and transmitting counters with the \b stat command:
163 \image html SockMonitor.png "Status monitoring"
165 Status monitor constantly updates the SockServer status on the screen. To stop the screen update, press any
168 \note You might need to enable the Telnet service in Windows 10 first. Here's a
169 <a href="https://www.technipages.com/windows-10-enable-telnet" target="_blank">tutorial</a> on how to do this.
171 \subsection sockserver_embedded_porting Porting SockServer to other targets
173 Currently, the \b SockServer application is available for the \b MCB4300 and \b MCBSTM32F400 evaluation boards.
174 To create SockServer application for a different target device, follow the steps below:
175 -# Create new network project in µVision
176 -# Select and configure the following software components:
177 - \b Network:Core and configure the host name and pool size in \b Net_Config.c
179 #define NET_HOST_NAME "SockServer"
180 #define NET_MEM_POOL_SIZE 16384
182 - \b Network:Interface:Ethernet and configure the MAC address in \b Net_Config_ETH0.h to avoid collisions
184 #define ETH0_MAC_ADDR "1E-30-6C-A2-45-5A"
186 - \b Network:Socket:BSD and configure number of sockets in \b Net_Config_BSD.h
188 #define BSD_NUM_SOCKS 8
189 #define BSD_SERVER_SOCKS 4
191 - \b Network:Socket:TCP and configure number of sockets in \b Net_Config_TCP.h
193 #define TCP_NUM_SOCKS 9
195 - \b Network:Socket:UDP and configure number of sockets in \b Net_Config_UDP.h
197 #define UDP_NUM_SOCKS 10
199 - \b Network:Service:Telnet server and disable authentication in \b Net_Config_Telnet_Server.h
201 #define TELNET_SERVER_AUTH_ENABLE 0
203 - \b CMSIS \b Driver:Ethernet/MAC/PHY(API) depending on your hardware
204 -# Configure device specific hardware:
205 - Configure the CMSIS-Driver for Ethernet and other device specific components (clock system, I/O, ...)
206 as required. Please consult your device's/board's documentation for more information.
207 -# Copy and add \b SockServer.c and \b SockServer.h files to the project
208 -# Copy and add \b Telnet_Server_UIF.c to the project
209 -# Add the code to start the services in \b main.c
211 // Application main thread
212 static void app_main (void *argument) {
217 osThreadNew(DgramServer, NULL, NULL);
218 osThreadNew(StreamServer, NULL, NULL);
219 osThreadNew(TestAssistant, NULL, NULL);
222 -# Increase the default RTX stack size to 400 bytes in <b>RTX_Config.h</b>
224 #define OS_STACK_SIZE 400
226 -# Set the default global stack to 1024 bytes and heap to 6144 bytes in your device's \b startup \b file
228 Stack_Size EQU 0x00000400
229 Heap_Size EQU 0x00001800
232 \subsection sockserver_embedded_troubleshooting Troubleshooting
234 Problems and solutions:
235 1. SockServer on multiple embedded systems on the same local network
236 - Set unique ETH0_MAC_ADDR in Net_Config_ETH0.h for each embedded system in embedded system project
240 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
242 \defgroup wifi_sock_testing Socket testing
245 Due to limitations of WiFi modules and their Software Development Kits (SDK), often it is not possible to comply with
246 CMSIS-Driver BSD rules regarding function behavior or function return codes. Hence, the WiFi Driver tests accept alternative
247 error codes and report them as Warnings and considers certain error codes as acceptable for certain functions.
248 Exceptions to BSD-strict error codes and functionality are written below:
250 WiFi socket deviations from the BSD-strict specification
251 ========================================================
254 - bind socket to same address again<br>
255 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return codes: \token{0} or \token{ARM_SOCKET_ERROR}
257 - bind another socket to used address<br>
258 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EADDRINUSE<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
260 - bind on closed socket<br>
261 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
264 - listen on already listening socket<br>
265 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return codes: \token{0} or \token{ARM_SOCKET_ERROR}
267 - listen on unbound socket<br>
268 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
270 - listen on closed socket<br>
271 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
273 - listen on datagram socket<br>
274 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTSUP<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
277 - receive on disconnected socket<br>
278 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ECONNRESET<br>non BSD-strict accepted return codes: \token{ARM_SOCKET_EAGAIN} or \token{ARM_SOCKET_ERROR}
280 - accept on closed socket<br>
281 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
283 - listen on datagram socket<br>
284 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTSUP<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
286 - accept on datagram socket<br>
287 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTSUP<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
290 - connect socket to same address again<br>
291 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EISCONN<br>non BSD-strict accepted return codes: \token{0} or \token{ARM_SOCKET_ERROR}
293 - bind on connected socket<br>
294 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EISCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
296 - connect on closed socket<br>
297 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
299 - connect to non-existent port<br>
300 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ECONNREFUSED<br>non BSD-strict accepted return codes: \token{ARM_SOCKET_ETIMEDOUT} or \token{ARM_SOCKET_ERROR}
302 - connect to non-existent stream server<br>
303 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ETIMEDOUT<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
305 - connect on listening socket<br>
306 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
308 - connect datagram socket to unspecified address (0.0.0.0)<br>
309 <b>BSD-strict</b> expected return code \b 0<br>non BSD-strict accepted return codes: \token{ARM_SOCKET_EINVAL} or \token{ARM_SOCKET_ERROR}
310 (special case that deletes the socket destination & filtering address)
313 - recv on closed socket<br>
314 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
316 - recv on created socket<br>
317 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
319 - recv on bound socket<br>
320 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
322 - recv on listening socket<br>
323 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
326 - recvfrom on closed socket<br>
327 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
330 - send on closed socket<br>
331 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
333 - send on disconnected socket<br>
334 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ECONNRESET<br>non BSD-strict accepted return codes: >\token{0} or \token{ARM_SOCKET_EAGAIN} or \token{ARM_SOCKET_ERROR}
336 - send on created socket<br>
337 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
339 - send on bound socket<br>
340 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
342 - send on listening socket<br>
343 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
345 - send on closed socket<br>
346 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
349 - sendto on closed socket<br>
350 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
352 -# \b SocketGetSockName
353 - getsockname on closed socket<br>
354 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
356 - getsockname on unbound socket<br>
357 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
359 -# \b SocketGetPeerName
360 - getpeername on closed socket<br>
361 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
363 - getpeername on created socket<br>
364 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
366 - getpeername on bound socket<br>
367 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
369 - getpeername on listening socket<br>
370 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
373 - getsockopt on closed socket<br>
374 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
377 - setsockopt on closed socket<br>
378 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
381 - close already closed socket<br>
382 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{0}
384 -# \b SocketGetHostByName
385 - gethostbyname for non-existing host<br>
386 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EHOSTNOTFOUND<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}