1 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
3 \defgroup wifi_requirements WiFi 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 WiFi Configuration
21 The WiFi driver validation settings are available in the \c DV_Config.h file.
23 Some settings depend on the test environment and need to be changed for proper operation of WiFi driver validation.
24 These settings can be found under WiFi <b>Configuration</b> settings in the \c DV_Config.h file and need to be set as follows:
26 \image html dv_config_h_wifi_config.png "DV_Config.h header file in Configuration Wizard view mode"
28 <b>Station</b> related settings needed for WiFi module to connect to the WiFi Access Point in the local network:
32 - Channel: use 0 for auto-detect channel
33 - WPS PIN: PIN used for WPS tests (the Access Point has to have the same PIN enabled and WPS service running)
35 <b>Access Point</b> related settings needed for testing Access Point functionality of the WiFi module:
36 - SSID: SSID created by the WiFi module
39 - Channel: use 0 for auto-detect channel
40 - WPS PIN: PIN used for WPS tests (auxiliary station has to have the same PIN enabled)
42 <b>Socket</b> related setting needed for Socket API and Socket Operation tests:
43 - SockServer IP: IP address assigned to the SockServer on your local network
45 \note IP address is displayed by the SockServer application (on the embedded board's LCD when using embedded SockServer).
47 Under <b>Test Cases</b> select testing functionality as required.
49 <b>Control</b>, <b>Management</b> and <b>Socket API (requires SockServer)</b> group of tests enable or disable
50 WiFi Driver API function tests respectively.
52 <b>Management (requires user interaction)</b> and <b>Socket Operation (requires SockServer)</b> group of tests
53 are used for more complex operational test of the WiFi driver.
54 A brief description of each test functionality can be viewed by using
55 <a href="http://www.keil.com/support/man/docs/uv4/uv4_ut_configwizard.htm" target="_blank">Configuration Wizard</a>
56 view of the DV_Config.h file and clicking on the test or hovering a mouse pointer over it.
61 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
63 \defgroup wifi_sock_setup WiFi SockServer
66 The \b SockServer is an application providing a set of services used by the WiFi CMSIS-Driver Validation suite to test the
67 Socket interface of the WiFi driver. It is located in the <b>.\\Tools\\SockServer</b> subdirectory of the pack root directory.
68 The SockServer is available for different target systems. It runs several standard network services.
70 The SockServer is available for following target systems:
71 - <b>Personal Computer</b> running Microsoft Windows (executable located in <b>.\\Tools\\SockServer\\PC\\Win</b>)
72 - <b>Keil MCB4300</b> evaluation board (µVision project located in <b>.\\Tools\\SockServer\\Embedded\\MDK\\Board\\MCB4300</b>)
73 - <b>Keil MCBSTM32F400</b> evaluation board (µVision project located in <b>.\\Tools\\SockServer\\Embedded\\MDK\\Board\\MCBSTM32F400</b>)
75 \note To run SockServer in an embedded system, you need a license for MDK-Professional (for the MDK-Middleware Network component).
77 The following services are available by SockServer:
78 - \b Echo service on port \token{7}, TCP and UDP
79 \n (two instances of TCP service, one instance of UDP service)
80 - \b Discard service on port \token{9}, TCP and UDP
81 \n (one instance of TCP service, one instance of UDP service)
82 - \b Chargen service on port \token{19}, TCP and UDP
83 \n (two instances of TCP service, one instance of UDP service)
84 - \b Assistant service on port \token{5000}
85 \n (helper service used to test WiFi sockets in server mode (socket accept functionality))
86 - \b Telnet service on port \token{23}
87 \n (SockServer status monitoring service)
89 \note SockServer provides the Telnet service only in embedded systems.
91 \section sockserver_pc SockServer for PC running Microsoft Windows
94 - Personal Computer running Microsoft Windows
95 - PC connection to local network
97 SockServer is already built and can be executed by running the SockServer.exe file in <b>.\\Tools\\SockServer\\PC\\Win</b>
99 If you need to change the functionality of SockServer, source files and a batch script for building the executable are
100 available in <b>.\\Tools\\SockServer\\PC\\Win</b>.
103 - SockServer build process requires Minimalist GNU for Windows (MinGW).
104 - To build the SockServer executable for Windows, follow these steps:
105 - Download and install MinGW from https://osdn.net/projects/mingw/releases/
106 - Set environment path in Microsoft Windows as explained under Environment Settings heading on http://www.mingw.org/wiki/Getting_Started
107 - Run <b>Build.bat</b> located in <b>.\\Tools\\SockServer\\PC\\Win</b> which will result in an executable that is located in
108 <b>.\\Tools\\SockServer\\PC\\Win</b>
110 \subsection sockserver_pc_win_troubleshooting Troubleshooting
112 Problems and solutions:
113 1. SockServer not responding to requests
114 - Open Windows firewall -> Advanced settings
115 - select inbound rules
116 - create a new custom rule (New Rule...)
118 - Program: This program path (select path to SockServer.exe)
119 - Action: Allow the connection
120 - Profile: Domain, Private (Public not advised)
122 2. Test computer not responding to ping
123 - Open Windows firewall -> Advanced settings
124 - select inbound rules, enable rule
125 File and Printer sharing (Echo request - ICMPv4-In)
127 - If rule does not exist, create a new custom rule (New Rule...)
129 - Program: All programs
130 - Protocol type: ICMPv4
131 - ICMP Settings: Customize - Specific ICMP types: Echo Request
132 - Scope: Any IP address
133 - Action: Allow the connection
134 - Profile: Domain, Private (Public not advised)
138 \section sockserver_embedded SockServer for embedded systems
141 - Keil MCB4300 or Keil MCBSTM32F400 evaluation board
142 - Wired Ethernet connection to local network
144 \subsection sockserver_embedded_telnet Using the Telnet service
146 The Telnet service provides information about received and sent data. This can help to resolve driver problems when WiFi
147 socket sending and receiving does not work. For example, when the transfer test fails, either \b SocketSend or
148 \b SocketRecv functions may have failed or both.
150 For the Telnet connection from the PC, open a CMD window. At the prompt, type the following command or use another Telnet
153 c:\>telnet sockserver
156 The initial page opens:
157 \image html SockServer.png "Initial telnet connection"
159 You can view the remote IP address, port number, receiving and transmitting counters with the \b stat command:
160 \image html SockMonitor.png "Status monitoring"
162 Status monitor constantly updates the SockServer status on the screen. To stop the screen update, press any
165 \note You might need to enable the Telnet service in Windows 10 first. Here's a
166 <a href="https://www.technipages.com/windows-10-enable-telnet" target="_blank">tutorial</a> on how to do this.
168 \subsection sockserver_embedded_porting Porting SockServer to other targets
170 Currently, the \b SockServer application is available for the \b MCB4300 and \b MCBSTM32F400 evaluation boards.
171 To create SockServer application for a different target device, follow the steps below:
172 -# Create new network project in µVision
173 -# Select and configure the following software components:
174 - \b Network:Core and configure the host name and pool size in \b Net_Config.c
176 #define NET_HOST_NAME "SockServer"
177 #define NET_MEM_POOL_SIZE 16384
179 - \b Network:Interface:Ethernet and configure the MAC address in \b Net_Config_ETH0.h to avoid collisions
181 #define ETH0_MAC_ADDR "1E-30-6C-A2-45-5A"
183 - \b Network:Socket:BSD and configure number of sockets in \b Net_Config_BSD.h
185 #define BSD_NUM_SOCKS 8
186 #define BSD_SERVER_SOCKS 4
188 - \b Network:Socket:TCP and configure number of sockets in \b Net_Config_TCP.h
190 #define TCP_NUM_SOCKS 9
192 - \b Network:Socket:UDP and configure number of sockets in \b Net_Config_UDP.h
194 #define UDP_NUM_SOCKS 10
196 - \b Network:Service:Telnet server and disable authentication in \b Net_Config_Telnet_Server.h
198 #define TELNET_SERVER_AUTH_ENABLE 0
200 - \b CMSIS \b Driver:Ethernet/MAC/PHY(API) depending on your hardware
201 -# Configure device specific hardware:
202 - Configure the CMSIS-Driver for Ethernet and other device specific components (clock system, I/O, ...)
203 as required. Please consult your device's/board's documentation for more information.
204 -# Copy and add \b SockServer.c and \b SockServer.h files to the project
205 -# Copy and add \b Telnet_Server_UIF.c to the project
206 -# Add the code to start the services in \b main.c
208 // Application main thread
209 static void app_main (void *argument) {
214 osThreadNew(DgramServer, NULL, NULL);
215 osThreadNew(StreamServer, NULL, NULL);
216 osThreadNew(TestAssistant, NULL, NULL);
219 -# Increase the default RTX stack size to 400 bytes in \b RTX_Config.h
221 #define OS_STACK_SIZE 400
223 -# Set the default global stack to 1024 bytes and heap to 6144 bytes in your device's \b startup \b file
225 Stack_Size EQU 0x00000400
226 Heap_Size EQU 0x00001800
229 \subsection sockserver_embedded_troubleshooting Troubleshooting
231 Problems and solutions:
232 1. SockServer on multiple embedded systems on the same local network
233 - Set unique ETH0_MAC_ADDR in Net_Config_ETH0.h for each embedded system in embedded system project
237 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
239 \defgroup wifi_sock_testing WiFi Socket testing
242 Due to limitations of WiFi modules and their Software Development Kits (SDK), often it is not possible to comply with
243 CMSIS-Driver BSD rules regarding function behavior or function return codes. Hence, the WiFi Driver tests accept alternative
244 error codes and report them as Warnings and considers certain error codes as acceptable for certain functions.
245 Exceptions to BSD-strict error codes and functionality are written below:
247 WiFi socket deviations from the BSD-strict specification
248 ========================================================
251 - bind socket to same address again<br>
252 <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}
254 - bind another socket to used address<br>
255 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EADDRINUSE<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
257 - bind on closed socket<br>
258 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
261 - listen on already listening socket<br>
262 <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}
264 - listen on unbound socket<br>
265 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
267 - listen on closed socket<br>
268 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
270 - listen on datagram socket<br>
271 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTSUP<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
274 - receive on disconnected socket<br>
275 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ECONNRESET<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
277 - accept on closed socket<br>
278 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
280 - listen on datagram socket<br>
281 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTSUP<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
283 - accept 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}
287 - connect socket to same address again<br>
288 <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}
290 - bind on connected socket<br>
291 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EISCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
293 - connect on closed socket<br>
294 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
296 - connect to non-existent port<br>
297 <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}
299 - connect to non-existent stream server<br>
300 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ETIMEDOUT<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
302 - connect on listening socket<br>
303 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
305 - connect datagram socket to unspecified address (0.0.0.0)<br>
306 <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}
307 (special case that deletes the socket destination & filtering address)
310 - recv on closed socket<br>
311 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
313 - recv on created socket<br>
314 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
316 - recv on bound 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 listening 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}
323 - recvfrom on closed socket<br>
324 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
327 - send on closed socket<br>
328 <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 disconnected socket<br>
331 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ECONNRESET<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
333 - send on created socket<br>
334 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
336 - send on bound 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 listening 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 closed socket<br>
343 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ECONNRESET<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
346 - sendto on closed socket<br>
347 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
349 -# \b SocketGetSockName
350 - getsockname on closed socket<br>
351 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
353 - getsockname on unbound socket<br>
354 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EINVAL<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
356 -# \b SocketGetPeerName
357 - getpeername on closed socket<br>
358 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
360 - getpeername on created socket<br>
361 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ENOTCONN<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
363 - getpeername on bound 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 listening 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}
370 - getsockopt on closed socket<br>
371 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
374 - setsockopt on closed socket<br>
375 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}
378 - close already closed socket<br>
379 <b>BSD-strict</b> expected return code \b ARM_SOCKET_ESOCK<br>non BSD-strict accepted return code \token{0}
381 -# \b SocketGetHostByName
382 - gethostbyname for non-existing host<br>
383 <b>BSD-strict</b> expected return code \b ARM_SOCKET_EHOSTNOTFOUND<br>non BSD-strict accepted return code \token{ARM_SOCKET_ERROR}