Skip to content

Surf 5 - Web server example in VS Code

Surf 5 - Web server exampleS

TheoIm

Published February 07, 2024

Surf 5 - Web server example in VS Code

Components

Hardware components Software Apps and online services

Project description

This project builds the Web example of Surf 5 in VS Code. It shows the process of flashing the extracted binary file to Surf 5 in boot mode using the ISP Tool and conducting a Web server test with Hercules.

If you are experiencing difficulties with the process mentioned above, please refer to the link below.

 

Hardware requirements

Before starting this project, prepare Surf 5 and a micro 5-pin cable, as well as an Ethernet connected to the internet.

 
Step 1: Prepare Software

The following serial terminal program is required for making web server , download and install from below links.

Step 2: Prepare hardware

  • Connect ethernet cable to Surf 5 ethernet port.
  • Connect Surf 5 to desktop or laptop using 5 pin micro USB cable.

Step 3: Setup Web Server Example

To test the Web Server example, Open VS Code and open the Surf 5 library project. If you created a workspace in 'How to make Projects in VS Code', it is recommended to open the workspace.

Step 3: Setup Web Server Example
  • After pressing the 'F7' button, check if the build is successful as indicated by the red square box below. If the build fails, return to 'How to make Projects in VS Code' and reconfigure the environment to ensure the build is successful.
Step 3: Setup Web Server Example
 
  • Navigate to 'Projects\W7500x_StdPeriph_Examples\WZTOE\WZTOE_WebServer\main.c' as shown below.
Step 3: Setup Web Server Example
  • If you have configured the network code to match your environment, press the build button below to rebuild.

 

Step 3: Setup Web Server Example

Step 4: Upload and Run

Web Server Mode

  • Please turn on the 'W7500 ISP Tool' for flashing.
Web Server Mode

 

  • Click the 'Browse' button in Step 5 of the tool. Then, select WZTOE_WebServer.bin located in the '...\W7500x-Surf5\build\Projects\W7500x_StdPeriph_Examples\WZTOE\WZTOE_WebServer' path.
Web Server Mode
Web Server Mode

 

  • Enter Surf 5 into boot mode and search for Surf 5's serial port, then press 'Open'.
Web Server Mode

 

  • If the connection to the tool is successful, a successful connection message will appear as below.
Web Server Mode

 

  • Press the 'Start All Steps' button to start flashing.
Web Server Mode
 
  • Use Hercules to connect to Surf 5 and verify that the message indicating DHCP has started appears.
Web Server Mode
 
  • After a slight delay once DHCP assignment is made, the message 'DHCP Success' will appear along with the creation of the web server's address (IP: 192.168.xxx.xxx).
Web Server Mode

 

  • By entering the IP address assigned by DHCP into a web browser window, the ADC values will be displayed as follows. (The ADC port is GPIO port C, pins 12 to 15.)
Web Server Mode
 
  • The information of the client that accessed the web server from Hercules can be verified as follows.
Web Server Mode
 
 

Comments

Comments