CMSIS-Driver Validation  
Driver Validation
SockServer

The SockServer is an application providing a set of services used by the WiFi CMSIS-Driver Validation suite to test the Socket interface of the WiFi driver. It is located in the .\Tools\SockServer subdirectory of the pack root directory. The SockServer is available for different target systems. It runs several standard network services.

The SockServer is available for following target systems:

Note
To run SockServer in an embedded system, you need a license for MDK-Professional (for the MDK-Middleware Network component).

The following services are available by SockServer:

Note
SockServer provides the Telnet service only in embedded systems.

SockServer for PC running Microsoft Windows

Requirements:

SockServer is already built and can be executed by running the SockServer.exe file in .\Tools\SockServer\PC\Win

If you need to change the functionality of SockServer, source files and a batch script for building the executable are available in .\Tools\SockServer\PC\Win.

Note
  • SockServer build process requires Minimalist GNU for Windows (MinGW).
  • To build the SockServer executable for Windows, follow these steps:

Troubleshooting

Problems and solutions:

  1. SockServer not responding to requests
    • Open Windows firewall -> Advanced settings
      • select inbound rules
    • create a new custom rule (New Rule...)
      • Rule type: Program
      • Program: This program path (select path to SockServer.exe)
      • Action: Allow the connection
      • Profile: Domain, Private (Public not advised)
      • Name: SockServer
  2. Test computer not responding to ping
    • Open Windows firewall -> Advanced settings
      • select inbound rules, enable rule File and Printer sharing (Echo request - ICMPv4-In)
    • If rule does not exist, create a new custom rule (New Rule...)
      • Rule type: Custom
      • Program: All programs
      • Protocol type: ICMPv4
      • ICMP Settings: Customize - Specific ICMP types: Echo Request
      • Scope: Any IP address
      • Action: Allow the connection
      • Profile: Domain, Private (Public not advised)
      • Name: Ping Echo

SockServer for embedded systems

Requirements:

Using the Telnet service

The Telnet service provides information about received and sent data. This can help to resolve driver problems when WiFi socket sending and receiving does not work. For example, when the transfer test fails, either SocketSend or SocketRecv functions may have failed or both.

For the Telnet connection from the PC, open a CMD window. At the prompt, type the following command or use another Telnet client application:

c:\>telnet sockserver

The initial page opens:

Initial telnet connection

You can view the remote IP address, port number, receiving and transmitting counters with the stat command:

Status monitoring

Status monitor constantly updates the SockServer status on the screen. To stop the screen update, press any telnet client key.

Note
You might need to enable the Telnet service in Windows 10 first. Here's a tutorial on how to do this.

Porting SockServer to other targets

Currently, the SockServer application is available for the MCB4300 and MCBSTM32F400 evaluation boards. To create SockServer application for a different target device, follow the steps below:

  1. Create new network project in µVision
  2. Select and configure the following software components:
    • Network:Core and configure the host name and pool size in Net_Config.c
      #define NET_HOST_NAME "SockServer"
      #define NET_MEM_POOL_SIZE 16384
    • Network:Interface:Ethernet and configure the MAC address in Net_Config_ETH0.h to avoid collisions
      #define ETH0_MAC_ADDR "1E-30-6C-A2-45-5A"
    • Network:Socket:BSD and configure number of sockets in Net_Config_BSD.h
      #define BSD_NUM_SOCKS 8
      #define BSD_SERVER_SOCKS 4
    • Network:Socket:TCP and configure number of sockets in Net_Config_TCP.h
      #define TCP_NUM_SOCKS 9
    • Network:Socket:UDP and configure number of sockets in Net_Config_UDP.h
      #define UDP_NUM_SOCKS 10
    • Network:Service:Telnet server and disable authentication in Net_Config_Telnet_Server.h
      #define TELNET_SERVER_AUTH_ENABLE 0
    • CMSIS Driver:Ethernet/MAC/PHY(API) depending on your hardware
  3. Configure device specific hardware:
    • Configure the CMSIS-Driver for Ethernet and other device specific components (clock system, I/O, ...) as required. Please consult your device's/board's documentation for more information.
  4. Copy and add SockServer.c and SockServer.h files to the project
  5. Copy and add Telnet_Server_UIF.c to the project
  6. Add the code to start the services in main.c
    // Application main thread
    static void app_main (void *argument) {
    netInitialize ();
    osDelay (500);
    osThreadNew(DgramServer, NULL, NULL);
    osThreadNew(StreamServer, NULL, NULL);
    osThreadNew(TestAssistant, NULL, NULL);
    }
  7. Increase the default RTX stack size to 400 bytes in RTX_Config.h
    #define OS_STACK_SIZE 400
  8. Set the default global stack to 1024 bytes and heap to 6144 bytes in your device's startup file
    Stack_Size EQU 0x00000400
    Heap_Size EQU 0x00001800

Troubleshooting

Problems and solutions:

  1. SockServer on multiple embedded systems on the same local network
    • Set unique ETH0_MAC_ADDR in Net_Config_ETH0.h for each embedded system in embedded system project